Gtkpod in Gutsy Got You Groaning?

Posted by sjs
on Monday, October 29

I recently upgraded the Ubuntu installation on my workstation from Feisty Fawn to Gutsy Gibbon and for the most part I am happy with the changes. One thing I don’t care much for is the fact that gtkpod-aac is a sham. Ubuntu provides the gtkpod-aac package for one to transfer aac files, and thus mp4 files with aac audio tracks, to their iPod. The version in the Gutsy repos is broken. This shows a weakness in Ubuntu, and though it’s rather small it is one that will piss off a lot of people who expect things to just work. The kind of people who would buy an iPod. The kind of people who use Linux. The kind of Linux users that use Ubuntu. The kicker is that it doesn’t look like they will ship a working version of gtkpod-aac for Gutsy at all. I know it’s only 6 months but that seems like an eternity when you have the same old crap to watch on your iPod for that long.

All is not lost. A kind soul left a helpful comment on the bug report explaining how he got it to work. It’s a pretty simple fix. Just google for libmpeg4ip and find a Debian repo that has the following packages for your architecture:

  • libmpeg4ip-0
  • libmpeg4ip-dev
  • libmp4v2-0
  • libmp4v2-dev

Download those 4 .deb files and install them. You can ignore any advise to use an older version in the official repo. Once you have those installed, download and build the latest version of gtkpod from their Subversion repo.

Now that you know what to do I’ll give you what you probably wanted at the beginning. As long as you have wget, subversion, and use a Bourne-like shell this should work for you.

gtkpod-aac-fix.sh

1
2
3
4
5
6
7
8
9
10
11
12
mkdir /tmp/gtkpod-fix
cd /tmp/gtkpod-fix
wget http://ftp.uni-kl.de/debian-multimedia/pool/main/libm/libmpeg4ip/libmp4v2-0_1.5.0.1-0.3_amd64.deb
wget http://ftp.uni-kl.de/debian-multimedia/pool/main/libm/libmpeg4ip/libmp4v2-dev_1.5.0.1-0.3_amd64.deb
wget http://ftp.uni-kl.de/debian-multimedia/pool/main/libm/libmpeg4ip/libmpeg4ip-0_1.5.0.1-0.3_amd64.deb
wget http://ftp.uni-kl.de/debian-multimedia/pool/main/libm/libmpeg4ip/libmpeg4ip-dev_1.5.0.1-0.3_amd64.deb
for f in *.deb; do sudo gdebi -n "$f"; done
svn co https://gtkpod.svn.sourceforge.net/svnroot/gtkpod/gtkpod/trunk gtkpod
cd gtkpod
./autogen.sh --with-mp4v2 && make && sudo make install
cd
rm -rf /tmp/gtkpod-fix

Controlling volume via the keyboard on Linux

Posted by sjs
on Saturday, June 30

I was using Amarok’s global keyboard shortcuts to control the volume of my music via the keyboard but I wanted to control the system volume as well. A quick script later and now I can control both, and thanks to libnotify I get some feedback on what happened. It’s not as pretty as OS X’s volume control or Growl but it’ll certainly do.

↓ Download volume.rb

I save this as ~/bin/volume and call it thusly: volume + and volume -. I bind Alt-+ and Alt—to those in my fluxbox config. If you don’t have a preferred key binding program I recommend trying xbindkeys. apt-get install, emerge, paludis -i, or rpm -i as needed.

Back on Gentoo, trying new things 0

Posted by sjs
on Tuesday, June 19

I started using my Gentoo box for development again and there are a few things about Linux I didn’t realize I had been missing.

Shell completion is awesome out of the box

zsh has an impressive completion system but I just don’t feel the urge to ever customize it extensively. I just use the basic completion stuff on OS X because it’s easy. On Gentoo I have rake tasks and all sorts of other crap completed for me by including a few lines in my .zshrc (iirc a script does this automatically anyway). Generally Linux distros try to knit everything together nicely so you never even think about things like whether or not a package will have readline support, and default configs will be tweaked and enhanced beyond the official zsh package.

Linux is stable. Really stable.

While people bash Microsoft daily for tying the GUI layer to the kernel, Apple seems to get away with it scot-free. I don’t know if it’s caused by my external display hooked up to the dock, or the Prolific Firewire chip in my external disk enclosure but something causes the mysterious “music plays till the end of the song, mouse can be moved, but nothing works” bug now and then and all I can do is a hard reset.

On Linux I currently use Fluxbox so everything is rock solid and fast (except Firefox! ;-), but in the extremely rare event that shit does hit the fan usually only a single app will crash, though sometimes X (and hence many others) go with it. A sudo /etc/init.d/gdm restart fixes that. The only times I’ve had to hard reset Linux was because of a random bug (strangely similar to my MacBook bug) with Nvidia’s driver with dual head setups. All this is pretty moot since Linux is generally just stable.

Those are 2 relatively small things but the added comfort they provide is very nice.

