[]RSS

About Archives Artwork Comic Contact Philosophy Projects Tags

Running Firefox2 on Ubuntu 8.04

[Comment]

July 13th, 2008 in Links

HOWTO run Firefox2 in Ubuntu 8.04. If you’re already running Firefox3, the Firefox-2 symlink will not start the right version of Firefox until you shut down FF3. Now I can test sites in FF2 again without booting my 2k VM.

Ubuntu 7.10 iPod touch/iPhone charging support

[Comment]

October 28th, 2007 in Links

I used to have to boot to my Windows partition regularly to charge my iPod touch, a feature that’s been added to Ubuntu 7.10. Now I only need to reboot if I need to resync it, which I do far less regularly. Yes, I’ll be buying a Mac this year1.

  1. which fixes the problem

Hack of the day: serial programming on Linux versus Windows

[Comment]

October 19th, 2007 in Programming

screenshotI borrowed a serial UPC scanner from work today for some Friday night hacking. It’s a ReaderWare LaserChamp/Flic Barcode reader re-branded under the SerialIO name. It came with a standard serial cable and didn’t have a manual.

First, I booted to my partition to see the raw data from the scanner.

$ cat /dev/ttyS0

No dice. I did some searching and found that the scanner likely ran at 4800 baud.

$ setserial /dev/ttyS0 baud_base 4800
$ cat /dev/ttyS0

^B043396143234

Ah, some data. I removed the control characters and had myself a UPC symbol. I wrote a script and scanned a bunch of books, CDs, and other crap sitting on my desk. I also found a manual for the scanner, which had some settings symbols1.

I booted to my XP partition and started . I wrote a Perl script to mimic what I did on Linux, except using the Win32::Serial module. I fired up CPAN to grab the library, but CPAN was down. I switched to ActiveState’s Perl distribution and grabbed their Win32:: PPM. I finished the script and tested it. It worked.

A while later I checked CPAN again, grabbing the Win32:: module using Cygwin’s Perl. It didn’t build. This seems typical for Cygwin and CPAN/Perl modules2. I moved on.

I switched to C# to see how it compared to Perl and the Linux/Bash hack. I whipped together a simple application3 that listened for data on a serial port, cleaned it up, and copied it to the clipboard. It worked4.

I also attempted to hook the C# code up to the Amazon API (to get ASINs), but found the networking libraries more complicated than I had time for5.

My favorite approach? Hands down, I liked the Bash script6 best. It was one line of code, including cleaning it up with sed. It’s not something I can ship, but it’s the way I’ll scan all of my books/CDs/DVDs.

The Perl Win32::Serial hack was longer (a dozen lines), but it also worked. It was no better than the 1-line Bash script, so I tossed it.

The C# hack consisted of a single form and its supporting class (a few dozen lines of code). It worked, and is easy to distribute. I’ll use this if I’m stuck doing something in Windows.

Total time for all 3 hacks? 3 hours and 25 minutes7.

  1. You print the page and scan the symbols to change the scanner’s settings
  2. Most of the tests failed for the Win32::Serial module
  3. And the .NET build of it
  4. C#’s serial code was nicer than Perl’s, but not as nice as the devfs hack
  5. Perl’s networking is much nicer than C#’s
  6. Bash and devfs’s /dev/ttyS0
  7. My wife and kids were out for the evening

Sources.list generator for Ubuntu

[Comment]

September 16th, 2007 in Links

Here’s a handy sources.list generator for Ubuntu, which includes a number of bleeding edge software sources.

Time your boot

[Comment]

July 15th, 2007 in Links

A Ubuntu tool for generating boot timing charts.

Ubuntu/debian compiler meta package

[Comment]

June 4th, 2007 in Micro Blog

Ever wonder how to get the important C/C++ compiler bits installed quickly on Ubuntu/Debian? There’s a meta package for it:

sudo apt-get install build-essential

Meta packages wrap an important set of related packages, and should normally be used instead of picking packages by hand.

Democracy for Ubuntu

[Comment]

February 14th, 2007 in Links

Democracy TV’s Ubuntu repository. Democracy is a cross platform internet-abled video player.

HOWTO: fix “Error activating XKB configuration.”

[Comment]

February 10th, 2007 in Links

Here are a few possible fixes for the “Error activating XKB configuration” popup that appears after updating from Ubuntu 6.06 to 6.10.

Running existing Windows installs in VMWare Player

[Comment]

February 7th, 2007 in Links

HOWTO: run your existing Windows installation in VMWare Player.

Install ROR on Ubuntu

[Comment]

January 2nd, 2007 in Links

Installing Ruby + Rails on Dapper and Edgy. I was missing bits using just the obvious packages.

Next page [>>]