Monthly Archives: December 2006

easy access to unix man page


Posted in ajax gadgets | Comments Off

writing secure PHP code

This is a great post about writing secure PHP code and part 2. The articles pretty much cover all the points we need to look at to write secure PHP code. Additionally this post talks about how hackers can use … Continue reading

Posted in security | Comments Off

ascii to char decoder

This is a tool to convert an ascii stream to character string. I wrote this tool to make my life easier to peek into the spam page I got in the email and figure how do they hide the Javascript … Continue reading

Posted in ajax gadgets | Comments Off

cron job reference

The crontab is a scheduled job utility on *nix server. To edit a cron schedule: crontab -e This will open the schedule file based on the EDITOR setting in your shell. VI is the most commonly used editor. A cron … Continue reading

Posted in linux goodies | Comments Off

a mortgage calculator using ajax + PHP

This little tool is written with ajax and php script. This mortgage calculator can be used to figure out monthly payments of a home mortgage loan, based on the home’s sale price, the term of the loan desired, buyer’s down … Continue reading

Posted in ajax gadgets | 1 Comment

html url decoder

This is a little tool to convert the decoded URL back to an Ascii string. decode url: output:

Posted in ajax gadgets | Comments Off

where are the mysql general logs and error logs

The regular query log: The MYSQL query can be logged by starting mysqld with –log[=file] or adding this line in my.cnf file:  log=/var/log/mysql.log (/var/log/mysql.log is the actual file path) Since the query log will record every query happening on every … Continue reading

Posted in mysql | Comments Off

Utilize multiple hosting accounts

I have several hosting accounts ranging from shared hosting to VPS. Besides their hosting duties, I also assigned them some additional tasks. Install cron jobs on a shared hosting account to ping the other servers for uptime. A simple PHP … Continue reading

Posted in server setup | 2 Comments

mysql’s useful … sqls

Create a new user:  grant all on mydb.* to myuser@localhost identified by 'mypass'; show grants for ‘username’@’localhost’ revoke all privileges on db_name.* from ‘username’@’localhost’ drop user ‘username’@’localhost’

Posted in mysql | Comments Off

imagecreateresampled vs. imagecreateresized

If you are using image manipulation functions in PHP to resize a image, a common mistake is to use the imagecreateresized() function. Actually, most of the time, imagecreateresampled() function should be used. According to the API document, imagecreateresampled() copies a … Continue reading

Posted in PHP development | Comments Off