- 博客(36)
- 资源 (1)
- 收藏
- 关注

原创 在windows xp下用vs2005编译perl模块的要点
在windows xp下用vs2005编译perl模块时,需要将清单文件嵌入到.dll文件中,否则编译出来的.dll文件不能正常使用,报R6034错误。进入到要编译的模块的根目录,用如下命令行即可一次将所有.dll文件的清单文件嵌入.dll文件中:dir *.dll /s /w /b | perl -e"while(
2008-04-03 11:21:00
1022

原创 在windows平台下在C语言中调用perl脚本
OS: Windows XP SP2Complier:Microsoft Visual Studio C++ 20051. 下载并安装ActivePerl-5.8.8.819-MSWin32-x86-267479.msi安装包。2. 用cpan安装ExtUtils::Embed模块.3. 从cpan下载MExtUtils::Embed安装包,从中提取genmake脚本。4. 安装ActiveP
2008-04-03 11:07:00
2341
原创 'ppm upgrade failed: DBD::SQLite::db selectrow_array failed: database disk image is malformed' 问题的解决
问题:用ppm升级Perl软件包,出现错误:d:\shell>ppm upgrade --installDownloading ActiveState Package Repository dbimage...doneppm upgrade failed: Can't uncompress C:\Users\zzz\AppData\Local/ActiveState/ActiveP
2016-02-29 09:24:23
5633
原创 Perl Syslog server
use strict;use Net::Dev::Tools::Syslog;sub test{print scalar(@_), "\n";#print "@_\n";}my ($listen, $error) = Net::Dev::Tools::Syslog->listen( -proto => 'udp',
2015-06-29 16:44:09
1530
原创 删除Linux空目录
du -h * | grep '4.0K' | cut -f 2 | perl -e 'open FH../t.txt"; my @lines = ; close FH; my %t; for(@lines){my ($k, $v) = split / -> /, $_; $t{$k} = $v} ;while(
2014-04-03 11:19:06
1797
原创 openssl简明使用手册
openssl简明使用手册简要介绍了使用openssl来生成CA证书、申请证书、颁发证书以及撤销证书的过程1. 首先建立CA密钥:openssl genrsa -des3 -out ca.key 1024 (创建密钥)chmod 400 ca.key (修改权限为仅root能访问)openssl rsa -noout -text -in ca.key (查看创建
2014-04-03 11:17:46
1663
原创 以后要多多在优快云写文章,总结自己学的知识
这些年来,陆续学了不少东西,绝大多数都是浅尝辄止,感觉很无头绪,从今天开始要整理记录自己的知识体系。沉淀一些有用的知识。
2013-12-27 16:24:26
1603
原创 Android中Form Post方式提交,上传文件的实现
package com.zzz.Test;import java.io.DataOutputStream;import java.io.FileInputStream;import java.io.InputStream;import java.net.HttpURLConnection;import java.net.URL;import java.util.List;impor
2013-02-01 10:14:51
2509
原创 Perl访问华为系列交换机路由器配置参数模块
#包名:HWNET 功能:对华为交换机和路由器进行自动维护的包 引用方法:use HWNET;#package HWNET;use strict; use Data::Dump qw(dump); use Net::Telnet; use POSIX qw(strftime);use Net::Ping;## 用于测试的子程序#sub test{ #读取子程序参数
2013-02-01 10:02:29
2505
原创 用Perl访问华为交换机配置示例
#!/usr/bin/perl -wuse lib '../hwlib';use Net::Telnet;use Time::Local;use POSIX qw(strftime);use HWNET;use Net::Ping;my $p = Net::Ping->new();my $host='10.49.64.1';if(!$p->ping($host)){
2013-02-01 10:00:36
2014
原创 用Perl访问ftp服务器
#!/usr/bin/perluse Net::FTP;$ftp = Net::FTP->new("133.109.9.1", Debug => 0)or die "Cannot connect to some.host.name: $@";$ftp->login("ftpuser",'ftppwd')or die "Cannot login ", $ftp->message;$ft
2013-02-01 09:56:56
1960
原创 用Perl语言读取网络设备SNMP信息
#!/usr/bin/perluse strict;use Net::SNMP;my ($session, $error) = Net::SNMP->session( -hostname => shift || '133.109.9.78', -community => shift || 'public', -port => shift || 161 );if (
2013-02-01 09:54:11
2769
原创 用Perl语言登录Cisco PIX防火墙修改配置
################################################### Open the internet connection for an ip address.# Usage: inet_conn.pl [-e | -d ] ip_address################################################### 应该
2013-02-01 09:52:05
1790
原创 用VBScript修改本机IP地址
Dim IP,NameIp=Inputbox ("请输入IP")strComputer = "."Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")Set colNetAdapters = objWMIService.ExecQuery _ ("Select * from Win32_
2013-02-01 09:46:59
2243
原创 组合的C语言实现
int combine(int a[],int sub){ //a[1..?]表示候选集,sub表示一个排列(组合)的元素个数 { int total=sizeof(a); int order[sub+1]; int count=0;//符合条件的排列(组合)的个数 order[0]=-1; for(int i=1;i<=sub;i++)
2013-01-30 15:41:20
1858
原创 全排列和组合算法的C#语言实现
using System;namespace Util.Comp { public class CombinationPermutation { public static void Main() { //全排列使用方法 foreach(string s in Permutation(new string[] {"a", "b", "c"})
2013-01-30 15:07:05
3377
原创 Ubuntu Linux中禁止和开启Apache自动启动的方法
sudo update-rc.d apache2 {disable | enable}
2011-12-10 08:39:35
2230
原创 Android中hmac用法
try {String key = "1234567890", pass="pass";SecretKeySpec sks = new SecretKeySpec(key.getBytes(), "hmacmd5");Mac mac = Mac.getInstance("hmacmd5");mac.init(sks);mac.update(pass.getBytes()
2011-11-15 15:41:44
1818
原创 使用grep搜索目录树中文件的指定内容
在类unix系统中有一个在文件中搜索匹配的模式的命令grep。这个命令在搜索指定文件中的特定内容时十分有用,特别是在众多的源代码文件树中搜索对指定字符串的引用。
2010-11-10 08:53:00
1531
原创 Create a file
File f = new File("/sdcard", "test.txt");try { f.createNewFile();} catch (IOException e) { e.printStackTrace();}
2010-08-31 21:41:00
635
原创 HttpClient usage
<br />// HttpClient usage<br />AbstractHttpClient hc = new DefaultHttpClient();<br />HttpGet r = new HttpGet("http://www.baidu.com/");<br />try {<br /> hc.execute(r);<br />} catch (ClientProtocolException e) {<br /> e.printStackTrace();<br />} catch (IOExc
2010-08-31 21:39:00
590
原创 Android SharedPreferences's usage
<br />// get SharedPreferences object<br />// Activity.getPreferences(int mode)<br />SharedPreferences mPrefs = getPreferences(MODE_PRIVATE);<br />// read string value<br />String text = mPrefs.getString("test", "none");<br />// write string value<br />Sha
2010-08-31 21:35:00
500
原创 Android中获得屏幕的物理像素尺寸(x * y)
<br />Android中获得设备屏幕的横向和纵向物理象素数, 请在Activity.onCreate(Bundle bundle)中使用如下代码:<br /> <br />DisplayMetrics dm = new DisplayMetrics();<br />getWindowManager().getDefaultDisplay().getMetrics(dm);<br />int x = (int)(0.5+dm.widthPixels*dm.density);<br />int y = (i
2010-08-26 17:00:00
1685
原创 Android编程中,发生android.view.ViewRoot$CalledFromWrongThreadException异常的解决方案
在Android平台下,进行多线程编程时,经常需要在主线程之外的一个单独的线程中进行某些处理,然后更新用户界面显示。但是,在主线线程之外的线程中直接更新页面显示的问题是:系统会报这个异常,android.view.ViewRoot$CalledFromWrongThreadException: Only the original thread that created a view hierarchy can touch its views. (只有原始创建这个视图层次(view hierachy)的线程才
2010-08-19 14:09:00
2038
原创 Android中发短信的代码
SmsManager sms = SmsManager.getDefault(); sms.sendTextMessage("接收短信的手机号码", null, "Hello, friend. I'm your friend. Android test.", null, null);
2010-08-17 17:17:00
2647
原创 Perl中查看已安装的模块列表
<br />Available commands are:<br /> l - List all installed modules<br /> m <module> - Select a module<br /> q - Quit the program<br />cmd?<br /> <br />
2010-08-17 17:10:00
1143
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人