Author Archives: James Lin

PHP Tutorial: Server load bar chart

Server Load: Just a quick tutorial on drawing the server load bar chart in php: serverload.php function get_server_load($windows = 0) { $os = strtolower(PHP_OS); if (strpos($os, “win”) === false) { if (file_exists(“/proc/loadavg”)) { $load = file_get_contents(“/proc/loadavg”); $load = explode(‘ ‘, $load); return $load; } elseif (function_exists(“shell_exec”)) { $load = explode(‘ ‘, `uptime`); return $load; }… Read More »

Category: PHP

MyISAM vs InnoDB decision matrix

Ever had problem choosing the right MySQL storage engine? Here is a simple matrix for you to make your decision Is your table is going to be inserted, deleted, and updated much much more than it is going to be selected? InnoDB If you need full-text search MyISAM If you prefer/require relational database design InnoDB… Read More »

Gawker pwned by 4Chan, badly

Quoted from the release notes … _________________________________________________________________________ .’ `. | .o .o .oooooo. o8o | | .8′ .8′ d8P’ `Y8b `”‘ | | .888888888888′ 888 ooo. .oo. .ooooo. .oooo.o oooo .oooo.o| | .8′ .8′ 888 `888P”Y88b d88′ `88b d88( “8 `888 d88( “8| |.888888888888’ 888 ooooo 888 888 888 888 `”Y88b. 888 `”Y88b. | |… Read More »

How to create a Linux daemon in Python

I was writing a Python program to perform some routine tasks on twitter API, and came across this very helpful article for creating daemon process in Python… thought you might be interested… A simple unix/linux daemon in Python

SmoothScroll For Chrome

Came across this Chrome extension tonight, works very well, so I thought you might be interested. https://chrome.google.com/extensions/detail/cccpiddacjljmfbbgeimpelpndgpoknn?hl=en