BurnPC.com

Audio, barbecue, beer and computers. ‘Nuff said.

BurnPC.com header image 3

Useful Bash Scripts

A few things I keep in ~/scripts which I put on my path.

SpaceReplace

http://www.novell.com/coolsolutions/tools/15601.html

Firefox Killer

I use this when VNCing into my home machine from work. Firefox won’t run if my other session has it running, so I just run ffkiller.sh and then I’m good. You could modify this for just about any annoying process…
#!/bin/bash
ffox=`/sbin/pidof firefox-bin`
if [ -z "$ffox" ]
then
echo “Firefox is not running”
exit 2
fi
echo “Killing Firefox!”
kill $ffox
echo “Firefox is dead…”

Mount ISO

#!/bin/bash
if [ $# -eq 0 ]
then
echo “usage: mountiso file mountpoint”
exit 1
fi
mount -o loop -t iso9660 $1 $2

Convert Video for Youtube upload

#!/bin/bash
mencoder $1 -ovc xvid -oac mp3lame -xvidencopts fixed_quant=4 -vf expand=aspect=4/3,scale=448:336 -o $1-tubed.avi

No Comments

0 responses so far ↓

  • There are no comments yet...Kick things off by filling out the form below.

Leave a Comment