Feed on Posts or Comments

Category ArchiveLinux 相關



Linux 相關 Aaron on 01 七月 2010

/usr/bin/ld: errno: TLS definition in /lib64/libc.so.6 section

在安裝 Qmail 的過程中,如果發現以下的錯誤解決方式

/usr/bin/ld: errno: TLS definition in /lib64/libc.so.6 section .tbss mismatches non-TLS reference in envdir.o
/lib64/libc.so.6: could not read symbols: Bad value
collect2: ld returned 1 exit status
make: *** [envdir] Error 1

編輯 conf-cc
在 gcc -O2 最後面加上 -include /usr/include/errno.h

再重新 make setup check

搞定~

Linux 相關 Aaron on 06 八月 2009

Gentoo PHP/pcre problem – internal pcre_fullinfo() error -3

USE="json ssl -pcre" EXTRA_ECONF="–with-pcre-regex" emerge php

Linux 相關 Aaron on 30 六月 2009

apache log IP count & sort

話說,常常在分析 apache log 時最常用的就是 IP 排序+統計,如果三不五時都要把 webalizer 叫出來跑,實在是有點辛苦,所以我們家 J神 就提供了一個簡易的語法,非常精準好用。

cat access.log |awk ‘{print $1}’|sort|uniq -c|sort -rn|head -n 10

這樣子會排出前十名 hit 最高的 IP,結果就會像

2416 123.156.xx.212
601 122.122.xx.101
583 114.38.xx.214
565 218.168.xx.140
526 114.43.xx.250
525 114.41.xx.40
476 218.168.xx.72
449 115.43.xx.154
424 114.42.xx.172
389 218.169.xx.162

至於其他更進階的用法就靠大家自已變化囉 ~

20090706 再補一個 netstat 的

netstat -nat| sed -e ‘s/:/ /g’ |awk ‘{print $6}’|sort|uniq -c|sort -rn|head -n 10

後一頁 »