
zj-脚本
7
优惠券已抵扣
余额抵扣
还需支付
¥39.90
¥99.00
购买须知?
本专栏为图文内容,最终完结不会低于15篇文章。
订阅专栏,享有专栏所有文章阅读权限。
本专栏为虚拟商品,基于网络商品和虚拟商品的性质和特征,专栏一经购买无正当理由不予退款,不支持升级,敬请谅解。
scan724
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
perl 分析binlog 生成update sql
if [ $# -ne 2 ]then echo "请输入update xx"elseperl ./get_num.pl $1 $2 if [ $? -eq 0 ] then sh ./sed.sh fifiopen (A,"<","a.txt");open (B,">","b.txt");$a=$ARGV[0];$b=$ARGV[1]; while (原创 2015-11-12 16:50:52 · 509 阅读 · 0 评论 -
nfs目录权限
jrhnpt01:/root# ls -ltr / | grep nfs01drwxr-xr-x 6 root root 4096 Oct 27 13:24 nfs01[root@nfs01 ~]# ls -ltr / | grep nfs01drwxr-xr-x 6 root root 4096 May 13 2015 nfjrhnpt01原创 2015-11-27 19:11:19 · 1072 阅读 · 0 评论 -
mysql binlog 分析
598224: daysOfYear=360,737706: daysOfYear=360,760428: daysOfYear,803628: daysOfYear=360,829346: daysOfYear=360,830128: daysOfYear=360,830559: daysOfYear=360,831028: daysOfYear=原创 2015-12-16 13:16:42 · 489 阅读 · 0 评论 -
perl vim美化
格式优美的perl代码不但让人赏心悦目,而且可以方便阅读.perltidy的是sourceforge的一个小项目,在我们写完乱七八糟的代码后,他能像变魔术一样把代码整理得漂漂亮亮,快来体验一下吧!!!下载地址:http://jaist.dl.sourceforge.net/sourceforge/perltidy/Perl-Tidy-20071205.tar.gz安装方法:进入解压原创 2015-11-30 19:16:09 · 546 阅读 · 0 评论 -
Perl 计算平均值
zjzc01:/root/big# cat grades A 70B 80C 90D 50E 60F 80zjzc01:/root/big# cat a6.pl open(GRADES, "grades") or die "Can't open grades: $!\n"; while ($line = ) { ($student, $grade) = split(" ", $原创 2015-12-17 10:14:48 · 3800 阅读 · 0 评论 -
perl 文本内容转hash数组
zjzc01:/root/big# cat grades A 70B 80C 90D 50E 60F 80zjzc01:/root/big# cat a7.pl open(GRADES, "grades") or die "Can't open grades: $!\n"; while ($line = ) { ($student, $grade) = split(" ", $原创 2015-12-17 10:18:48 · 1758 阅读 · 0 评论 -
perl 数组元素为空和数组元素为undef 是两码事
[root@dr-mysql01 ~]# cat x.pl @arr=($tmp1[-1], $tmp2[-1],2);if (@arr){print "111111\n"};print "\$arr[0] is $arr[0]\n";print "\$arr[1] is $arr[1]\n";[root@dr-mysql01 ~]# perl x.pl 111111$arr[0]原创 2015-12-04 12:55:46 · 2957 阅读 · 0 评论 -
利用微信机器人,自动发送验证码
use Weixin::Client; use Encode; #目前只能用于群回复 my $client = Weixin::Client->new(debug=>0); #加载ShowMsg插件,用于打印消息 $client->load("ShowMsg"); #客户端登录 $client->login(); #设置客户端接收消息原创 2015-12-03 23:23:53 · 6584 阅读 · 1 评论 -
perl 监控网站域名劫持
use Net::Ping;use Socket;use LWP::Simple qw(get); use HTTP::Date qw(time2iso str2time time2iso time2isoz);use Net::Ping; use Socket;use Net::SMTP;sub send_mail{if (@_ != 2){print "请输入2个参数\n"原创 2015-12-09 10:57:39 · 660 阅读 · 0 评论 -
perl 正则分组 或
jrhmpt01:/tmp# cat sum.pl open (LOG ,"<","tmp.out"); while () { chomp; ##10.171.246.184 - - [05/Feb/2016:20:32:50 +0800] "POST /web/sendregistersmscode HT原创 2016-02-06 08:18:26 · 933 阅读 · 0 评论 -
perl 从指定行插入字符
zjzc01:/root/big2# cat a27.pl $curip="$ARGV[0]";$str='export CATALINA_OPTS="$CATALINA_OPTS -Djava.rmi.server.hostname=$curip -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=10053原创 2015-12-29 11:01:30 · 2365 阅读 · 0 评论 -
perl 监控日志告警
my $dir = '/usr/local/apache-tomcat-7.0.55_8082/logs';my $SDATE = strftime("%Y-%m-%d",localtime());my $file = "localhost.$SDATE.log";$mon_file = "$dir/$file";##########监控关键字,以空格隔开################原创 2015-11-26 17:14:41 · 914 阅读 · 0 评论 -
perl 没有关键文件句柄引起的逻辑错误
flow02:/home/tomcat> cat m1.pl #!/usr/bin/perl use POSIX;my $dir = '/home/tomcat';my $file = '1.log';$mon_file = "$dir/$file";my $SDATE = strftime("%Y%m%d%H%M%S",localtime());$UPLOADPATH = "/d原创 2015-11-01 14:29:17 · 552 阅读 · 0 评论 -
perl 比较目录
$dirname = "C:\\a1";opendir ( DIR, $dirname ) || die "Error in opening dir $dirname\n";while( ($filename = readdir(DIR))){ push @arr1,$filename."\n";}closedir(DIR);sort @arr1;print @a原创 2015-11-14 19:37:49 · 425 阅读 · 0 评论 -
数组求差集
oadb01:/home/oracle> cat a1.pl my @a=qw(1 2 3 4 5 aa bb );my @b=qw(1 2 );@b = grep {$count{$_} == 1 } grep {++$count{$_}} (@a, @b);print "@b\n"oadb01:/home/oracle> perl a.1Can't open perl script原创 2015-11-14 23:03:24 · 425 阅读 · 0 评论 -
svn数据库自动发布程序
use Net::SMTP; use HTTP::Date qw(time2iso str2time time2iso time2isoz); my $CurrTime = time2iso(time()); my $dis_mainpublish='中均资本';my $menu= <<EOF; DATE:$CurrTime --------原创 2015-11-14 22:02:55 · 188 阅读 · 0 评论 -
shell 执行expect
#!/bin/bashpasswd='1234567'/usr/bin/expect<<EOFset time 30spawn ssh root@192.168.32.65expect {"*yes/no" { send "yes\r"; exp_continue }"*password:" { send "$passwd\r" }}expect "*#"send "who\原创 2015-10-30 11:29:16 · 975 阅读 · 0 评论 -
linux 批量ssh认证
redis01:/root# cd .ssh-bash: cd: .ssh: No such file or directoryredis01:/root# pwd/rootredis01:/root# cd .sshredis01:/root/.ssh# lsknown_hostsredis01:/root/.ssh# lsid_rsa id_rsa.pub known原创 2015-10-30 16:20:55 · 969 阅读 · 0 评论 -
svn 备份和恢复
一个较大的Subsersion版本库想用最少的空间来将它备份下来,用这个命令(请将/repo替换成你的版本库路径)svnadmin dump --deltas /repos |bzip2 |tee dump.bz2 | md5sum >dump.md5最重要的一步是 -deltas,将消耗更多的CPU资源,但拥有更有效的差异存储办法。bzip2压缩方案比gzip慢,但换来的更好的压缩率。更原创 2015-11-23 15:21:37 · 331 阅读 · 0 评论 -
perl hash 累加
flow02:/home/tomcat> cat tmp.out 1.1.1.1flow02:/home/tomcat> flow02:/home/tomcat> flow02:/home/tomcat> cat a2.pl open (LOG ,"<","tmp.out"); while () {原创 2015-10-31 21:06:45 · 1799 阅读 · 0 评论 -
域名访问和IP访问问题
通过ip访问,可以看到无法访问接口,接口是通过域名zjcap.cn请求原创 2015-11-02 11:03:41 · 1060 阅读 · 0 评论 -
合同比对
for((i=15;i<=174;i++));doif [ -d "$i" ]thencd $iecho 当前产品sn==$ils -ltr *pdf | grep -v tmp | wc -lcd ..fidonemysql -uroot -p'xxxxxx' -e "select * from (select productSn from zjzc.ClientInve原创 2016-03-02 09:56:21 · 2604 阅读 · 0 评论 -
判断变量定义和变量为空问题
变量定义和变量为空问题:jrhmpt01:/root# cat x1.pl my $xx="";if (defined($xx)){print "111111111\n"};jrhmpt01:/root# perl x1.pl 111111111defined 只要变量定义 不管是空 是真是假 就成立jrhmpt01:/root# cat x1.pl my $xx="";i原创 2016-02-27 22:57:16 · 1324 阅读 · 0 评论 -
aliyun 安装图形
yum安装图形界面:1) yum groupinstall "X Window System"yum install xclockyum groupinstall -y "Desktop"启动图形界面:原创 2016-02-29 11:00:25 · 395 阅读 · 0 评论 -
perl 自动发产品
use Net::SMTP;use LWP::UserAgent;use HTTP::Cookies;use HTTP::Headers;use HTTP::Response;use Encode;use Switch;use File::Temp qw/tempfile/;use HTTP::Date qw(time2iso str2time time2iso time2isoz原创 2016-07-27 12:41:57 · 417 阅读 · 0 评论 -
SLB 权重问题
一般配置SLB的时候有个权重0到100,是如何选择数值的? 权重需要您根据后端机器的配置进行选择比如AB两台机器性能一致就分别设置50,这样请求就会在这两台机器上轮询,不同权重决定请求分发的分配。slb中权重是什么概念, 值越大是不是分担越多? 权重比越高的ECS将被分配到更多的访问请求原创 2016-06-22 15:56:46 · 2540 阅读 · 0 评论 -
perl 获取文件内容里第一个AAA和最后一个AAA
[root@wx03 ~]# cat q1.pl my @arr=();open (LOG ,"<","aaa"); while () { if ($_ =~/AAA/){$num=$.; push (@arr, $num)};};print $arr[0]."\n";print $arr[-1]."\n";[root@wx03 ~]# vim aaa原创 2016-07-08 12:46:39 · 538 阅读 · 0 评论 -
JENKINS 打包发布脚本
#!/bin/bash#nohup bash check_new_pkgs_dev.sh &#steps below:##发布的机器上运行这个脚本#定时遍历发布包存放路径#1.遍历所有要发布的包#2.对于每一个包,找到这个包的时候,停止相应的服务#3.将deployed下面相应的已发布目录归档到history中#4.将压缩包解压到deployed下面相应的项目目录中#5.将原创 2016-07-08 16:15:16 · 3434 阅读 · 1 评论 -
闭包的潜在用处
一个潜在的有用的是使用闭包来产生动态的子函数 基于一个模板,使用一个相对简单的例子:[root@wx03 0729]# cat a1.pl sub multiply_by { my $multiplier = $_[0]; return sub { return $_[0] * $multiplier; }}my $times2 = multiply_by(2);原创 2016-07-29 22:16:45 · 392 阅读 · 0 评论 -
perl 切换cpan
(echo o conf urllist unshift http://mirrors.163.com/cpan/ http://mirrors.sohu.com/CPAN/ http://www.perl.com/CPAN/; echo o conf commit) | perl -MCPAN -e shell原创 2015-08-20 16:18:46 · 2084 阅读 · 0 评论 -
perl 跨行匹配;
perl 跨行匹配;6.6. Matching Within Multiple Lines6.6.1. ProblemYou want to use regular expressions on a string containing more than one logical line, but the special characters . (any character but ne原创 2016-08-11 16:15:07 · 1985 阅读 · 0 评论 -
windows 守护进程
use Win32::Process::Info;while (1==1){use Sys::Hostname;use HTTP::Date qw(time2iso str2time time2iso time2isoz); use Net::SMTP; if ( $#ARGV < 1 ){ print "please input 程序目录 程序名!\n原创 2016-09-14 12:00:53 · 710 阅读 · 0 评论 -
perl unicode 字符转换
perl unicode 字符转换[root@dr-mysql01 ~]# cat hg.pl use Encode;use Encode::CN;use JSON; use URI::Escape;use LWP::Simple;open (LOG ,"<","hg.txt");while (){$content=$_;$content =~ s/\\u([0-9a-fA-原创 2015-12-03 15:21:31 · 1022 阅读 · 0 评论 -
perl 处理文本
redis01:/root# cat abcGET /api/sale/get_voucher_list?loupan_id=32300&suid=kJIjl&loupan_site=sc&code=d30d52a87c0ba4e342c9315d44845be5&source=pc HTTP/1.1GET /api/sale/get_voucher_list?loupan_id=108578原创 2016-07-15 16:33:29 · 1242 阅读 · 0 评论 -
perl .*?和.*
redis01:/root# cat x2.pl my $str="212121a19823a456123";if ($str =~/.*a(.*)23/){print "1----".$1."\n";};if ($str =~/.*?a(.*)23/){print "2----".$1."\n";};redis01:/root# perl x2.pl 1----45612----19原创 2016-07-04 13:42:04 · 1935 阅读 · 0 评论 -
perl 贪婪匹配小例子
redis01:/root# cat x2.pl my $str="a19823a456123";if ($str =~/a(.*)23/){print "1----".$1."\n";};if ($str =~/a(.*?)23/){print "2----".$1."\n";};redis01:/root# perl x2.pl 1----19823a45612----198原创 2016-07-04 13:34:29 · 1748 阅读 · 0 评论 -
expect set timeout -1 永不超时
. ~/.bash_profilepasswd='xxx'expect <<!set timeout -1spawn rsync -avH /webapps/Seeyon/A8/base/upload/ root@120.26.93.217:/webapps/Seeyon/A8/base/upload/expect { "(yes/no)?" { send "原创 2016-02-29 13:36:44 · 9497 阅读 · 0 评论 -
perl encode_utf8 和decode_utf8
encode_utf8等于 $octets = encode_utf8($string); 这个字符串 在$string 在Perl的内部格式,返回结果是作为一个顺序的字节。因为所有的可能的字符串在Perl是松散,不严格的 UTF-8表示decode_utf8 解码utf-8原创 2016-04-25 13:08:46 · 1041 阅读 · 0 评论 -
api 跳转规则
api 配置:haproxy 跳转: acl api_req path_beg -i /api use_backend appserver_8082 if api_reqj原创 2016-05-12 18:19:57 · 1077 阅读 · 0 评论 -
Net::SSH::Perl 模块
Net::SSH::Perl - Perl client Interface to SSH Perl SSH的客户端接口 use Net::SSH::Perl; my $ssh = Net::SSH::Perl->new($host); $ssh->login($user, $pass); my($stdout, $stderr, $exit) = $ssh->原创 2016-05-04 13:39:51 · 2188 阅读 · 0 评论