Annotating the photograph with comments.

There is a nice Linux command called convert. This command can be used in various ways to do image manipulation. One of them is to embark your image with some text. Here is how to do it.

echo \”Annotating the image \”$2\” with $1\”
convert -font  Verdana -pointsize 40 -fill red -draw \”text 100,100 \”$1\”\” \”$2\” \”$2\”

It will be good idea to save this as \”annotate\” as we will use this later too.

Script to Watch for Ubuntu 9.10 Launch – can be used in other scenarios.

I know ubuntu is out already but this is something that you can use to monitor a webpage.

This script will run check a for the Ubuntu 9.10 launch once every 5 mins and let you know when it\’s available:

 while [ 1 ]; do if [ -z \"`curl -I \"http://cdimage.ubuntu.com/releases/9.10/release/\"|grep \"404\"`\" ]; then kdialog --msgbox \"9.10 Released\"; exit; fi; sleep 300;  done

\"\"
\"\"

URL: http://www.shell-fu.org/lister.php?id=894

\"Reblog

bash script with sql to get the number of records from multiple tables.

Here is the bash script:

#!/bin/sh
names[1]=errorlog
names[2]=amit1log
names[3]=amit2log
names[4]=amit3log
names[5]=amit4log
j=1
echo $1
for i in $( sqlplus amit/passwd@tns @get_count.sql |sed  -n \’/COUNT/,/Disconnected/p\’|sed \’/COUNT/ d\’|sed \’/—/ d\’|sed \’/Disconnected/ d\’|tr \’n\’ \’ \’  )
do
temp=${names[$j]}
let count=30-${#temp}
for ((I=1; I <= $count ; I++))
do
printf \” \”
done
echo  \”${names[$j]}    : $i\”
# echo $j
let j=j+1
done
echo
echo

and the required sql script:

select count(*) from errorlog;
select count(*) from amit1log;
select count(*) from amit2log;
select count(*) from amit3log;
select count(*) from amit4log;
quit;

I have verified this to be working on Solaris and Oracle. Might need some changes for mysql, but should not be much.

\"\"