Retiring Another Site

After much consideration, I’ve decided to retire yet another website: Colddirt. This site was created as an example of how to use the different parts of Django, mostly in just one afternoon. I’ve decided it is time to just take a few screenshots and retire the site - the domain is expiring, and honestly, I don’t want to spend $10 to renew the domain. So, here are the screenshots.

RIP Old Sites

Over the years I’ve created several websites, some with the hope of becoming big and popular. Naturally, I’m still waiting to create a site that becomes big and popular. In the meantime, it seems appropriate to retire some of the older sites and ideas. The truth is, I’m moving all my little sites from MySQL on a mediocre VPS to Postgresql on EC2.

Because I put some sweat and blood into these sites, I thought it would be only appropriate to record how the sites looked for future sentimental value. I downloaded a small plug-in for Firefox to take full-length pictures, and I thus post them here.

Back in Taiwan I created a site to demo blogs. The idea certainly wasn’t revolutionary, but I thought that somebody would find it useful. Nope.

The second idea was to send a bunch of little ducks around the world and track their progress. My friend Jamie took one to Europe, but besides that, I don’t think most people really understood that they were supposed to hand the duck off to somebody else. I’ll re-brand and launch it again if I can find a little twitter logo to send around, because hopefully people on twitter will understand to pass the duck onwards.

So photos for nostalgic sake.

It is always a bit rough retiring old sites, but looking back I learned a little, had some hope, and that’s all I can ask for.

Fun with OSM

I have to admit, to me, editing OpenStreetMap is actually a little therapeutic. Sort of like gardening.

My first major contribution was when I brought my little QStarz GPS unit across Indonesia, by train, sitting against the window.

The most recent contribution was our trip to Dubbo, where I helped fill in a few missing roads, and added an initial outlay of Dubbo Zoo.

If you have a GPS or have $60 to spend on one, and like anything CAD-drawing like, give editing OSM a try!

French Word Collage

For the last year YS and I have been studying French once a week (4.5hr on Saturday!) A few months ago I wrote some Python code to read the RSS feeds of the most popular French newspaper site, and then kept track of the count of each word. I repeated this every week for a few months.
In the end I had a database of the top ~3000 words used on the site. Today I decided I wanted to play with Processing, so created this little word collage. It is 1680x1050, my monitor’s resolution. Two thumbs up for Processing!

Testing SMS Gateways

For one of my projects I’m testing an SMS gateway, and decided it would be fun to build a useful alarm clock out of it. For those of you who know Python, you may find this funny. /dev/ttyUSB0 is my Arduino with a temperature sensor.

import serial
import urllib2
 
def check_temp():
    ser = serial.Serial('/dev/ttyUSB0', 9600)
    t = ser.readline().strip()
    return float(t)
 
    t = check_temp()
    if int(t) < 8:
        message = "It+is+now+%f+degrees;+chuck+a+sicky." % t
        f = urllib2.urlopen('http://api.clickatell.com/http/sendmsg?user=johnd&password=p@55w0rd&api_id=2132867&from=61433735555&to=61433735555&text=%s' % message)

```bash

And in crontab:

```bash
45 6 * * * python /opt/scripts/temp_alarm.py

Arduino 101

Tonight, I’m proud to say, I’ve returned to childhood. Let me explain.

OK, fun over, back to work.

For the last year I’ve been wanting to purchase an Arduino, for no other reason than to play with. Like a kid. My Arduino arrived two days ago. This is a story of problems, but not the pull-your-hair-out type, more the… like when you run out of gas in the middle of Sydney. Going to your Christmas dinner. In your friend’s car. Long story.

As a kid I never really learned about electronics. I took apart anything broken my parents set downstairs (and put back together the microwave I dismantled that my parent were going to give to my sister as a gift). But no electronics. I had a computer of some sort from when I was a wee kid, but not a single electronics kit, or not one I can remember.

I soon realised I forgot to order a few resistors needed for the various sensors I purchased. This morning before work I stopped by the local electronics store, and like a kid in a candy shop, ordered $1.60 worth of resistors and LEDs.

Just after coming home and eating insanely good Indian with YS, I set out to get an LED blinking. Without too many troubles, success! I graduated myself to the next grade and pulled out the temperature sensor. I looked at the ‘special’ wires I bought to connect to the sensor and the breadboard, and I soon realised I actually purchased the M->F wires instead of the assorted pack. I started looking around for cables I could cut.

Spare USB cable, no. Telephone cable, maybe. I realised I could just slice up one of the cables and see if it worked. The cables were braided instead of solid coper, which sort of made my hopes sink, but it was too late now.

I soon wired everything together as the various forum posts suggest, plugged it in to my laptop, started the Arduino software, and loaded the Dallas Temperature Library, and - “Invalid CRC”. I pulled the wires off, stripped a little more cabling off, plugged it back in, and tried again. It worked! I don’t really know if the temperature is correct or not - we don’t have any other way to measure it - but at this point, until I put in some more robust wires, I don’t really even care.

Overall, I’m happy. I’ve created two simple physical computing missions, and wrote two blog entries, in well under two hours. This has been quite a relaxing break from the other duties in life. I plan to make the little system ‘proper’ (more robust), and link it to my mini server. I’ll then create a simple chart (via Google’s API) to display on this website.
OK, fun over, back to work.

