Apache logs …

While troubleshooting apache webserver, it would be helpful to have an idea of what are the various status code for HTTP. e.g.

192.168.168.168 – - [09/Feb/2008:14:03:26 +0800] “POST /index.php/display/refresh HTTP/1.1″ 200 – “http://www.takizo.com/blog/…” …

the above log entry would mean the client (192.168.168.168) have connected and the page have been served.

if :

192.168.168.168 – - [09/Feb/2008:13:24:11 +0800] “GET / HTTP/1.1″ 500 – “-” …

would mean there is a error while getting the page. In my case, check mod_access’s allow & deny statements.

That’s all for now, Happy monitoring !!!

Downgrade package in Debian

 getthunderbird.png

For some reason, the recent Icedove (aka Thunderbird) version 20.0.0.9-3 in Debian does not work with the latest Enigmail version 0.95.6. No choice, got to downgrade it back to Icedove version 1.5. How ? No worries, apt is a flexible package manager, just “apt-get -t <distribution> install <package name>”.

e .g. apt-get -t unstable install icedove

Have fun !!!

vim – search & replace

was searching what is the escape sequence for tab & return, found this cheat sheet. Anyway, below are the common ones :

shamelessly plug it from Laurent Grégoire home page. Thanks Laurent !!!

Apple Macbook Air

Anyone interested to pre-order Apple Macbook Air?

symfony / propel with RAND()

Lately I am working on a simple online test system which doesn’t take up much of my to write the code from scratch. One of my favorite is using propel to generate the admin panel, it’s so easy, quick and code management is clean and neat.

i have a set of questions, for example 100 security related questions but some of the engineer may only need to answer 20 out of 100. And each engineer shouldn’t get the same question and using RAND() is easier for me in order to write – less code.

here is an example how you select random questions from database using propel;

$c = new Criteria();
$c->addAscendingOrderByColumn(‘rand()’);
$c->setLimit(20);

start having fun coding with symfony framework.