SVNAnt does not work

September 3, 2009 · Posted in Uncategorized · Comment 

If using SVNAnt, make sure subversion is installed on the system.

In case, there is a way to use SVNAnt without it please let me know.

Invoke a servlet from a servlet

September 3, 2009 · Posted in Uncategorized · Comment 

There are couple of ways to do so:

  1. Send a HTTP request
    To invoke a servlet that requires authentication, in addition to creating the URL object, you need to pass authentication cookies too.

    URL url = new URL("http://blah");
    URLConnection con = url.openConnection();
    con.setRequestProperty("Cookie", request.getHeader("Cookie"));
    con.connect();
  2. RequestDispatcher
  3. Send a redirect

GMail down

September 1, 2009 · Posted in Uncategorized · Comment 

It has been more than an hour or so, I am unable to access gmail. I get the following error.

google-error

I wonder what made this happen!

Update: Found the problem what caused this mess on gmail’s blog

MySQL database backup and restore

July 14, 2009 · Posted in Uncategorized · Comment 

1. Create Database Backup:
You can use mysqldump to create a simple backup of your database using the following syntax.

mysqldump -u [username] -p [password] [databasename] > [backupfile.sql]

  • [username] – this is your database username
  • [password] – this is the password for your database
  • [databasename] – the name of your database
  • [backupfile.sql] – the file to which the backup should be written.

You can also ask mysqldump to add a drop table command before every create command by using the option –add-drop-table. This option is useful if you would like to create a backup file which can rewrite an existing database without having to delete the older database manually first.
mysqldump --add-drop-table -u [username] -p [password] [databasename] > [backupfile.sql]

If you want to back up certain tables
mysqldump -u [username] -p [password] [databasename] [table1] [tableN]> [backupfile.sql]

If you want to back up multiple databases
mysqldump -u [username] -p [password] [databasename1] [databasenameN] > [backupfile.sql]

Or want to back up all databases
mysqldump -u [username] -p [password] --databases-all > [backupfile.sql]

2. Restore from database backup

Restore a particular database
mysql -u [username] -p [password] [database_to_restore] < [backupfile]

Restore all databases
mysql -u [username] -p [password] < [backupfile]