In the spirit of switching things up I’m going to forgo my usual routine of using gvim on Linux and try out emacs. I’ve been frustrated with vim’s lack of a decent file browser and I’ve never much liked the tree plugin. Vim is a fantastic editor when it comes to navigating, slicing, and dicing text. After that it sort of falls flat though. After getting hooked on TextMate I have come to love integration with all sorts of external apps such as Subversion, rake, and the shell because it makes my work easier. Emacs seems to embrace that sort of philosophy and I’m more impressed with the efforts to integrate Rails development into Emacs than vim. I’m typing this post using the Textile mode for Emacs and the markup is rendered giving me a live preview of my post. It’s not WYSIWYG like Typo’s preview but it’s still pretty damn cool. I think can get used to emacs.

I’m just waiting for a bunch of crap to compile – because I use Gentoo – and soon I’ll have a Gtk-enabled Emacs to work in. If I can paste to and from Firefox then I’ll be happy. I’ll have to open this in vim or gedit to paste it into Firefox, funny!

I’m also going to try replacing a couple of desktop apps with web alternatives. I’m starting with 2 no-brainers: mail and feeds with Gmail and Google Reader. I never got into the Gmail craze and never really even used Gmail very much. After looking at the shortcuts I think I can get used to it. Seeing j/k for up/down is always nice. Thunderbird is ok but there isn’t a mail client on Linux that I really like, except mutt. That played a part in my Gmail choice. I hadn’t used G-Reader before either and it seems alright, but it’ll be hard to beat NetNewsWire.

Quickly inserting millions of rows with MySQL/InnoDB 0

Posted by sjs
on Thursday, April 26

A project I’m working on has datasets with millions of rows. Several times per week several million new rows are added. The rows are added all at once, not accumulated over a period of use. Inserts need to be fast.

I won’t go over why I chose InnoDB over MyISAM apart from saying that data is important. MyISAM is the faster of the two with default settings, but InnoDB required some tweaking for me to see similar performance. For my application the performance I achieved is adequate.

A triple-booting, schizophrenic MacBook 0

Posted by sjs
on Thursday, April 05

From The Challenges of Integrating the Unix and Mac OS Environments (the emphasis is my own):

Unix derivatives such as Sun’s Solaris, Cal’s BSD Unix, and later Linux have grown to serve key roles as network servers. DOS was eventually replaced by Windows, which sports some of the user interface features pioneered by Mac OS such as the desktop, as well as some of the underlying ideas behind Unix such as preemptive multitasking. While Unix systems remain in the lead for reliability and scalability, and Mac OS continues to push user interface innovation forward, Windows has successfully narrowed the gap in both areas.

That last bit highlights exactly what I find so great about OS X. I love the power of Linux but the UI is lacking (uniformity of keyboard shortcuts, X is still antiquated1 despite X.org’s fantastic efforts to bring it up to speed). I have the best, and worst, of all worlds now though.

Why triple-boot when I already have Parallels desktop? I wanted to try out Vista on the only machine I have capable of running Aero. I need IE7 regardless so I figured why not. I can’t form a fair opinion of Vista without seeing it on real hardware either and family members have been asking me about it.

I run Windows XP (stripped with nLite) in Parallels on my MacBook which is great for IE6. I had Windows XP installed with BootCamp as well and used that same installation with Parallels Desktop, but it was somewhat slow so I decided to change things up. I wanted to try out Vista, install a fresh copy of OS X, and just for the hell of it throw a penguin into the mix as well…

Ubuntu: Linux for Linux users please 0

Posted by sjs
on Thursday, July 13

Ubuntu is a fine Linux distro, which is why it’s popular. I still use Gentoo on my servers but Ubuntu is fast to set up for a desktop. Linux for humans it certainly is, but dammit sometimes I want Linux like I’m used to.

It should ship with build-essentials (gcc & others) installed. It shouldn’t ask me if I’m sure I want to restart at the GDM login screen. I have no session open and already clicked twice to choose Restart.

Other things aren’t quite ready for humans yet. Network config needs some work. It’s very slow to apply changes. Connecting to Windows printers should be easier (ie. let us browse to find them, or just search and present a list). Fonts aren’t amazing yet, though Mac OS X has spoiled me as far as fonts are concerned.

Other than these things I think Ubuntu Dapper is a fine release. It installed on my work laptop without a problem and detected the volume keys and wireless network card flawlessly.

WikipediaFS on Linux, in Python 0

Posted by sjs
on Sunday, May 07

Till now I’ve been using my own version of pywikipedia for scripting MediaWiki, and it works well. But I read about WikipediaFS and had to check it out. It’s a user space filesystem for Linux that’s built using the Python bindings for FUSE. What it does is mounts a filesystem that represents your wiki, with articles as text files. You can use them just like any other files with mv, cp, ls, vim, and so on.

There hasen’t been any action on that project for 13 months though, and it doesn’t work on my wiki (MediaWiki 1.4.15) so I’m going to try and make it work after I upgrade to MediaWiki 1.6.3 tonight. This will be pretty cool when it works. I haven’t looked at the code yet but it’s only 650 lines.