摘要: nginx:一个master 多个workerresin:自动检测 ok.html是否存在,不存在就重启: 此重启是 原resin进程不会重启,重启的是nginx产生的线程ps -eLfroot 27231 1689 27590 0 74 18:57 ? 00:00:00 /data/web/jdk/bin/java -Dfile.encoding=UTF-8 -server -Xms8000M -Xmx8000M -Xmn5000M -Xss256K -XX:ThreadStackSize=256 -XX:StackShadowPages=8 -verbosegc -XX:+P... 阅读全文
posted @ 2013-01-17 19:07 Arya_yu 阅读(212) 评论(0) 推荐(0) 编辑
摘要: #!/usr/bin/perl -wuse strict;use YAML::XS;my %hash;my %new;@hash{'a' .. 'm'} = 1 .. 13;@new{ 'n' .. 'z' } = 14 .. 26;print "Before change\n";map{ print "$_ => $hash{$_}\n"} sort keys %hash;@hash{ keys %new } = values %new;print "After chang 阅读全文
posted @ 2013-01-17 09:59 Arya_yu 阅读(366) 评论(0) 推荐(0) 编辑
摘要: http 以及 https1.firefox浏览器2.利用HttpFox插件,抓取登录包3.分析包中的 header、post都有哪些内容4.利用perl 的 LWP::Usergent、HTTP::Cookies等开源包,模拟登录5.对于Https的网页,需要将cookies里面相关的内容放入post,所以还要分析cookies。 阅读全文
posted @ 2013-01-08 09:54 Arya_yu 阅读(335) 评论(0) 推荐(0) 编辑
摘要: #!/usr/bin/perl -wuse strict;my %hash = ( a => 3, b => 1, c => 4);map{ print "$_ => $hash{$_}\n"} sort{ $hash{$b} <=> $hash{$a} } keys %hash; 阅读全文
posted @ 2013-01-01 21:21 Arya_yu 阅读(230) 评论(0) 推荐(0) 编辑
摘要: 时间:O(nlog2n)空间:O(1)不稳定稍复杂#include <stdio.h>#define swap(x,y) { int tmp; tmp = x; x = y; y = tmp;}void print_array(int *a, int n);void shell_sort(int *a, int n){ int d = n/2; int i, j; while(d > 0) { for(i = d; i < n; i++) { j = i - d; while( j >= 0 && ... 阅读全文
posted @ 2012-12-19 17:05 Arya_yu 阅读(96) 评论(0) 推荐(0) 编辑
摘要: 动画:http://www.tyut.edu.cn/kecheng1/site01/suanfayanshi/quick_sort.asp#include <stdio.h>#define swap(x,y) { int tmp; tmp = x; x = y; y = tmp;}void quick_sort(int *a, int start, int end) //sort a[start] to a[end]{ if(start < end) { int i = start, j = end; int tmp = a[start]; ... 阅读全文
posted @ 2012-12-19 17:03 Arya_yu 阅读(131) 评论(0) 推荐(0) 编辑
摘要: 直接插入排序:时间复杂度: O(n2)空间复杂度: O(1)稳定&简单#include <stdio.h>#define swap(x,y) { int tmp; tmp = x; x = y; y = tmp;}void print_array(int *array, int num){ int i; for(i = 0; i < num; i++) { printf("%d ", array[i]); } printf ("\n");}void direct_sort(int *array, int num){ int i, 阅读全文
posted @ 2012-12-19 17:01 Arya_yu 阅读(113) 评论(0) 推荐(0) 编辑
摘要: 永久修改:vim /etc/sysctl.conf增加修改的语句, e.x.vm.swappiness=10最后再执行sysctl -p临时修改,两种方法:(1)sysctl -w vm.swappiness=10(2)echo 10 > /proc/sys/vm/swappiness[1) echo 1 > /proc/sys/net/ipv4/ip_forward2) sysctl -w net.ipv4.ip_forward=1以上两种方法都可能即时开启路由功能,但如果系统重启,或执行了service network restart]sysctl格式:sysctl [-n] 阅读全文
posted @ 2012-12-19 10:41 Arya_yu 阅读(617) 评论(0) 推荐(0) 编辑
摘要: tcpdump过滤出TCP各个类型的包:1.第一种方法 tcpdump 'tcp[tcpflags] tcp-syn != 0' #过滤出SYN包 tcpdump 'tcp[tcpflags] (tcp-syn | tcp-fin | tcp-ack) != 0' #抓出 SYN和FIN 以及ACK包2.第二种方法 tcpdump -w tcp and 'tcp[13]&1 != 0' #1--fin, 2 --syn, 4 --rst....(看TCP的包头) 阅读全文
posted @ 2012-12-19 09:40 Arya_yu 阅读(220) 评论(0) 推荐(0) 编辑
摘要: 网上找了n多资料,感觉还是HTML::TreeBuilder最好用了,研究了半天HTML::TableExtract也没研究明白。my $root = HTML::TreeBuilder->new;binmode HM, "utf8"; #中文乱码解决$root->parse_file(\*HM);my $body = $root->find_by_tag_name('body'); #找到body节点my $table = $body->find_by_attribute('class','bglbk1 阅读全文
posted @ 2012-12-16 22:03 Arya_yu 阅读(503) 评论(0) 推荐(0) 编辑