Technical HOWTOs

HOWTO install etherpad on ubuntu 9.10

Etherpad was opensourced by google, and has some generic installation instructions. Here’s the translation for Ubuntu Karmic Koala (release 9.10):

More >

Simple spring integration testing

Spring has had a really nice unit test framework available for a while now, but the documentation can be a bit daunting. Here’s a super-simple example of adding dependency injection to an integration test:

More >

How to fix the wifi on a HP Mini 110 Netbook running Ubuntu 9.10 (Karmic Koala)

Installing Karmic Koala from a USB drive proved to be a bit less than effortless. First off the http and ftp servers for the netbook-reloaded ISO images were really slow, and for some odd reason there aren’t any bittorrent links for the netbook-reloaded image. You need to go to http://releases.ubuntu.com/9.10/ to find the .torrent link (which is here).

The installation instructions need some editing, too, but the jist is if you’ve got a linux box, use usb-creator — and don’t panic when the usb-creator main window disappears (and doesn’t get replaced with a progress window for several minutes).

So the main glitch was wireless — it didn’t work out of the box on my HP 110 netbook.

More >

Speed up Firefox!

My Firefox on Mac was getting pretty lethargic — almost a minute to spin up, and multiple seconds to just open a new tab. I installed the new beta of Google Chrome, and remembered how nice a speedy browser was.

Google Chrome for Mac is a nice first effort, but without custom search engines, and all the other firefox add-ons, the shininess gets pretty tarnished. I needed my fast firefox back!

I made just a couple changes, though, and my Firefox is back to it’s prior speedy self!

More >

How to bounce an application with Applescript

Say, for whatever reason, you want to bounce iphoto once an hour. You can do that with AppleScript and cron.

More >

Macports fails to compile p5-perlmagick

If you need PerlMagick on a Mac, there was (and still is) a p5-perlmagick package. If you try to install that package now, you’ll find it doesn’t compile (!!). You don’t have to resort to compiling from source, though.

More >

How to fix your ubuntu 9.10 console

After upgrading my server (that isn’t running X) to Ubuntu 9.10 (Karmic Koala), I found that the console on my LCD monitor was cropping out several characters from the left and right sides. It wasn’t hard to fix, though, given the magick incantations:

More >

Download Xcode 3.1.4 for Leopard

Apple’s developer website only links to the latest version of Xcode, which requires Snow Leopard (Mac OS X 10.6).

If you’re still running Leopard (10.5), you need to go to this alternative developer website:

http://connect.apple.com/

Log in with your ADC credentials, click “Downloads”, then click “Developer Tools” in the right sidebar, and then search the page for “3.1.4″. You might also want to check the wikipedia list of xcode versions to see if 3.1.4 is still the latest version.

(reference)

How to serve a transparent 1×1 pixel GIF from a servlet

The first issue was how to build the smallest possible byte array that represents a 1×1 GIF. Using ImageMagick piped to base64 made it easy to embed into java code:

convert -size 1x1 xc:transparent gif:- | base64

At servlet load time, un-base64 the gif back into the byte array:

import org.apache.commons.codec.binary.Base64;
...
private static final String PIXEL_B64 = "R0lGODlhAQABAPAAAAAAAAAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==";
private static final byte[] PIXEL_BYTES = Base64.decode(PIXEL_B64.getBytes());

in your handle method, then write those bytes to the output stream:

httpServletResponse.setContentType("image/gif");
httpServletResponse.getOutputStream().write(PIXEL_BYTES);

How to increase maven heapspace in hudson builds

If your maven-built project fails in hudson (especially when you’re using the assembly plugin) and it isn’t a compile or test failure, check the console output. If it says “java.lang.OutOfMemoryError: Java heap space”, you need to configure your hudson job to add heap space to the maven process.

  1. Navigate to your hudson job,
  2. click Configure,
  3. scroll down to the Build section, and
  4. click the Advanced button.
  5. Enter this into MAVEN_OPTS: -Xmx512m -XX:MaxPermSize=128m

More >