發表文章

目前顯示的是 9月, 2011的文章

netstat

Options: -l Display listening server sockets -a Display all sockets (default: connected) -e Display other/more information -n Don't resolve names -t Tcp sockets -u Udp sockets -w Raw sockets -x Unix sockets -r Display routing table -W Display with no column truncation -p Display PID/Program name for sockets netstat -na 顯示主機上所有已建立的連線。 netstat -an | grep :80 | sort 顯示所有 port 80 的連線,並把結果排序。 netstat -n -p|grep SYN_REC | wc -l 列出主機上有多少個 SYNC_REC,一般上這個數字應該相當低。 netstat -n -p | grep SYN_REC | sort -u 同樣是列出 SYNC_REC,但不只列出數字,而是將每個 SYNC_REC 的連線列出。 netstat -n -p | grep SYN_REC | awk '{print $5}' | awk -F: '{print $1}' 列出發送 SYNC_REC 的所有 ip 地址。 netstat -ntu | awk '{print $5}' | cut -d: -f1 | sort | uniq -c | sort -n 計算每一個 ip 在主機上建立的連線數量。 netstat -anp |grep 'tcp\|udp' | awk '{print $5}' | cut -d: -f1 | sort | uniq -c | sort -n 列出從 TCP 或 UDP 連線到主機的 ip 的數量。 netstat -ntu | grep ESTAB | awk '

mixed implicit and normal rules

今天要重編 kernel 時, make menuconfig 突然出現了  " mixed implicit and normal rules " 這個訊息? 奇怪的是,明明沒有動到 code , 怎麼會這樣??? 上網查了一下, Fedora 14 之後,好像就有這樣的問題!!!@@@@ 剛好前幾天從 13 --> 15, 這說明了!!!沒事不要亂更新。 這是 make 的版本問題!不清楚為何要這樣限制? 將此行           config %config: scripts_basic outputmakefile FORCE 改成          %config: scripts_basic outputmakefile FORCE 就可以了。

備份 MBR, 還原 MBR, 刪除 MBR

備份硬碟MBR # dd if=/dev/sda of=/mbr.bak bs=512 count=1 還原硬碟MBR # dd if=/mbr.bak of=/dev/sda bs=512 count=1 刪除硬碟MBR # dd if=/dev/zero of=/dev/sda bs=512 count=1