GPS Gem Find - TangoGPS

I’ve been looking for a simple, no-hassles GPS display program for Linux, and I believe I finally found one: TangoGPS. My requirements were quite simple; I needed something that would talk to gpsd, and display a dot on OpenStreetMaps. I’ve been able to do this in other programs (even in 3d in WorldWind), but I wanted something to download the maps for me, and GTK+ would be a plus.

TangoGPS was easy to install (apt-get install tangogps), and on my test ‘drive’ home tonight on the train, worked a treat. See related screenshots.

Downloading VMWare with Firefox

I’ve had this issue happen to me several times, and I’m finally writing myself a note to fix it in the future. There seems to be an issue with downloading VMWare Workstation (.bundle). I first tried it with Firefox, but it just died at loading it into /tmp. Next, I tried it with Lynx, but alas, it tried to download it as a text file.

Ahah! The quickest solution I could find is to right click the link, save as, and save it as a zip. Rename it to .bundle when you’re done.

Compiling kernel for Vortex86dx

Update: I’ve written up a short tutorial on the method I used to install Debian 5.0 on this device.

A few months ago I purchased the eBox-3300 from WDL Systems. The system was promptly shipped, and there were no “gotchas” from WDL. The little box fit my exact needs - it is small, and built very, very well. I flew back to Australia and, after some trial and error, installed Debian 5.0 on it. For quite some time I was just using the vmlinuz file provided by WDL, which was provided by ICOP (DMP). This worked well, but there were two issues:

  1. I couldn’t load any modules (e.g. NFS).
  2. I received an annoying email from OSSEC every few hours telling me it couldn’t find modules.dep.

At the end of last week I finally decided to do something about it, and considering this little box is “x86 compliant”, I figured it wouldn’t be too hard to create a new package. It has been several years since I last created a self-compiled Debian-packaged kernel, so I decided to document the process for the next time I do it. These steps are really just a summary - but if you have much Linux experience, they should be enough to guide you. If I’m unclear, just send me an email.

Because the eBox-3300 is embedded, I logically decided to create the package on another system. However, I wanted to maximize the chances of it working, so I installed Debian 5.0 in VirtualBox, updated it, and proceeded.

As a prep, you may need to install ncurses-dev and kernel-package in your build environment.

apt-get install ncurses-dev kernel-package
  1. Download latest kernel from: http://www.kernel.org/pub/linux/kernel/v2.6/
  2. Download the DMP provided patch/config file for 2.6.27.3, copy it to /usr/src. Alternatively, you can borrow my 2.6.29.3 config Make a backup.
  3. Untar kernel, cd into the kernel directory. Issue:
make menuconfig
  1. Configure kernel. If you used my config file, a lot of these should already be ticked.
  • Load alternative config file, I selected mine as /usr/src/config-2.6.27.9-vortex86dx, or if you downloaded the one from me, use config-2.6.29.3-vortex86dx
  • Enable generic x86 support
  • Enable Kernel .config support
  • Device drivers -> Network -> 10 or 100Mbit -> RDC R6040, set at built in
  • Turn off generic IDE support
  • Exit, make sure to save the kernel
  • Verify .config exists. If it doesn’t, copy the config-2.6.x.x-vortex86dx file to .config
  1. Create the kernel debs. In the kernel directory, issue these commands. This will build the kernel image, the headers, and the modules.
make-kpkg --initrd kernel_image kernel_source kernel_headers modules_image
  1. Make coffee
  2. Copy the debs to your running ebox by sftp (or usb, or whatever is available)
  3. Install kernel in eBox-3300
dpkg -i linux-source-2.6.29.3-vortex86dx.deb
dpkg -i linux-headers-2.6.29.3-vortex86dx.deb
dpkg -i linux-image-2.6.29.3-vortex86dx.deb
  1. Reboot. If you want my compiled kernel/sources/header .DEBs, just shoot me an email and I’ll make them available.

Summary: My only gripe about this little box was the lack of an easily customizable kernel, but no more. I’m still very happy with this $150 purchase.

Fixing mysql warning message

After restoring databases from one server to another I sometimes get this error on Ubuntu or Debian:

error: 'Access denied for user 'debian-sys-maint'@'localhost' (using password: YES)'

This makes a lot of sense, and the solution is pretty simple. If you look in:

cat /etc/mysql/debian.cnf

You’ll see the defaults for your system. Copy the password listed there, and open a connection to MySQL as root (or some other user). Next, enter this (lets say your password specified in debian.cnf was ‘abracadabra’:

mysql> select PASSWORD('abracadabra');
+-------------------------------------------+
| PASSWORD('abracadabra')                   |
+-------------------------------------------+
| *38794E19D534EBA4F0F78903FA00F1DA2989DCA2 | 
+-------------------------------------------+
1 row in set (0.00 sec)

Next, since we already have the prompt open, do this command:

mysql> USE mysql;
mysql> UPDATE user SET password='*38794E19D534EBA4F0F78903FA00F1DA2989DCA2' where user='debian-sys-maint';
mysql> FLUSH privileges;

Restart MySQL, and the error should have gone away.