时光·漫步
xmeteor · 共 47 篇文章
Bat中一个对字符串进行分割和连接操作的例子
@echo off setlocal enabledelayedexpansion set errorlevel=>nul rem set “JAVA_OPTS=-Dprogram.name=run.bat -Xms128M -Xmx512M -XX:MaxPermSize=256M -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000 -Dorg.jboss.resolver.warning=true -server -Djava.library.path=C:\jboss-5.1.0…
2013-01-14 17:36 · 评论(0)
setlocal enabledelayedexpansion的作用
**例1: ** @echo off set a=4 set a=5&echo %a% pause 结果:4 解说:为什么是4而不是5呢?在echo之前明明已经把变量a的值改成5了?让我们先了解一下批处理运行命令的机制:批处理读取命令时是按行读取的(另外例如for命令等,其后用一对圆括号闭合的所有语句也当作一行),在处理之前要完成必要的预处理工作,这其中就包括对该行命令中的变量赋值。我们现在分析一下例1,批处理在运行到这句“set a=5&echo %a%”之前,先把这一句整句读取并做了预处理——对变量a赋了值,那么%a%当然就是4了!(没有为什么,批处理就是这样做的。)而为了能够感知环境变…
2013-01-14 17:28 · 评论(0)
Perl中经常使用的一些方法
检测操作系统的类型 print "$^O\n"; linux on Linux and MSWin32 on Windows use English qw' -no_match_vars '; print "$OSNAME\n"; use Config; print "$Config{osname}\n"; print "$Config{archname}\n"; http://stackoverflow.com/questions/334686/how-can-i-detect-the-operating-system-in-perl 取得文件名称 my $fileName = $file…
2013-01-05 17:32 · 评论(0)
Jmeter - XPath Extractor
在一组测试操作中,有时候当前的测试Case需要使用上一测试Case产生的的变量,这个时候我们就需要使用XPath Extractor XPath Extractor 引用名称: TOKEN XPath query: //form/input/@value (XPath query的用法参见Apache的文档) Http Request Parameters: Name: token Value: ${TOKEN} http://test-china.org/topics/28 http://jmeter.apache.org/usermanual/component_reference.ht…
2012-12-28 15:52 · 评论(0)
录制Jmeter脚本
录制Jmeter脚本有两个简单的方法: 使用Badboy录制,比较简单 http://www.badboy.com.au/ 使用Jmeter的Http代理服务器 http://www.cnblogs.com/wdpp/archive/2011/04/25/2386263.html 在“WorkBench”右键 -> “Add” -> “Non-Test Elements” -> “HTTP Proxy Server”; 在“HTTP Proxy Server”窗口的的“Test plan content” -> “Target controller:”选项中选择“Use Recording …
2012-12-28 15:37 · 评论(0)
Perl - Array to Hash
C1 C2 C3 C4 C5 11 12 13 14 15 21 22 23 24 25 my $data = [ [11,12,13,14,15], [21,22,23,24,25] ]; my $column_ids = ["c1", "c2", "c3", "c4", "c5"]; # %h - {'C1'=>'x1', 'C2'=>'x2', 'C3'=>'x3', 'C5'=>'x4', 'C5'=>'x5'} my $results = [map { my %h; @h{ @$column_ids } = split(",", $_); \%h } @$data]; result…
2012-12-28 15:24 · 评论(0)
Bugzilla Extension的开发
http://www.bugzilla.org/docs/4.2/en/html/api/Bugzilla/Extension.html 创建一个extension的开发框架 extensions/create.pl TEST 程序的Hook写在extensions/TEST/Extension.pm里,有哪些Hook可以用,可参考下面的链接,或者参考extensions/Example/Extension.pm http://www.bugzilla.org/docs/4.2/en/html/api/Bugzilla/Hook.html#HOOKS 模板的Hook放到”extensions…
2012-10-12 11:57 · 评论(0)
使用Komodo远程Debug CGI
在Komodo中指定Debug端口 Edit->Preferences->Debugger->Connection->a specific port: 9000 Copy "C:\Program Files\ActiveState Komodo IDE 6\lib\support\dbgp\perllib"到远程主机的"/home/test/lib"目录 在Apache的httpd.conf文件中加入下面的参数 SetEnv PERL5LIB "/home/test/lib/perllib/" SetEnv PERLDB_OPTS "RemotePort=192.168.96.103:900…
2012-10-12 11:36 · 评论(0)
Insecure dependency while running with -T switch
Mysql更新的时候报错: Insecure dependency in parameter 1 of DBI::st=HASH(0x19dd70)->FETCH method call while running with -T switch sub trick_taint { require Carp; Carp::confess("Undef to trick_taint") unless defined $_[0]; my $match = $_[0] =~ /^(.*)$/s; $_[0] = $match ? $1 : undef; return (defined($_[0]))…
2012-09-03 16:59 · 评论(0)
swinstall error - cannot access remote file
有两个方法解决这个问题 1. 检查"/etc/hosts"文件里面是否有"127.0.0.1", 如果有注释掉。 2. swinstall -s /soft/test.depot 在安装UI界面中的Option菜单里选中"All targets to resolve the source locally"
2012-06-21 17:47 · 评论(0)
将Python脚本文件转化成Windows可执行exe文件
下载安装Python ( http://www.python.org/ftp/python/ ) 下载安装Setuptools ( http://pypi.python.org/pypi/setuptools ) 运行"<PYTHON_HOME>\scripts\easy_install.exe --always-unzip -U install_lib" 安装你的依赖包 下载安装py2exe ( http://sourceforge.net/projects/py2exe/files/py2exe/ ) 写一个setup.py文件 from distutils.core import se…
2012-05-28 10:40 · 评论(0)
在Windows上安装配置Git
http://help.github.com/win-set-up-git/ https://help.github.com/articles/generating-ssh-keys http://help.github.com/fork-a-repo/
2012-05-18 11:57 · 评论(0)
How to debug apache module
http://httpd.apache.org/dev/debugging.html 1. gdb /apache_home/bin/httpd 2. r -X 3. Ctrl + C 4. b xxx 5. c
2012-05-03 16:19 · 评论(0)
ERROR: Could not configure Apache
During installation, if saw: ./configure:Error: APACI failed ERROR: Could not configure Apache Use following commands to fix it. rm /bin/sh (or if you want to be safe: mv /bin/sh /bin/sh.dash) ln -s /bin/bash /bin/sh It is because Ubuntu developers have replaced Bash with Dash, so the regular /bin/…
2012-05-02 11:04 · 评论(0)
Linux NFS Mount: wrong fs type, bad option, bad superblock on fs2:/data3
Refference: http://www.cyberciti.biz/faq/missing-codepage-helper-program-other-error/ I've netapp NFS server with /data3 as shared directory. I type the following command at Ubuntu Linux to mount the NFS server: mount fs2:/data3 /nfs/ OR mount 192.168.1.100:/data3 /nfs/ But I'm getting an error whi…
2012-04-28 13:49 · 评论(0)