Category Archives: Linux

Bash scripts I've found usefull

To convert avi files to mp3s (used this page as reference)

This script converts all the avi files in a folder to mp3s.
for file in .; do for filename in *.avi; do mplayer -dumpaudio "$filename" -dumpfile "$filename".mp3; done; done

Tried the above script, and I kept getting core dumps. Modified it to use ffmpeg instead of mplayer.

for file in .; do for filename in *.avi; do ffmpeg -i "$filename" -ab 128k -vn "${filename%.avi}.mp3"; done; done

To convert mp4 files, I found this at this site. It uses some pretty advanced techniques (at least to me) to pass the output of one program (faad) to another (lame).
I added the -V9 (V9=lowest VBR quality), since I wanted a small file size.

#!/bin/bash
for i in *.m4a; do
echo "Converting: ${i%.m4a}.mp3"
faad -o - "$i" | lame -V9 - "${i%.m4a}.mp3"
done

rtorrent is great

I’ve been using TorrentFlux for a while on a headless server with great success for the past few years. Recently I’ve had some issues with it, mainly due to the fact that on some larger torrents, it seems to hang, seeding many torrents seems to eat a ton of memory, and CPU load.

So after some looking around, I found rtorrent. A full text based torrent client. Continue reading

Booksmart in Linux

Followed the instructions on Leuc’s site to get version Booksmart 1.9.8 working on linux.
Got the patch.
First try was using the mac dmg file. Extracted the contents, and tried running the command that Leuc has on the site. but no luck. Then I read about the problems with 64bit java.
Meanwhile I also install the Win version on a win machine and copy the lib and resources folders, hoping that things would work. No luck again.

So after some fiddling with installing only the 32bit versions of java on a 64bit OpenSuse 11.0 machine, I got it working. Shocking! I know. I was impressed. That just means I gotta get off my ass and make the Morocco book. And the baby book.

Some notes:
When changing to 32bit version of Java 1.6, it seems to install java 1.5 also. But it installs the 64 bit version, so that then needs to be told to install the 32bit version, which in turn brings up some other dependancies. I didn’t bother with those dependancies.

Setting up the Brother 2070N in SuSE

I battled with this the first time I tried to install the Brother HL-2070N back when I had SuSE 10.3, and I struggled with it again with SuSE 11.0. Mind you I got it working both times, but next time should be a breeze:
– First, make sure the CUPS server is running.
– Read this link to the openprinting database.
– Then download and install both the lpr driver and CUPS wrapper from the brother website.
– The printes should be added to the CUPS server, however it is set up as a USB device. Click the Modify Printer button and select Internet Printing Protocol (http) on the second page, then on the next page, for the Device URI use http://192.168.0.80:631/ipp/port1
– That’s it. Print a test page, and it should be good. Oh, don’t forget to set the resolution to 1200.

On another note, the 2070H driver doesn’t not offer much in the way of options for the print.
Since the printer is capable of emulating HP LaserJet PCL 6, I added another Brother 2070N printer, but HP LaserJet 6 drivers.
Works great, and I have more control over the final image/print.

Backup strategy for my files

I’ve been meaning to document this in case I need to re-create the backup schedule, as well as to have a place I can quickly check to find out when what gets done.

– A DualLayer DVD backup has been made of both Music and Photos in July 2008 using software called “Backup Platinum 4.0“. It sorts out how much data it puts on each disk to fill it up without truncating data, while preserving the original directory tree. Exactly what I needed. Only downside is that it runs on windows.

Work Folder
– Nightly at 12:00 a backup (rsync cron job) of the Work folder gets done to the external usb HD.

Music folder
– Nightly at 1:00am a backup (rsync cron job) of the Music folder gets done to the external HD

Photo folder
– Nightly at 2:00am a backup (rsync cron job) of the Photo folder gets done to the external HD

More on AuFS

I tried to get AuFS working again, and finally got it running.
It looks like after each reboot I need to run #insmod /lib/modiules/2.6.25.5-1.1-xen/kernel/fs/aufs.ko
This loads the aufs mofule into the kernel?

Without it each #mount command responded with “aufs is not a known fs type” (or something like that.

NFS and XEN

It seems that running a NFS client in one of the DomU (guest OSs) results in VERY poor read/write performance.
So I’ve had to run everything over a Samba connection.
Not the prettiest solution, but I get normal read/write speeds.

This is weird, cuz this worked just fine in Suse10.3… Or did it… I never tested it, but I also never had any reason to suspect it as not working, since speeds were very decent.

Deciding how to best backup my data

Now that I’m implementing AuFS along with FlexRAID, I am debating on how to best make use of these technologies.
The way I see it, data will fall into one of these 3 categories:
– Data that is in a Raid set as well as mirrored to another drive
– Data that is in a Raid set
– Data that I don’t mind loosing. (not part of a Raid set or mirrored)

I just need to decide what data falls into what category.