Wednesday, April 22, 2009

download photo from orkut album

orkut doesn't allow right click on the photos in the album. So downloading is not possible. But as nothing is 100% perfect, we can workaround it -

left click on the picture and drag it to the address bar. wowww there you go, now the picture is opened in the browser with right click. Now you can right click and download it.

Friday, April 17, 2009

backup clearcase checkedout files

Here is a script which I used to backup my checked out clearcase files.

What the script does is
1. Store the config spec in a temporary file
2. Get all the checkedout files
3. Using sed, prepend drive letter ( i run clearcase client over windows)
4. tar all the checkedout files and config spec. The backup filename contains the date and time, so
that backup date is kind of timestamped.
5. Move the tar file to a network location ( I have mapped B drive to a network location)
6. I have this shell script in the drive, where i have the view mounted and execute it whenever
i feel like backing up my code changes.

I am trying to automate the backup( say automatically backup every night at 10PM, thats when i go to sleep) job using crontab. But I think my cygwin is giving me trouble with this.

--------------------------------------------------------
#!/bin/bash

ct catcs > config_spec
ct lsco -avobs -cview -short > checkout.files_temp
sed -e 's/^/Y:/g' checkout.files_temp > checkout.files
tar -cvf a.tar `cat checkout.files` config_spec checkout.files
mv a.tar B:/Backup/backup_`date +"%Y%m%d%H%M%S"`.tar
rm checkout.files*
rm config_spec

--------------------------------------------------------