Category: Uncategorized

  • powercfg – Save power when using battery

    A not-very-popular tool to adjust power configurations in command mode. Run “powercfg /?” C:\Documents and Settings\mathie>powercfg /? POWERCFG [/LIST | /QUERY [name] | /CREATE name | /DELETE name | /SETACTIVE name | /CHANGE name settings | /HIBERNATE {ON|OFF} | /EXPORT name [/FILE filename] | /IMPORT name [/FILE filename] | /GLOBALPOWERFLAG {ON|OFF} /OPTION flag | /BATTERYALARM…

  • Breaking up a big file into small ones w/ rar

    rar a -m0 -v800m file.rar file.big

  • lighttpd & Apache together on multipleIPs

    Say you need to run lighttpd & Apache together on the same server, same port 80, but on different IP addresses. Have this in lighttpd.conf: server.port = 80 server.bind = “lighttpd_IP1” $SERVER[“socket”] == “lighttpd_IP2:80” {} And listen to a specific IP in Apache’s httpd.conf Listen Apache_IP:80

  • Count source code lines recursively

    Since wc itself does not have a recursive option built-in, it’s as simple as: find . -name ‘*.php’ | xargs wc -l

  • lighttpd & image serving benchmark

    The difference between serving image from MySQL & from a static file is huge so there is clearly no question which one is better in term of performance. ab -n 1000 -c 10 25131.php Requests per second: 66.33 [#/sec] (mean) ab -n 1000 -c 10 25131.gif Requests per second: 632.39 [#/sec] (mean)

  • lighttpd, php5, eAccelerator by RPMs

    Install the require RPMs (php, php-mysql, php-eAccelerator). For Fedora, use yum (lighttpd and lighttpd-fastcgi). For CentOS and other distros that do not include lighttpd in their repository, use DAG repository Find out the path to php-cgi and whether it supports fastcgi (should show cgi-fcgi) $ php-cgi -v PHP 5.0.4 (cgi-fcgi) (built: Nov 8 2005 08:25:54)…

  • Google Earth v4 & Vietnam maps

    Google Earth recently released version 4 (beta) and also it supports higher resolutions maps for Vietnam metros (like Saigon, Hanoi, and other cities). Great kudos for them. Love those maps, now I see things I never know about Saigon before.

  • Shell-script: MySQL optimize all tables

    Using myisamchk sometime requires shutting down MySQL server and that’s not very easy in certain situation. This shell script accepts a database name from input and gets all table names and runs a SQL query against these tables. Currently, it only optimizes all the tables and could be expanded to do a lot more. OPTIMIZE…

  • APF & iptables issue

    If you try to restart APF and somehow got this message: Unable to load iptables module (ipt_state), aborting. change this in the conf.apf SET_MONOKERN=”0″ change to “1”

  • LVS-TUN Director Notes

    Director server needs at least 2 IP addresses, one for the Virtual IP and one for other things. With just one, SSH seems to forward to the other machine among other unexpected behaviors. Real/Worker server needs just one IP address each. Kernel 2.6.x seems to have no problem with the ARP problem and no need…