2007年2月27日星期二

日志分析并排序

今天分析Apache的Log日志看到流量偏大,想找出大量访问的IP:

# tail shouye_COMBINE_20070227.log

222.136.203.248 - - [27/Feb/2007:15:59:03 +0800] "GET /e21/20020121/images/0119001.gif HTTP/1.1" 200 4258 "http://xjxw.e21.edu.cn/xjcx.php" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; Embedded Web Browser from: http://bsalsa.com/)"
222.136.203.248 - - [27/Feb/2007:15:59:03 +0800] "GET /e21/e21_index_menu.php HTTP/1.1" 200 1691 "http://xjxw.e21.edu.cn/xjcx.php" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; Embedded Web Browser from: http://bsalsa.com/)"
222.136.203.248 - - [27/Feb/2007:15:59:03 +0800] "GET /e21/20020121/images/0119002.gif HTTP/1.1" 200 1549 "http://xjxw.e21.edu.cn/xjcx.php" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; Embedded Web Browser from: http://bsalsa.com/)"

打开shouye_COMBINE_20070227.log/ 读取第一列/ 相同项出项次数/ 排序/ 更多
#cat shouye_COMBINE_20070227.log /awk '{print $1}' /awk '{a[$1]+=1}END{for(i in a)print i,a[i]}' /sort -k2 -n -r more
211.67.64.225 18754
210.42.140.5 3332
211.67.66.82 2098
202.108.37.223 999
211.67.64.163 870
210.42.140.28 745
58.19.198.66 602
122.204.39.253 512
211.67.66.90 508
......
瞬间找出访问量最大IP

阅读全文...

2007年2月9日星期五

Rokr E2上的第一个C语言程序

        今天终于下到xscale-gcc-vfp-3.3.tar.gz,可以在Redhat Linux上编译Intel xscale CPU的C程序了。这样我的小E2就可以运行我编的C语言程序了^_^
        下面是我手机终端上运行的我编的第一个C语言程序了,改版的Hello Moto!:

阅读全文...