在分析 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
2011年4月14日 星期四
2011年4月2日 星期六
掛載 wubi 做的 disk
sudo mount -o loop /dev/sda8/root.disk /mnt/123/
因为以前的系统出现了问题,在原来的root.disk里有些重要文件,想拷出来,可是现在挂载不上。
我把root.disk文件放到了F 盘,linux下的编号是sda8
我用命令:sudo mount /dev/sda8/root.disk /mnt /123/ -o loop
挂载失败,提示:/dev/sda8/root.disk 不是目录!
因为以前的系统出现了问题,在原来的root.disk里有些重要文件,想拷出来,可是现在挂载不上。
我把root.disk文件放到了F 盘,linux下的编号是sda8
我用命令:sudo mount /dev/sda8/root.disk /mnt /123/ -o loop
挂载失败,提示:/dev/sda8/root.disk 不是目录!
2011年2月16日 星期三
[盜貼]清理 Debian/Ubuntu 儲存空間
http://people.debian.org.tw/~chihchun/2011/02/11/cleanup-your-debian-ubuntu-disk-with-bleachbit/
du --max-depth=1 -x |sort -n
# apt-get autoclean
# apt-get clean
apt-tools dependency
deborphan -a -n |sort -n
bleachbit (ccleaner for Linux)
雖然新的 Linux 軟體,已經逐漸使用 .local .cache, .config 等目錄設定方式,但是還是有許多軟體會把快取存在 .config 或自己的目錄中,像是 .gnome2, .firefox 等。結果是使用者很難找到快取檔案,若使用 UbuntuOne, Dropbox 等等雲端備份工具,常常連不重要的快取都一起備份了,費時費錢。
上述或指令或工具,看似十分繁複,而且只能管理系統檔案。從 Windows 跳船過來的使用者一定想,是否有類似 CCleaner 的工具,點一點就可以把垃圾檔案清乾淨?
你可以使用 BleachBit (跨平臺),BleachBit 設計了一套相當有彈性的設定描述語言 – CleanerML,支援了許多常見軟體的清除功能,非常類似 CCleaner,軟體會自動偵測可清楚的軟體列表,只消點選要清除的檔案類型,BleachBit 就會自動刪除並計算所騰出空間。沒有 X 圖形界面時,也可以用 bleachbit_cli 指令列。
du --max-depth=1 -x |sort -n
# apt-get autoclean
# apt-get clean
apt-tools dependency
deborphan -a -n |sort -n
bleachbit (ccleaner for Linux)
雖然新的 Linux 軟體,已經逐漸使用 .local .cache, .config 等目錄設定方式,但是還是有許多軟體會把快取存在 .config 或自己的目錄中,像是 .gnome2, .firefox 等。結果是使用者很難找到快取檔案,若使用 UbuntuOne, Dropbox 等等雲端備份工具,常常連不重要的快取都一起備份了,費時費錢。
上述或指令或工具,看似十分繁複,而且只能管理系統檔案。從 Windows 跳船過來的使用者一定想,是否有類似 CCleaner 的工具,點一點就可以把垃圾檔案清乾淨?
你可以使用 BleachBit (跨平臺),BleachBit 設計了一套相當有彈性的設定描述語言 – CleanerML,支援了許多常見軟體的清除功能,非常類似 CCleaner,軟體會自動偵測可清楚的軟體列表,只消點選要清除的檔案類型,BleachBit 就會自動刪除並計算所騰出空間。沒有 X 圖形界面時,也可以用 bleachbit_cli 指令列。
2011年2月10日 星期四
Omnitty 大量管理Linux主機
Omnitty簡化大量管理Linux主機與多台主機指令同步執行測試 By Keynes
http://keynes0918.wordpress.com/2010/09/12/omnitty%E7%B0%A1%E5%8C%96%E5%A4%A7%E9%87%8F%E7%AE%A1%E7%90%86linux%E4%B8%BB%E6%A9%9F%E8%88%87%E5%A4%9A%E5%8F%B0%E4%B8%BB%E6%A9%9F%E6%8C%87%E4%BB%A4%E5%90%8C%E6%AD%A5%E5%9F%B7%E8%A1%8C%E6%B8%AC/
批量管理多台linux的软件 Omnitty
http://myhat.blog.51cto.com/391263/453090
Installation Instructions
Installing Omnitty from source code involves the standard steps you are used to:
$ tar -zxf /path/to/rote-X.Y.Z.tar.gz
$ cd rote-X.Y.Z
$ ./configure
$ make
$ su -c "make install"
$ cd ..
$ tar -zxf /path/to/omnitty-X.Y.Z.tar.gz
$ cd omnitty-X.Y.Z
$ ./configure
$ make
$ su -c "make install"
If you do it this way, omnitty will get installed in /usr/local/bin, which you should put in your PATH if it is not already there. You can then run the program by typing omnitty at the prompt.
http://keynes0918.wordpress.com/2010/09/12/omnitty%E7%B0%A1%E5%8C%96%E5%A4%A7%E9%87%8F%E7%AE%A1%E7%90%86linux%E4%B8%BB%E6%A9%9F%E8%88%87%E5%A4%9A%E5%8F%B0%E4%B8%BB%E6%A9%9F%E6%8C%87%E4%BB%A4%E5%90%8C%E6%AD%A5%E5%9F%B7%E8%A1%8C%E6%B8%AC/
批量管理多台linux的软件 Omnitty
http://myhat.blog.51cto.com/391263/453090
Installation Instructions
Installing Omnitty from source code involves the standard steps you are used to:
$ tar -zxf /path/to/rote-X.Y.Z.tar.gz
$ cd rote-X.Y.Z
$ ./configure
$ make
$ su -c "make install"
$ cd ..
$ tar -zxf /path/to/omnitty-X.Y.Z.tar.gz
$ cd omnitty-X.Y.Z
$ ./configure
$ make
$ su -c "make install"
If you do it this way, omnitty will get installed in /usr/local/bin, which you should put in your PATH if it is not already there. You can then run the program by typing omnitty at the prompt.
2010年11月9日 星期二
[連結]MySQL 的 DRBD 與 MM
http://ronnywang.pixnet.net/blog/post/25223266
MySQL 的 DRBD 與 MMM (1)
DRBD 已經被業界使用了多年,已經算是一個很成熟的架構。簡單說就是 RAID 1 over TCP 。也就是透過 TCP 讓兩台主機的硬碟內容完全一模一樣
MMM(Mysql Master-Master Replication Manager) 的架構
DRBD vs MMM 的優缺點比較表格。
是這一年來 PIXNET 使用 DRBD 和 MMM 上大概遇到的狀況的比較
是這一年來 PIXNET 使用 DRBD 和 MMM 上大概遇到的狀況的比較
訂閱:
文章 (Atom)