New toy.

Posting from my lovely new HTC Desire. Had it a day so far and am very impressed, especially with the virtual keyboard. I thought I might have trouble with it but I can type much faster on this than I could with the T9 ones on my old cheap phones.

I’m learning to trust the autocorrect more too, which speeds things up considerably.

Sod the iPad, I love my Android. (Amazed that it just auto capitalized iPad for me).

Backporting new code to Debian packages

I like Linux distros packaging systems, especially Debian’s. It makes it trivial to install, remove and change to different versions of programs. The only problem is that sometimes there is a delay in packaging the latest version of an app.

Never fear though, if you are willing to do a little bit of work you can shoehorn the latest code into a package yourself without needing any special knowledge of how to create packages. Note this will only work with programs that already have been packaged since it re-uses the old packaging info with the new code.

I refer to Debian, but the exact same procedure will work on any deb based distro, such as Ubuntu.

Before starting make sure you have the devscripts and build-essential packages installed. These will install all the tools needed to build debian packages.

First download the source package of the old version.

apt-get source $NAME

Then, as a sanity check cd into the created directory and run

debuild -i -us -uc

This will probably complain about missing packages needed for building, so go ahead and install them with apt-get or aptitude or whatever. Then re-run the build command. Assuming that works you should end up with some .deb files in the parent dir.

Now grab the code for the latest version from its website. If it is not already in a tarball you’ll want to make one from it with

tar czf application_version-1.orig.tar.gz applicationdir

If it is a tarball already then just rename it to match the formatting application_version-1.orig.tar.gz. For example when backporting mesa I name the tarball mesa_7.7.0-1.orig.tar.gz.

Next copy the debian dir from the old application directory to the new one.

cp -a application-debianversion/debian application-newversion/

Then cd into the new directory and run

debchange -v version-1 "Updated code to latest version"

It is vital that the version number used in this command matches the naming of the .orig.tar.gz file you created earlier. For example for mesa I use 7.7.0-1. This is the magic that will make everything work.

The final step is to build the new package.

debuild -i -us -uc

and tada! With a bit of luck your shiny new version should be packaged up and ready to be installed.

Firefox 3.5 startup problem (solved)

Firefox[1] 3.5 has been out for a while now, but I’ve only recently managed to switch due to the program not starting up unless I use a weird command line hack.

By using the strace command I found it was hanging on a futex call, starting in safe-mode and even deleting .mozilla didn’t fix it. I found a forum thread on the mozilla forum that shows I’m not the only one to come across this. There was a fix described in a post linked from there, but it only worked by editing the launch command, and I’m not prepared to dig through the OS and replace every instance of the launcher to make it work.

Yesterday though I found the real culprit, it was padsp! A long time ago I had set Firefox to use padsp in order to get flash sound to work correctly with pulseaudio. I had totally forgotten I had done this, because I had made the change in /etc not in my home folder.

So if you find Firefox 3.5 won’t start on linux even though 3.0 works fine then check if you have a FIREFOX_DSP (or ICEWEASEL_DSP if on Debian) set somewhere. For me the fix was this:

In file /etc/iceweasel/iceweaselrc:

# which /dev/dsp wrapper to use
ICEWEASEL_DSP="padsp"

See the ICEWEASEL_DSP line, delete it or comment it out and Iceweasel starts working. If you are using vanilla Firefox then obviously replace every instance of the word iceweasel with firefox to implement the fix on your system.

Hope this helps someone. Oh and flash now works fine with pulseaudio without the padsp thing too.

[1] I’m actually using Iceweasel but it is Firefox in all but name so I’ll call it that here

Control your Music player via bluetooth

I don’t need no steenking iphone with its fancy apps. I have a fairly low end phone, a Motorola RIZR Z3 but it can run Java J2ME apps. The other day I found an awesome one that lets me control my music player MPD via bluetooth, with a nice little GUI and everything (it also apparently works for XMMS and Winamp).

I was going to twitter about it, but it is so frickin awesome that it deserves more than 140 characters about it. The app is called JAM SE and it looks like it will run on just about any phone that supports J2ME and has bluetooth.

There is a Debian package for the computer-side which makes installing on Debian/Ubuntu a doddle. For others you can grab the program from its own site Bemused-MPD bridge.

With a little bit of extra work I can even get it to control the other music playing computers in the house (all running MPD), mpdproxy on the laptop with the bluetooth connection will redirect all MPD clients to my currently active server.

It is so cool to be able to control my music playback from anywhere in the house just by whipping out my phone, geektastic. :-)

My top 10 WordPress plugins

The following are a list of plugins I either use, have used or plan to use in the future to improve this blog.

In no particular order:

  1. Contact Form 7 – Just another contact form plugin. Simple but flexible. By Takayuki Miyoshi.

    Putting your email address on the web these days is just an invitation to be spammed to death, but it is nice for your readers to be able to contact you privately. This is a nice contact form for that purpose.

  2. Dean’s Code Highlighter – This plugin using Geshi to highlight source code in your posts. . By Dean Lee.

    If you ever put up source code snippets in your blog entries, it is far nicer to have the syntax highlighted as it is in a modern editor or IDE. This plugin provides that.

  3. del.icio.us for WordPress – Displays your recently listened links. Based on Pownce for WordPress by Cavemonkey50. By Ricardo González.

    Does exactly what it says on the tin.

  4. Google XML Sitemaps – This plugin will generate a sitemaps.org compatible sitemap of your WordPress blog which is supported by Ask.com, Google, MSN Search and YAHOO. By Arne Brachhold.

    Improve your search rankings by giving the search engines more information about your site, totally automatically.

  5. Sociable – Automatically add links on your posts, pages and RSS feed to your favorite social bookmarking sites. By Joost de Valk.

    Want to make it easy for readers to link your site into various social bookmarking sites. This plugin covers pretty much all of them, including some that no longer exist. :-)

  6. Twitter Tools – A complete integration between your WordPress blog and Twitter. Bring your tweets into your blog and pass your blog posts to Twitter. By Alex King.

    The plugin you need if you want twitter in your blog or vice-versa.

  7. WP Super Cache – Very fast caching plugin for WordPress. By Donncha O Caoimh.

    An essential plugin you need if your site is to have any hope of surviving a slashdotting, or even if you just want to improve performance for the ten people who visit your blog.

  8. Bad Behavior – Deny automated spambots access to your PHP-based Web site. By Michael Hampton.

    Prevent 90% of the spambots out there from even attempting to post comment spam.

  9. OpenID – Allows the use of OpenID for account registration, authentication, and commenting. Also includes an OpenID provider which can turn WordPress author URLs into OpenIDs. By DiSo Development Team.

    OpenID is what I hope will become the standard for online authentication, every site should support it.

  10. Who Sees Ads – An advanced ad management plugin that lets you decide who will see your ads, depending on user defined conditions. By Ozh.

    Want to place ads on your site but don’t want to bother your regulars (who will likely never click on them anyway), then give this plugin a try and set it to only show ads to visitors who came to your site from a search engine.

Hope these are useful. If you use some wonderful plugin I haven’t mentioned then please tell me. Adding more and more plugins until something breaks is what I do. :-)