20 Jun

Script to Convert FLV to AVI

This will convert a flv file to a avi file. I got this off linux.com. It uses mencoder – so make sure you have that.


if [ -z "$1" ]; then
  echo "Usage: $0 {-divx|-xvid} list_of_flv_files"
  exit 1

# video encoding bit rate

while [ "$1" ]; do
  case "$1" in
      MENC_OPTS="-ovc lavc -lavcopts \
      MENC_OPTS="-ovc xvid -xvidencopts bitrate=$V_BITRATE:autoaspect"
      if file "$1" | grep -q "Macromedia Flash Video"; then
        mencoder "$1" $MENC_OPTS -vf pp=lb -oac mp3lame \
          -lameopts fast:preset=standard -o \
          "`basename $1 .flv`.avi"
        echo "$1 is not Flash Video. Skipping"
04 May

A Shell Script to Create a Build of Firefox Extension

This shell script will create a build of a firefox extension in linux. This is created according to my details(eg, the guid has @binnyva.com in it) – but you can modify it and use it yourself.


if [ $# -eq 0 ] ; then
	echo "Useage: sh build.sh  []"

elif [ $# -eq 1 ] ; then

rm $app.xpi
cp -r $folder temp
cd temp
rm -rf .git

zip -r $app.xpi .>/dev/null
mv $app.xpi ..
cd ..
rm -rf temp
echo "Built $app successfully"

05 Dec

Stop crond When mysqld is Down

A perl script to stop crond if mysqld is down


# See if MySQL server is alive or not
$mysql_status = `/etc/init.d/mysqld status`;
print "MySQL Status: $mysql_status\n";
unless($mysql_status =~ /running/) {
	print "Stopping Cron... ";
	#If MySQL is not running, kill the crond
	$cron = `/etc/init.d/crond stop`;
	print $cron;

print "\n";
05 May

SourceForge Project Packager – from SVN source

This script will package your SVN code to a tar.gz file. Just give the name of the project as the first argument. Like this…

perl packager.pl jus5

#Package a Sourceforge project from its SVN source.

die("Please provide the name of the project as the argument") unless($ARGV[0]);


`svn checkout https://$project.svn.sourceforge.net/svnroot/$project`;
`find $project/ -name .svn -exec rm -rf {} \\;`;
`tar -czf $project.tar.gz $project/`;
`rm -rf $project/`;