摘要: http://tech.idv2.com/2006/12/12/screen-command-tips/ 阅读全文
posted @ 2009-10-12 10:45 men-chong 阅读(129) 评论(0) 推荐(0) 编辑
摘要: http://tech.idv2.com/2007/08/09/about-apache-perf-tuning/服务器资源,主要为: 1、CPU时间2、TCP连接数3、内存(现在由于价格低廉,基本不会发生内存不足的问题)1、shell> cat /proc/loadavg 可以查看负载情况,一般大于1就需要排队,大于2以上就会感到性能降低2、 shell> netstat -ant ... 阅读全文
posted @ 2009-10-12 10:42 men-chong 阅读(129) 评论(0) 推荐(0) 编辑
摘要: http://easwy.com/blog/archives/advanced-vim-skills-catalog/ 阅读全文
posted @ 2009-08-06 14:08 men-chong 阅读(334) 评论(0) 推荐(0) 编辑
摘要: 快速排序的实现原理。在start,end 之间,获取一个数作为参照,大于这个数的,放在右边,小于的放在左边。最后,返回排序好的新数组中,此参照数的位置。然后再递归的调用此方法,排序左边和右边的数组。直至 start = end;int partition(int start, int end){ int mid, i, temp; int nl, nr; temp = a[start]; nl... 阅读全文
posted @ 2009-08-05 11:53 men-chong 阅读(461) 评论(0) 推荐(0) 编辑
摘要: shell 中生成随机数,可以用 expr ,可以很方便的获取一定范围内的随机数。如下,可以获取 1-5的随机数choose=`expr $RANDOM % 5`choose=`expr ${choose} + 1` 阅读全文
posted @ 2009-08-04 10:48 men-chong 阅读(699) 评论(0) 推荐(0) 编辑
摘要: shift + ^: 移动至第行首一个非空字符shift + $: 移动至该行最后一个0:移动至行首 阅读全文
posted @ 2009-07-29 15:36 men-chong 阅读(157) 评论(0) 推荐(0) 编辑
摘要: #!/bin/shtestArr[1]="echo 1"choose=`expr $RANDOM % 5`choose=`expr ${choose} + 1`#then do the test by the random choose${testArr[${choose}]};~ ~ 阅读全文
posted @ 2009-07-27 16:48 men-chong 阅读(161) 评论(0) 推荐(0) 编辑
摘要: -----------------日志格式:[2009/07/21 17:31:09:000000][]-xxxxxxxx-------------------cat *.log | sort -m -t " " -k 2 -o test.log注释: -t " ": 日志字段分割符号是空格 -k 2: 按第2个字段排序,也就是:17:31:09:000000] 这个字段 -o log_all:... 阅读全文
posted @ 2009-07-21 17:37 men-chong 阅读(674) 评论(0) 推荐(0) 编辑
摘要: # ulimit -a发现,OPEN FILES不能超过1024。消除此限制如下:# vi /etc/security/limits.confadd bellow:soft nofile 8192 # 打开文件的软限制hard nofile 20480 # 硬限制重启就可以了,此方法在 RHEL5下试验成功。 阅读全文
posted @ 2009-07-18 12:46 men-chong 阅读(563) 评论(0) 推荐(0) 编辑
摘要: 原文地址:http://www.ibm.com/developerworks/cn/linux/l-cn-screen/以下胡乱记载了一些原文中的东西,具体请查看原文。让我们来看看为什么关掉窗口/断开连接会使得正在运行的程序死掉。 你是不是经常需要 SSH 或者 telent 远程登录到 Linux 服务器?你是不是经常为一些长时间运行的任务而头疼,比如系统备份、ftp 传输等等。通常情况下我们都... 阅读全文
posted @ 2009-07-17 16:29 men-chong 阅读(186) 评论(0) 推荐(0) 编辑