星期五, 1月 15, 2010

[Linux] vim 怎麼用?!

http://blog.vgod.tw/2009/12/08/vim-cheat-sheet-for-programmers/

這位部落客,把Vim常用的部份給圖形化了,這真是太屌了~~~^^
vim的指令(command)不會,上鳥哥太慢~~~^^
有PDF可以下載嚕~~~^^

星期三, 1月 13, 2010

[Linux] About "kernel: TCP: time wait bucket table overflow"

tcp_max_tw_buckets

Maximal number of timewait sockets held by system simultaneously. If this number is exceeded TIME_WAIT socket is immediately destroyed and warning is printed. This limit exists only to prevent simple DoS attacks, you must not lower the limit artificially, but rather increase it (probably, after increasing installed memory), if network conditions require more than default value (180000).

所以當你設小的時候呢,/var/log/messages就會出現一堆"kernel: TCP: time wait bucket table overflow",所以default值千萬別亂改,如果你的程式會有狠大的traffic

怎麼改回來呢?
在/etc/sysctl.conf加這行
net.ipv4.tcp_max_tw_buckets = 180000

還要
echo 180000 > /proc/sys/net/ipv4/tcp_max_tw_buckets