Tuesday, May 05, 2009

Save Webpage as image or PDF

Do you want a full snapshot of a webpage you are visiting as an image or as a PDF file? Here is a firefox addon which helps you with that.

https://addons.mozilla.org/en-US/firefox/addon/7528

Here are the options it supports.



I tried it on one of my websites and I'm impressed with the results. Good tool if you ever want to print your website on paper for promotional purposes!

Monday, May 04, 2009

Renaming mysql database

Mysql version 5.1.7 to 5.1.23 had "RENAME TO ". It was later removed because of a finding that it can lead to data loss. The easiest way to achieve this now is to dump the contents of the existing database to another newly created one.

echo "create database new_database;" | mysql -u <username> -p <enter password>

mysqldump --user=<name> --password=<password> <old_database> | mysql -D new_database -p <enter password>

Now you can drop the old database ( after making sure you have all the contents on the new database). Ofcourse you need to recreate the user permissions for the new database.