Useful shell scripts



Some useful shell scripts. Do chmod a+rx on the file when you have
downloaded it. Put the file in your PATH. For example /usr/local/bin
I will put more scripts here later.



film - Unrars VCD and SVCD movies and convert the cue/bin to MPEG

Instructions:

Go the movie dir: cd Great.Movie.SVCD.SCREENER-Centropy
[luser@lamehost Great.Movie.SVCD.SCREENER-Centropy]$ film
And just write film like you see above. You must have rar and vcdimager for the
script to work. You can download them here as rpms if you dont have the time
to find them in some other place.

rar-3.0-2.i686.rpm
vcdimager-0.6.2-1.i386.rpm



index - Makes clickable index.html's with the look of ls -AGl

Instructions:

cd to the directory where you want to make a index.html. Execute the script.
Note that the files MUST have date format "MMM DD TT:TT" so "MMM DD  YYYY" will
not work. Do "touch *" to change the date on all files, if needed.

You will have to add the html and pre tag in the begining and in the end. See
this template. And maybe some title also. Very easy to read the code.
You can see one example of it here, use view source on the page. I would never
had put so much files on my site if I wouldnt had that script, it would have
taken WEEKS just to write the html code for it.



wipeout - Deletes all dirs that are older than XYZ

Instructions:

Very useful on a topsite :P (No, I dont trust autodelete scripts!)
Edit the time variable in the script. Go to the dir, example: cd SVCD
Run the script.



bigfiles - List 20 biggest files in current dir and all subdirs

Instructions:

Just run and wait.



albumid3tag - Set album name in mp3 id3 tags to the same as the dir name

Instructions:

Well, its pretty hardcoded for my setup. You have to change it so it fits
your setup. The thing after "special" arent really part of the script, just
some small fixes. Notice that this will write to each mp3 file your got,
so you will get new dates on all your files. Hardly a problem for anyone
but just wanted to say it. I used this on my 40.000 mp3 files when I
wanted to load some of them into my ipod. You need to install id3tag
for this script to work.

cd .. back to my homepage