上一页 1 2 3 4 5 6 7 8 9 10 ··· 24 下一页
摘要: 可以在自己的shell配置中自定义自己常用的alias,例如我使用csh,定义在~/.cshrc中。通用的alias:alias cd1 'cd ../'alias cd2 'cd ../ ../'alias cd4 'cd ../ ../ ../ ../'alias cd3 'cd ../ ../ ../'alias ls 'ls --color=tty 'alias ll 'ls -la 'alias lt 'ls -lhrt 'alias lz 'ls -lhrS &# 阅读全文
posted @ 2012-12-17 18:45 iTech 阅读(3922) 评论(0) 推荐(0) 编辑
摘要: 如果在公司的环境,没有root权限,需要安装 tmux 在你自己的home下:(cd to your home)/remote/home1/AAA(wget libevent and tmux, and then uncompress them)Tar -xvzflibevent-2.0.20-stable.tar.gztar -xvzftmux-1.7.tar.gzcd libevent-2.0.20-stable./congiure --prefix=/remote/home1/AAA/tmux-1.7_Installmakemake installcd ../tmux-1.7setenv 阅读全文
posted @ 2012-12-17 18:38 iTech 阅读(4438) 评论(1) 推荐(1) 编辑
摘要: 来自:http://www.perlfect.com/articles/sorting.shtmlperl 比较操作符列表: NumbersStrings < lt > gt <= le >= ge ... 阅读全文
posted @ 2012-12-17 17:46 iTech 阅读(1510) 评论(0) 推荐(0) 编辑
摘要: 安装你自己的perl modules。当没有root权限的时候,需要安装perl modules到自己的home目录下。来自:http://servers.digitaldaze.com/extensions/perl/modules.htmlInstalling Perl5 Modules Loc... 阅读全文
posted @ 2012-12-17 17:35 iTech 阅读(1113) 评论(0) 推荐(0) 编辑
摘要: 如果目标目录下存在相同的子目录,则子目录下的文件不能拷贝成功。需要使用方法二假设dir1和dir2下都有子目录aaa,但是aaa下的文件不同。对目录的拷贝,如果目录下的子目录在目标目录下存在则不拷贝:cp -rf dir1 dircp -rf dir2 dir对文件的拷贝,如果子目录在目标目录下存在,但是子目录下的文件不存在,继续拷贝子目录下的文件cp -rf dir1/* dir/cp -rf dir2/* dir/ 阅读全文
posted @ 2012-11-24 00:48 iTech 阅读(600) 评论(0) 推荐(0) 编辑
摘要: http://www.garybeene.com/vb/tut-per2.htm完! 阅读全文
posted @ 2012-11-01 14:50 iTech 阅读(870) 评论(0) 推荐(0) 编辑
摘要: sql cheat sheet : link1 link2http://www.tutorialspoint.com/sql/index.htmhttp://www.sql-tutorial.net/ 阅读全文
posted @ 2012-11-01 12:46 iTech 阅读(914) 评论(0) 推荐(0) 编辑
摘要: 转自:http://www.thegeekstuff.com/2012/09/sqlite-command-examples/SQLite3 is very lightweight SQL database which focuses on simplicity more than anything else. This is a self-contained serverless database engine, which is very simple to install and use.While most of the commands in the SQLite are simil 阅读全文
posted @ 2012-10-31 18:06 iTech 阅读(14526) 评论(0) 推荐(1) 编辑
摘要: 代码: #!/usr/local/bin/perluseCGI':standard';printheader;printstart_html("ExampleCGI.pmForm");print"<h1>ExampleCGI.pmForm</h1>\n";print_prompt();do_work();print_tail();printend_html;subprint_prompt{printstart_form;print"<em>What'syourname?</em& 阅读全文
posted @ 2012-10-31 15:03 iTech 阅读(550) 评论(0) 推荐(0) 编辑
摘要: 1)文件读取的3中方法按行读,存入标量while (<FILE>) { print; }按行读,存入数组@array = <FILE>;读入整个文件 ,存入标量$string = do { local $/; <FILE>; };2)读文件实例open (EP,"/etc/passwd");while (<EP>) {chomp;print "I saw $_ in the password file!\n";}3)读写文件实例open(IN,$a) || die "cannot open $a 阅读全文
posted @ 2012-10-26 11:31 iTech 阅读(2961) 评论(0) 推荐(0) 编辑
摘要: 一 静态label静态label使用labelsync或tag来生成,实际上包含了具体的文件和版本信息。 文件必须同时包含在clientspec和label的view中,clientspec和label的view可以不相同。1)server上两个depots(depot和depot2),且本地sync到最新的changelist@2C:\>p4 -p localhost:1666 -u aaa -c aaa_test depotsDepot depot 2012/10/20 local depot/... 'Default depot'Depot depot2 2012/ 阅读全文
posted @ 2012-10-20 11:54 iTech 阅读(2314) 评论(0) 推荐(0) 编辑
摘要: 1)grep命令加- E参数,这一扩展允许使用扩展模式匹配。例如,要抽取城市代码为2 1 9或2 1 6,方法如下:[sam@chenwy sam]$ grep -E '219|216' data.f219 dec 2CC1999 CAD 23.00 PLV2C 68216 sept 3ZL1998 USP 86.00 KVM9E 2342)grep -v 用来查找不包含指定值的字符串3)当grep要查找的关键字中有特殊字符或正则表达式时,需要对关键字使用' '4) grep -i 用来不区分大小写的查找完! 阅读全文
posted @ 2012-10-18 18:27 iTech 阅读(1524) 评论(0) 推荐(0) 编辑
摘要: 使用正则表达式分两步走:先去掉前面的: $a=~s/^ +//;在去掉后面的: $a=~s/ +$//;一步就可以:s/(^s+|s+$)//g;删除字符串末尾的换行:chomp函数通常会删除变量里包含的字符串尾部的换行符。它是chop函数的一个略微安全些的版本,因为它对没有换行符的字符串没有影响。更准确地说,它根据了解$/的当前值删除字符串终止符,而不只是最后一个字符。和chop不同,chomp返回删除的字符数量。完! 阅读全文
posted @ 2012-10-07 22:45 iTech 阅读(17324) 评论(0) 推荐(0) 编辑
摘要: 一 CGI.pm中的方法(routines)调用1. CGI.pm实现了两种使用方法,分别是面向对象的方式和传统的perlmodule方法的方式。面向对象的方式: #!/usr/local/bin/perl -w use CGI; # load CGI routines $q = CGI->new; # create new CGI object print $q->header, # create the HTTP header $q->start_html('hello world'), # start t... 阅读全文
posted @ 2012-10-07 20:57 iTech 阅读(4327) 评论(0) 推荐(0) 编辑
摘要: 来自:http://www.cnblogs.com/FlyCat/archive/2012/06/27/2566325.html代码:HTMLheader结构<html><head><!--base标签为页面上的所有链接规定默认地址或默认目标。通常情况下,浏览器会从当前文档的URL中提取相应的元素来构造新的相对URL。使用<base>标签可以改变这一点。浏览器随后将不再使用当前文档的URL,而使用<base>指定的基本URL来作为相对URL。这其中包括<a>、<img>、<link>、<form&g 阅读全文
posted @ 2012-10-07 09:36 iTech 阅读(7882) 评论(0) 推荐(1) 编辑
摘要: 参考:http://www.willmaster.com/library/manage-forms/using_perl_to_submit_a_form.phphttp://www.oschina.net/code/snippet_12_854有时需要在perl中非交互地调用已有的cgi来完成一定的功能,此时需要模拟一个http请求来调用cgi。get方式调用: 1useHTTP::Request::Common;2useLWP::UserAgent;3$user_agent=LWP::UserAgent->new;4$request=GET'http://clearcase/ 阅读全文
posted @ 2012-09-23 12:49 iTech 阅读(720) 评论(0) 推荐(0) 编辑
摘要: 参考:http://docstore.mik.ua/orelly/linux/cgi/ch15_03.htmhttp://stackoverflow.com/questions/2224158/how-can-i-send-post-and-get-data-to-a-perl-cgi-script-via-the-command-linehttp://search.cpan.org/~lds/CGI.pm-3.20/CGI.pm#DEBUGGING一 一般地我们可以使用以下方法来检查cgi脚本的错误:1)使用-cwT来检查cgi脚本的语法,警告。例如perl -wcT your.cgi.2) 阅读全文
posted @ 2012-09-23 12:23 iTech 阅读(2913) 评论(0) 推荐(0) 编辑
摘要: 通常我们开发web时候,使用ie的developertoolgs,或chrome的developertools或firefox的firebug来帮助调试。但是如果只是临时的很少量的代码的测试,可以使用在线的web调试工具。 试了下http://jsfiddle.net/和http://tinkerbin.com还不错,支持html,css,javascript的调试。例如我测试validateform的js函数http://jsfiddle.net/中:http://tinkerbin.com中:来自:http://www.ruanyifeng.com/blog/2012/02/6_onlin 阅读全文
posted @ 2012-09-23 10:45 iTech 阅读(729) 评论(0) 推荐(0) 编辑
摘要: 一 此cgi既是提交前的form,也被用来处理form的提交来自:http://www.devdaily.com/perl/perl-cgi-example-scrolling-list-html-form代码: (多选listbox-Multiple-choice SELECTs实例)不带参数时即为form:http://xxxx/cgi/perl-cgi2.cgi当点击form的submit提交时,实际上相当于:http://xxxx/cgi/perl-cgi2.cgi?languages=c&languages=html,此时为对form的处理结果#!/usr/bin/perl- 阅读全文
posted @ 2012-09-23 00:08 iTech 阅读(1715) 评论(0) 推荐(0) 编辑
摘要: 代码:http://xxxxx/cgi/perl-cgi.cgi?name=itech&url=itech.cnblogs.com&p1=test1#!/usr/bin/perl-wT#shouldusestrictandwarnningusewarnings;usestrict;useCGI;#todebugerroruseCGI::Carpqw(warningsToBrowserfatalsToBrowser);#ordebugfromcommandlineby:perl-cwTyourcgi.cgi#ordebugby:tail/var/log/apache/error_ 阅读全文
posted @ 2012-09-22 23:11 iTech 阅读(638) 评论(0) 推荐(0) 编辑
摘要: 通过flag文件来检测与否在运行。可以加入相关关键字的进程的检测。代码:(简单的csh实例)running_check#!/bin/csh-fif($#argv<2)thenusage:echo"Usage:$0<running_flag><action><timeout>"echo"actionneedbeonevalueof-checkor-delete."echo"defaulttimeoutis0,itmeansnotimeoutlimitation."exit1endifsetrun 阅读全文
posted @ 2012-09-22 20:43 iTech 阅读(853) 评论(0) 推荐(0) 编辑
摘要: 代码:usestrict;usewarnings;my$test="asdf";print"${test}_test2\n";#constantuseconstant{AAA=>"aaa",BBB=>"bbb",MIN_TOTAL=>12,SCORE_PASS=>90,SCORE_RED=>70,};printAAA;printSCORE_PASS;#twodimesionarraysmy@steps=(["aaa","aaavalue"],[& 阅读全文
posted @ 2012-09-22 20:36 iTech 阅读(1723) 评论(0) 推荐(0) 编辑
摘要: 对任何的函数将标准输出和错误输出重定向到对应的log文件。对任何的函数记录函数运行的时间。代码:#!/usr/bin/perlusewarnings;usestrict;nostrict"refs";subtestLogToStd{print"Teststdout:\n";openLOG,">2.txt";selectLOG;print"justatest\n";#recoverSTDOUTselectSTDOUT;print"justatest2\n";closeLOG;}subtest 阅读全文
posted @ 2012-09-22 20:29 iTech 阅读(868) 评论(0) 推荐(0) 编辑
摘要: 转自:http://weidagang2046.blog.51cto.com/246444/45923/Perl作为一种脚本语言可以实时地生成和执行代码。这种特性可以把代码的编译推迟到运行时,所以又称为“动态代码”。另外,Perl也如Java、C++一样提供了异常处理机制。本文将初步探讨Perl中实现动态代码和异常处理机制的函数:eval。如有错误不足,欢迎讨论和批评指正。eval函数可以看作是Perl虚拟机,它的参数就是一段Perl代码。利用’perldoc –f eval’可以获取eval函数使用帮助,其中介绍了它的两种使用方式:leval EXPREXPR是一个的表达式,例如:eval& 阅读全文
posted @ 2012-09-22 19:54 iTech 阅读(2162) 评论(0) 推荐(0) 编辑
摘要: 功能列出.o .a .so中的符号信息,包括诸如符号的值,符号类型及符号名称等。所谓符号,通常指定义出的函数,全局变量等等。使用nm [option(s)] [file(s)]有用的options:-A 在每个符号信息的前面打印所在对象文件名称;-C 输出demangle过了的符号名称;-D 打印动态符号;-l 使用对象文件中的调试信息打印出所在源文件及行号;-n 按照地址/符号值来排序;-u 打印出那些未定义的符号;常见的符号类型:A 该符号的值在今后的链接中将不再改变;B 该符号放在BSS段中,通常是那些未初始化的全局变量;D 该符号放在普通的数据段中,通常是那些已经初始化的全局变量;T 阅读全文
posted @ 2012-09-16 13:14 iTech 阅读(61212) 评论(0) 推荐(2) 编辑
摘要: Linux运行与控制后台进程的方法:nohup, setsid, &, disown, screen转自http://heylinux.com/archives/1282.html#more-1282我们经常会碰到这样的问题,用ssh登录了远程的Linux服务器,运行了一些耗时较长的任务,结果却由于网络等的不稳定导致任务中途失败。这是由于在用户注销(logout)或者网络断开时,终端会收到 HUP(hangup)信号从而关闭其所有子进程。解决办法有两种:让进程忽略HUP信号,或让进程运行在新的会话里从而成为不属于此终端的子进程。下面是对Linux下运行与控制后台进程的各种方法的介绍:1 阅读全文
posted @ 2012-09-16 12:54 iTech 阅读(8109) 评论(0) 推荐(0) 编辑
摘要: linux上安装配置vsftpd转自:http://www.webarch.org/category/linux我的生产环境是Centos5.6,由于需要提供ftp服务,就找了一款比较小巧的ftp服务器端软件,vsftpd(vsftpd 的名字代表”very secure FTP daemon”, 安全是它的开发者 Chris Evans 考虑的首要问题之一。在这个 FTP 服务器设计开发的最开始的时候,高安全性就是一个目标。)1.查看是否安装vsftprpm -qa | grep vsftpd如果出现vsftpd-2.0.5-21.el5,说明已经安装 vsftp安装vsftpyum -y 阅读全文
posted @ 2012-09-16 12:29 iTech 阅读(79358) 评论(0) 推荐(1) 编辑
摘要: 参考: redhat linux下配置rsh和rcp: http://linux.chinaunix.net/techdoc/net/2008/06/30/1014112.shtml 1:安装前准备:机器A:192.168.0.104(machine_a) (安装rsh server)机器B:192.168.0.106(machine_b) (rsh client )2: 首先确认机器A是否安装rsh包:[root@mg04 root]# rpm -aq |grep rs... 阅读全文
posted @ 2012-09-09 23:18 iTech 阅读(22363) 评论(0) 推荐(0) 编辑
摘要: 1. 列出所有端口 (包括监听和未监听的) 列出所有端口 netstat -a# netstat -a | more Active Internet connections (servers and established) Proto Recv-Q Send-Q Local Address Foreign Address State tcp 0 0 localhost:30037 *:* LISTEN udp 0 0 *:bootpc ... 阅读全文
posted @ 2012-09-09 22:17 iTech 阅读(4322) 评论(0) 推荐(0) 编辑
摘要: 在当前目录和子目录下查找文件MyCProgram.c# find . -name "MyCProgram.c"查找文件且忽略大小写# find . -iname "MyCProgram.c"查找不包含MyCProgram.c的文件find . -maxdepth 1 -not -iname "MyCProgram.c"在/下3到5级子目录中查找passwd# find / -mindepth 3 -maxdepth 5 -name passwd查找且执行命令find . -iname "MyCProgram.c" 阅读全文
posted @ 2012-09-05 21:52 iTech 阅读(6740) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 8 9 10 ··· 24 下一页