Category: Uncategorized

  • Alexa scrambles traffic data

    It’s pretty interesting to see that Alexa is using CSS to scramble site traffic results. Now you cannot select, copy the data and paste into somewhere else because some random numbers are added between the original characters. The browser sees this: adspeed.com – 96% serv.adspeed.com – 4% The code is actually this (if CSS is…

  • Sample lilo.conf

    [root@s7 trungson]# more lilo.conf lba32 boot=/dev/sda delay=70 vga=normal map=/boot/map default=2.6.12.4 image=/boot/vmlinuz-2.6.16-1.2111_FC4 label=2.6.16-1.2111_F read-only root=/dev/sda3 initrd=/boot/initrd-2.6.16-1.2111_FC4.img image=/boot/vmlinuz-2.6.11-1.1369_FC4 initrd=/boot/initrd-2.6.11-1.1369_FC4.img label=2.6.11-1 root=/dev/sda3 read-only image=/boot/vmlinuz-2.6.12-1.1447_FC4 initrd=/boot/initrd-2.6.12-1.1447_FC4.img label=2.6.12-1 root=/dev/sda3 read-only image=/boot/vmlinuz-2.6.12.4 label=2.6.12.4 read-only root=/dev/sda3

  • Testing with older version of IE

    If your computer has upgraded to IE7, and people are reporting design issues in IE6 or lower, you can download and run standalone version of older IE’s to test and fix the design. There is no installation to do, only run the program.

  • tmpwatch – Clean up your temp files

    If your temporary files are growing too many too quick (say the working file of mod_gzip, sessions), there is an easy solution to clean up. Run: root# tmpwatch 1 /dev/shm/mod_gzip This cleans up the file that have not been accessed for one hour. See man tmpwatch for more information

  • man ps – process status

    -O is preloaded “-o” -c different scheduler info for -l option -f does full listing -j jobs format -l long format -o user-defined format -y do not show flags; show rss in place of addr O is preloaded “o” (overloaded) X old Linux i386 register format j job control format l display long format o…

  • A simple Taconite usage

    We were testing Taconite a long time ago and this is a basic usage. Since we now use an internal AJAX framework, we release this snippet so someone might get an idea how to use this framework. It’s nothing fancy, only a simple snippet. $o = ‘‘; $o .= ‘‘; $o .= ‘‘; $o .=…

  • usleep & CPU usage

    If you’re making a PHP client-server script using a loop to capture events and process data. The CPU usage might be significant. In our test environment, it consumes 50% CPU cycles constantly. A quick and simple fix: add usleep() of about 100-500ms before looping again so it’s still interactive with users yet allow CPU to…

  • Setting up swap

    # set up 512MB swap file dd if=/dev/zero of=/swapfile bs=1024k count=512 mkswap /swapfile swapon /swapfile # enable it at boot time, edit /etc/fstab to include: /swapfile swap swap defaults 0 0

  • scp – Copy files to another server in SSH

    Say you need to replicate a huge MySQL database to another machine and dumping and import the database might take hours, copy the binary files (/var/lib/mysql/DB_NAME) might be a quicker method. To do that, we can use scp: s1# scp -P SSH_PORT /var/lib/mysql/DB_NAME/ user@s2:/var/lib/mysql/DB_NAME/ You would also need to chmod (644) & chown (mysql:mysql) the…

  • Remote kernel upgrade

    If for some/many reasons after a kernel upgrade, the system does not reboot. Some hosting control panels can reboot the server into rescue mode. In this mode, you can edit the lilo.conf to go back to the previous working kernel. Make sure you backup the file first. # check for available partitions fdisk -l #…