Saturday, May 31, 2008

Amarok setup

On Susanne's PC:

Installed MySQL client from repos

Edit /etc/mysql/my.cnf, adding this line to stanzas [client] and [mysqld]:
default-character-set = utf8

sudo /etc/init.d/mysql restart

installed mysql server
had to enter password

susanne@arwen:~$ mysql -p -u root
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 4
Server version: 5.0.45-Debian_1ubuntu3.3-log Debian etch distribution

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

set password for root@localhost = password('xxxxxxx');

mysql> CREATE DATABASE amarok;
Query OK, 1 row affected (0.02 sec)

mysql> USE amarok;
Database changed
mysql> GRANT ALL ON amarok.* TO amarok@localhost IDENTIFIED BY 'PASSWORD'
-> ;
Query OK, 0 rows affected (0.00 sec)

Query OK, 0 rows affected (0.00 sec)

mysql> Aborted

Friday, May 16, 2008

Long file names and removable media

I was recently trying to copy a bunch of files onto an SD card, and kept getting an "out of space" error message, which was kind of odd, considering the 300 or so image files added up to a grand total of just over 20 MB, and the card was en empty 1 GB card.

Much poking, prodding, trying stuff from the command line and googling resulted in me learning more about VFAT than I'd originally intended. Anyway, it turns out that the implementation for long file names in VFAT is a workaround which means that if you have too many(1) long file names in the root directory you may chew up all your allocation units and get "out of space" errors long before the media itself is full.

Files in sub folders are not implemented in the same way, and therefore don't exhibit the same behavior. Put all of the files in a subdirectory and all is well.


Wikipedia's entry on various implementations of Mr Gates' File Allocation Table.

A MEPIS forum post that really pointed me in the right direction.


(1) How many depends on how long your file names actually are, you use one extra directory entry for every 13 characters. I think it's 512 directory entries, so assuming I had 302 x some number greater than 1, I was bound to run into problems.

Wednesday, May 14, 2008

Torrents and such

I should probably do a general guide on torrent clients and sensible practices.

For reference:
I found a good description of abbreviations for TV episode torrent descriptions here, on Mininova.

Windows XP Service Pack 3

I've just completed my first trial run with XP service pack 3. I installed it on top of a fresh copy of windows XP Professional, installed i a VMWare virtual machine. It installed without a hitch, seemed faster than the SP2 installation.

I've since run a Windows update check, and there were only 3 "high priority" updates. Not perfect, but much better than the several hundred MB of downloads and several reboots required after an SP2 installation.

My plan is to install a few basics and keep a copy of this VM for use as a base for various tasks. The first one will be a Visual Studio 2008 VM. 8 GB will probably be just enough* for this, but if I can keep it to 8 GB I can burn copies to DVD. My intention is to have task specific VM's, rather than one do-everything machine.

It will require a little more discipline, but I think it will serve me better in the long run, especially as I do more and more on Linux. Launching a Windows VM on demand should be more convenient than dual booting, except perhaps for gaming. However, my computer gaming time is pretty much non-existent these days, so it's not really much of a sacrifice.

* As it turns out, 8 GB really insn't enough for Visual Studio 8. Actually, the install was OK, but I removed C#, leaving me with less than 1GB. This, unfortunately, is unsufficient to install any of the docoumentation and reference material. I'll see how this goes, I can almost certainly have the doco on a second monitor / machine in most instances. Otherwise it'll be a 10-12 GB build.

Tuesday, May 13, 2008

Music for Norm

For future reference:

The music from Norm's Tai Chi DVD is made by "The Silk Orchestra".

Here's a CC-Now link. The particular tracks on the DVD are are called "Remembrance" and "Mr Wu".

Monday, May 12, 2008

Ripping Audio from a DVD

I was recently asked to get the audio from a DVD and place it on a portable media player. Here's how I did it, using Ubuntu 7.04.

1. Installed mplayer from the repositories

2. played the various chapter until I found the one I was looking for. This can be a bit of a hit and miss process, as DVD's often have rather strange title/chapter builds. The command is:
mplayer dvd://4
Where the "4" refers to the title number. This particular DVD has 6 titles. Apart from playing the chapter, you'll see a bunch of stuff in the console window. click "x" to stop playing. The output includes the following:
Playing dvd://4.
There are 6 titles on this DVD.
There are 2 chapters in this DVD title.
There are 1 angles in this DVD title.
audio stream: 0 format: ac3 (stereo) language: en aid: 128.
audio stream: 1 format: ac3 (stereo) language: zh aid: 129.
number of audio channels on disk: 2.
number of subtitles on disk: 0
MPEG-PS file format detected.
VIDEO: MPEG2 720x480 (aspect 2) 29.970 fps 7500.0 kbps (937.5 kbyte/s)
xscreensaver_disable: Could not find XScreenSaver window.
GNOME screensaver disabled
3. The red text above shows the information I needed. There were two audio tracks for this title, I was after the english (en) version. The command to extract the audio is: (This is meant to be all on one line)
mplayer -vc null -vo null -aid 128 -ao pcm:fast:waveheader:file=output.wav dvd://4 -chapter 1-2
The "128" refers to the audio track found in step 2.
"Output.wav" is the output file name.
chapter 1-2 means I want the audio from both chapters. "2-2" would have taken only the second.

4. Import the wav file into audacity, a superb audio editor.

5. I then used audacity to crop and normalize the audio I wanted, including adding nice fade ins and outs.

6. I Again in audacity, export the audio to mp3.

All Done.


Most of this is derived from this post on the Ubuntu forums.