Archive

Archive for October, 2012

Power of man

October 30th, 2012 gergo 1 comment

Due to a bigger data loss, I had to re-collect my music. Fortunately I found all work of Yoko Kanno in a single torrent in lossless format.

But heaven is not so shine however. The collection was in strange format: one ape file and a cue file per disk.

That wasn’t a big problem. I spoke with the devil (search at google) and he showed me a fine article how to split the ape file with a cue and convert into flac.

The real problem was ahead of me, because ape is an Apple product, so it does not have good support under the free side of the world.

First I found a mac (Monkey’s audio codec) package, which was corrupt, because the version number started with a letter. How good that the creation of a deb package requires a whole life to be prefect.

The second hit was better, a post at Ubuntu forum contained an attached zip file of mac package. However the download cost a half an hour pain, because you cannot download a file from a post you have to login, manage the lost user account, connect it with your launchpad user… All of the trouble to accept a legal term, so Ubuntu will be protected against Apple, so Apple cannot attack them, because they support the Apple’s ugly audio format. Apple and the administrator of Ubuntu should be dead soon.

And now everything was ready to work.

cuetools was perfect for the job, my only problem was the file names. Their was be named after the track number only. But there is no problem at all cue is a text file so I grabbed sed:

sed  -rn 's/\s+TITLE\s+"(.+)"/\1/p' CDImage.cue|sed =|sed -r -e  's/^([0-9])$/0\1/' -e 'N;s/\n/=/'|sed -rn -e  's/([0-9]+)=([^\n]+)/split-track\1.flac \1-\2.flac/p'

I mentioned Yoko Kanno before, she is a Japanese lady, so the titles hold some kanji as well. That trick fools sed a little. The second group in the sed expression is the title, and everything that was written after that (.flac) simply overwrote the head of the line.

I lost my temper at this point, and started to follow the dark side of programming: I wrote a small python script. It toke almost an hour but it worked. I thought that’s a missing point in cuetools, so I should distribute my silly code. But I checked the content of cuetools, maybe I lost something, and yes I did. cueprint does my job in a second:

cueprint CDImage.cue -t ‘mv split-track%02n.flac “%02n-%t.flac”\n’

Remarkable fact never leave out the study of the manuals.

Categories: Uncategorized Tags:

Desktop Goodies

October 21st, 2012 subogero Comments off

g

is the new go. The name of my Gnome command-line launcher clashed with a certain programming language, so I changed it. Not the programming language stupid. Mostly out of respect for probably the greatest hacker of all time who is involved in the go language. His other inventions include Unix, regular expressions, utf8 encoding and brute force. Finding out his name is left as an exercise to the reader.

tapeta

Hungarian for wallpaper. I was looking for a desktop wallpaper slide show program for Linux. The best the internet could come up with was Desktop Drapes. It has a few small problems, though. You have to add every single picture manually to the list of wallpapers. Oh, and it does not work as a Startup Application. While trying to find out why, it turned out it uses mono (.NET for Linux). So everything is forgiven. I’m sure it’s the wallpaper changer of choice of Miguel de Icaza.

On the other hand, I’m a picky little bastard. I just want to pile the wallpapers-to-be into a folder, specify a cycle time, and go. And I want it to work. And I want it to be small. So I wrote one. Apart from comments and the help text, it’s a 12 line shell script. It supports Gnome2 and MATE at the moment.

Default cycle time is 10 min and the default folder is ~/Pictures. It can be changed in the ~/.tapeta configuration file.

notgmail

Or rather yes. I mean it’s all about Gmail new email desktop notifications for Gnome2 and MATE. Mostly for mutt users. It looks for your Gmail login in .netrc and .muttrc. It’s a staggeringly large 18 line net shell script. The semi-transparent black notification-box lists the senders of your unread mails. The default polling time is 30min, can be changed on the command line in [s].

And it does use DOM to parse the Gmail Atom feed. Not.

Categories: Uncategorized Tags: