跳到主要內容

發表文章

目前顯示的是 6月, 2012的文章

linux debian ubuntu 限制頻寬

在機房通常是透過流量統計圖來收取費用,常常不知不覺的爆掉,但一個月可能只是爆一次,就被收取貴貴的費用,為了節省一點有時後不知為何的爆量,就來使用流量限制吧! 工具1 wondershaper eth0 download rate upload rate   sudo apt-get install wondershaper #如果是ADSL需要限制的是 ppp0 喔! sudo wondershaper eth0 2000 160   #下面是清除所設定的限制 sudo wondershaper clear eth0   #如果要開機就限制,可以到這裡設定 sudo vi /etc/network/interfaces #這裡舉例為eth1,所以你需要在eth1下面加上 up /sbin/wondershaper eth1 2000 160 down /sbin/wondershaper 工具2 apt-get install trickle trickled -d download rate -u upload rate trickled -d download rate -u upload rate   加上程式名稱  

YII DEBUG 結合 FIREBUG

YII 真強大,以前為了DEBUG印的整個網頁都是, 現在在config/main裡面加上以下CODE即可,system.db.* 也可以改成 system.* 資訊會更多 想看什麼就打什麼,記得開firebug 看主控台,就有一堆資訊了。 DEBUG完 需要整個拿掉喔! 'log' => array(             'class' => 'CLogRouter',             'routes' => array(                 'web'=>array(                     'class'=>'CWebLogRoute',                     'levels'=>'trace, info, error, warning',                     'categories'=>'system.db.*',                     'showInFireBug'=>true //true/falsefirebug only - turn off otherwise                 ),