Archive

Archive for April, 2010

A Mathematical Captcha – Reinventing the Wheel

April 19th, 2010 2 comments

For a long time I have been using the image captcha with random characters, and got fed up. I had seen numeric computational captcha or Mathematical captcha where one has to calculate the answer of an equation with simple arithmetic and supply the result for verification. Last night I was pondering over this while watching a movie on the TV. Well the out come is obvious.
Read more…

Categories: Code Snippets, PHP, Tips Tags: ,

Function to format bytes in human readable format

April 8th, 2010 No comments

I was digging through my old codes to get this, still could not find. Hence when I wrote it, just made a note here such that later it wont be difficult to find atleast for me.
Read more…

Categories: Code Snippets, PHP, Tips Tags: ,

Using Bash to take incremental backups on MySQL database

April 6th, 2010 1 comment

At Saturn in the development labs, we restructured the development mysql by logically splitting out or combining projects and spread it across four instances of mysql running on a dedicated server. Later we felt that the weekly backups of mysql data folder was not sufficient for some of our projects. And for these we decided on having a rotational backup. The backup plan was to have a full backup of data and structure every Sunday and then difference of the database from last sunday to every other day, rotate the backups every fourth week. The structure backup was decided to be taken with mysqldump and the options –routines –triggers –no-data –compact. Whereas the data backup was to be taken as tab-seperated-values, using select into outfile. We had specific reasons to decide these methods as well as to take data and structure seperately.

Read more…

Categories: General Articles, mysql Tags:

Formatted XML, the php dom way – Best for debugging

April 3rd, 2010 No comments

Recently in a discussion on linkedin PHP webservice – Logging Requests/Responses, Roy de Kleijn had asked “how can I print the XML in XML structure, in stead of a single line of text”, which triggered me a thought. This may be trivial for veterans, and still a new information for newbies.

Read more…

Categories: Code Snippets Tags: ,