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

February 1st, 2010 by matthew No comments »

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.

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

Speed up Firefox!

December 10th, 2009 by matthew 2 comments »

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!

» Read more: Speed up Firefox!

How to bounce an application with Applescript

November 29th, 2009 by matthew No comments »

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

» Read more: How to bounce an application with Applescript

Macports fails to compile p5-perlmagick

November 29th, 2009 by matthew No comments »

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.

» Read more: Macports fails to compile p5-perlmagick

How to fix your ubuntu 9.10 console

November 28th, 2009 by matthew No comments »

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.

If you upgraded to Karmic

You’ll have grub 1 (legacy). To fix it, follow this thread, and edit /boot/grub/menu.lst. Look for the line that starts with “defoptions” — uncomment the line and add “vga=791″ (or 789 for lower resolution):

## additional options to use with the default boot option, but not with the
## alternatives
## e.g. defoptions=vga=791 resume=/dev/hda5
# defoptions=quiet splash
defoptions=vga=791

Save the file and then reboot.

If you installed Karmic directly

You’ll be running grub 2, which requires these instructions. I’ve reformatted them here for posterity:

Step one: In /etc/default/grub, add this line:

set gfxmode=1024x768

Step two: In /etc/grub.d/00_header, add the highlighted line:

if loadfont `make_system_path_relative_to_its_root ${GRUB_FONT_PATH}` ; then
  set gfxmode=${GRUB_GFXMODE}
  set gfxpayload=keep
  insmod gfxterm

Step three: Run update-grub, and reboot.

Download Xcode 3.1.4 for Leopard

November 28th, 2009 by matthew 1 comment »

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 GIF from a servlet

November 24th, 2009 by matthew 2 comments »

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:"#000000ff" 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 = "R0lGODlhAQABAPAAAAAAAAAAACH5BAAAAAAALAAAAAABAAEAAAICRAEAOw==";
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

November 23rd, 2009 by matthew No comments »

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

» Read more: How to increase maven heapspace in hudson builds

OpenDNS updater for linux/ubuntu

November 15th, 2009 by matthew 2 comments »

The OpenDNS service is great — it provides anti-phishing and the ability to filter out some of the less desirable detritus from the internets.

OpenDNS needs to be periodically notified about what your IP address is, and I don’t have a windows or macintosh box that’s always on. I do have an ubuntu box, though, but there weren’t any instructions on OpenDNS’ site to do this properly.

» Read more: OpenDNS updater for linux/ubuntu

How to Convert Your Book’s Images to Kindle

November 7th, 2009 by matthew No comments »

Taking your painstakingly typeset book and shoving it through the kindle “conversion” meatgrinder was an exercise in wincing. Most of the images were corrupted, there was whitespace sprinkled randomly throughout the copy, and it was a general mess.

Kindle supports direct upload of an html version of your book, but there’s a lot of finessing you need to do before it all goes smoothly. One of the tasks you’ll need to do is convert your book’s images to greyscale, and reduce their size to something Kindle-friendly. There are free tools to help you do this if you aren’t afraid of the terminal.

» Read more: How to Convert Your Book’s Images to Kindle