Tue Apr 28 10:23:05 UTC 2009

Regular Expresions ... ISO dates

I've been doing some data validation recently, and this afternoon wanted to get a decent date field set up. I like ISO 8601 dates, they sort well in most default locales, and for the application in question I've gone for YYYY-MM-DD as the template.

This is trivially easy to detect as distinct from plain text, with

    \d{4}-\d{2}-\d{2}

but of course this does not do any validation of the content i.e. 9999−99-99 is seen as correct.

It's easy to improve on this expression to match the range of numbers for months 01 to 12 ⇒

    (0[1-9]|1[012])

, but actually making it correct is much harder. We need to know which months have only 30 days as a maximum, and to be able to detect leap-years that permit February to get to 29 days.

I had a quick google around – there are quite a few regexp cargo cult code libraries around the place, many don't match quite the same date format (yy/dd/mm is horrible), and most of they are simply not explained.

Then I found a nice article from Michael Ash (http://bit.ly/mashregex) that talked about ways to extend the simple versions, and explained the best bit, leap-year detection! I didn't need everything from his examples (I didn't want to make a leading zero optional, nor allow non-hyphen separators), and I only needed to validate from year 2000 to 2099, so I ended up with a much less complex expression.

The leap-year detection was easy enough, Michael had spotted a nice pattern that enumerates all the possible leap-years in a century (specifically, one where the initial year is also leap, which 2000 was) :-

00 04 08 12 16
20 24 28 32 36
40 44 48 52 56
60 64 68 72 76
80 84 88 92 96
This pattern reduces down to two parts –
    ([02468][048]|[13579][26])

The building blocks look like this :-

  • Which months have 31 days in them? January, March, May, July, August, October and December
    • So only these months can have “day 31” in any year
      • “all day 31”
    (0[13578]|1[02])-31
  • Which months have at least 30 days in them? Everything except February
    • So only 11 months can have “day 30” or “day 29” in any year (i.e. whether the year is leap or not)
      • “all days 29 or 30”
    (0[1,3-9]|1[012])-(30|29)
  • All months can have days 01 through to 28, in any year
    • “all days ≤ 28”
    (0[1-9]|1[012])-(0[1-9]|1[0-9]|2[0-8])
  • February can have “day 29” if we are in a leap year
    • “all Feb 29s”
    ([02468][048]|[13579][26])-02-29

Three of these four building blocks are valid for any year, and can therefore be grouped together. The pseudo-code looks like :-

  • starts with “20”
    • followed by leap-years, and is “Feb 29”
    • OR
    • followed by any two numbers (doesn't need to exclude leap-years)
      • is any day ≤ 28
      • OR
      • is any valid day 29 or 30
      • OR
      • is any valid day 31

And the final expression (tested with Visual REGEXP, which is already packaged for Ubuntu as visual-regexp) ..

20(([02468][048]|[13579][26])-02-29|\d\d-((0[1-9]|1[012])-(0[1-9]|1[0-9]|2[0-8])|(0[1,3-9]|1[012])-(30|29)|(0[13579]|1[02])-31))

Formatted for readability:

20
(
    ([02468][048]|[13579][26])-02-29
    |
    \d\d-
    (
        (0[1-9]|1[012])-(0[1-9]|1[0-9]|2[0-8])
        |
        (0[1,3-9]|1[012])-(30|29)
        |
        (0[13579]|1[02])-31
    )
)

Posted by Jim Cheetham | Permanent Link

Tue Feb 10 22:42:56 UTC 2009

/etc in Mercurial ...

I've long had /etc checked in to version control on my machines, especially where there are multiple administrators – it makes life easier, having visibility of configuration changes!

I've just set up a new server, and this time I'm trying Mercurial as the versioning system, for the simple reason that it keeps the repository data in a single directory (unlike subversion).

Starting with instructions at http://tinyurl.com/mikas-hg, I came up with this :-

  • Install the base OS
  • Do any update / upgrade to get yourself current
  • Install Mercurial
  • Decide on the list of files in /etc that should not be versioned
    • I tend to exclude things like SSL and SSH keys, as I often publish the repository later
  • Add and check in!
root@box:~# aptitude install mercurial
...
The following NEW packages will be installed:
  mercurial mercurial-common{a} python-beaker{a} python-sqlalchemy{a} rcs{a}
...

root@box:~# cd /etc
root@box:/etc# hg init
root@box:/etc# chmod 700 .hg

root@box:/etc# cat > .hgignore
(^)*.dpkg-new
(^)*.dpkg-old
(^)blkid.tab(|.old)
(^)mtab
(^)adjtime
(^)ssl/private/*
(^)ssh/ssh*key
(^)ld.so.cache
(^)passwd-
(^)group-
(^)shadow-
(^)gshadow-

root@box:/etc# hg add
adding .hgignore
adding ...

root@box:/etc# hg ci -m "Initial post-install checkin"
No username found, using 'root@box' instead

My next step is generally to install Trac (with the mercurial plugin), and then I have a great platform for multiple administrators to co-operate, track changes, keep notes and raise tickets on each other!


Posted by Jim Cheetham | Permanent Link

Tue Feb 10 21:19:47 UTC 2009

Nobuntu today ...

I'm not especially happy with Ubuntu today.

It's probably nothing serious, and I'm sure I could work around it if I needed to, but …

The Ubuntu 8.10 Server installer won't run from a USB disk, despite the best efforts of Unetbootin and other more manual hackery. So I have to burn a CD …

The installer won't recognise my atl1e NIC, although the base OS does. So I have to do all the network config afterwards by hand :-)

And worse than that, Xen dom0 support has been removed. So if I want Xen I'll have to step outside the repository support and do it myself …

I did briefly try Debian Lenny, but couldn't get the Xen kernel to load with GRUB – my kernel seems to be “too big” and the bootloader won't install without a “BIOS Boot Partition” … and I can't find any way of creating one of those! That seems to be one of the punishments for using LVM on top of RAID in my boot partition :-)


Posted by Jim Cheetham | Permanent Link

Sat Feb 7 09:46:05 UTC 2009

VMWare ESXi ... almost

I have a new lump of hardware on my desk, intended to be a household server. It's basically an Asus P5Q Pro motherboard, with a couple of SATA disks. With a few gig of RAM and a dual-core processor, it is intended to be a virtual machine server, running a firewall, MythTV/media archive, and some public sites.

VMWare ESXi was going to be the base OS; it's “free as in beer”, it's going to be used on some of the company systems I'm installing this year, it provides a nice and secure base OS and virtual networking that would make separation of different guests easy.

However, I didn't check the hardware compatability of ESXi before getting all enthuiastic. VMWare do use Linux under the hood, but I guess in the interests of reducing support issues, have only kept drivers for the most enterprise-class devices that they expect to see in the datacentre.

This means that although the P5Q has a supportable SATA device, by default ESXi doesn't recognise it. You have to hack both the ESXi installer, and the installed image to get it to work.

Also, ESXi does not recognise the onboard Atheros network interface, which means that it cannot be available for any of the guest machines. I would have to buy a supported NIC for my machine; that's basically an Intel one. It would have to be PCI-Express, as those are the only ports free. That puts the price up to around 40% of the entire of the rest of the server.

Sorry, ESXi 3.5. If you get wider hardware support, I may install you. Otherwise, it's off to Ubuntu and KVM …


Posted by Jim Cheetham | Permanent Link

Wed Jan 28 22:51:31 UTC 2009

A defence for S92 accusations/disconnections

Under NZ law (specifically, Section 92 of the Copyright Amendment Act), if your ISP receives multiple accusations that you have infringed copyright online, they will have to terminate your internet connection.

Or will they?

Now, this law (not all portions of which are actually in force today, but they will be soon barring a sudden change of heart by the Government) is widely regarded by the Internet industry as complete rubbish – technically unenforceable, morally wrong and even violation of human rights. Start reading at Creative Freedom NZ. But that doesn't stop it from being a law, does it?

Read the new juicy bits of law at http://www.legislation.govt.nz/act/public/2008⁄0027/latest/DLM1122643.html

An Internet service provider must adopt and reasonably implement a policy that provides for termination, in appropriate circumstances, of the account with that Internet service provider of a repeat infringer.

But what is an Internet service provider defined as?

http://www.legislation.govt.nz/act/public/1994⁄0143/latest/DLM345639.html#DLM1703710

Internet service provider means a person who does either or both of the following things: (a) offers the transmission, routing, or providing of connections for digital online communications, between or among points specified by a user, of material of the user's choosing: (b) hosts material on websites or other electronic retrieval systems that can be accessed by a user

Now here's the crux of my argument …

The person who is responsible for the account with “an ISP” (e.g. the person who pays the bill to connect their household computer to Xtra) is, under this Act, an ISP themself.

This is because it is now normal for Internet access to be available for every member of a household; therefore the person who “pays the bill” is providing connections to a user.

Seen the recent TV adverts for ADSL routers with wifi access? The adverts explicitly say that this machine should be used to enable multiple people in the house to access the Internet simultaneously. This is not some unusual tech-geek activity, it is shown to be normal practice for the sort of person who buys products advertised on prime-time TV – in other words, “everyone”.

So, if an ISP like Xtra terminate “an account” under the auspices of this law, I would argue that they have acted incorrectly; they have terminated access for an entire ISP and not for “a user”.

Just because “I as an ISP” have my network behind NAT, and only one IP address is visible to the outside world, is no reason to claim that I am not an ISP. If an ISP claims that their Terms and Conditions state that the connection should be used by only one person, I would argue that is an invalid restriction, and that their own industry advertises to encourage people to share connections.

I am an ISP. If a copyright holder wishes to complain about an action taken my a user of my network, they have to talk to me, not to my upstream ISP.

With apologies to Jonathan Swift :-

    Great ISPs have little ISPs downstream from them to bite 'em,
    and little ISPs have lesser ISPs, and so _ad infinitum_

Posted by Jim Cheetham | Permanent Link

Thu Dec 25 09:27:51 UTC 2008

Unix time ... before 1970

I set up a new Unix box the other day – Tomato OS on a Linksys WRT54G. I was surprised to see that the time was set before 1970! But Unix time starts in 1 Jan 1970, doesn't it?

# date
Wed Dec 31 16:08:50 PST 1969

Mmm … it took a moment or two to sink in (actually, the evidence is that it took 31 seconds …)

# TZ=UTC date
Thu Jan  1 00:09:21 UTC 1970

Yep, Unix time starts on 1 Jan 1970 all right … in the UTC timezone. This machine had defaulted to PST, which is 8 hours west of the prime meridian …

Time Lords may relax; heavy transuranic elements will not be required.


Posted by Jim Cheetham | Permanent Link

Wed Dec 24 07:57:02 UTC 2008

Installing Tomato over OpenWRT for Linksys WRT54G ...

I've had OpenWRT on my Linksys WRT54Gs for a year or so now, but although it works fine as an AP, I've not had much luck with WDS (Wireless Distribution System).

People have been recommending the Tomato firmware as an alternative for a while now, so I decided to give it a go. Mmm, a problem …

root@gl:~# mtd -r write WRT54G_WRT54GL.bin linux
Bad trx header
This is not the correct file format; refusing to flash.
Please specify the correct file or use -f to force.
Image check failed.

Unfortunately, the Tomato firmware is distributed as ‘.bin' files, not ’.trx', and according to comments on the x-wrt website (http://forum.x-wrt.org/index.php?topic=429.0;wap2) the OpenWRT flash updater mtd no longer supports these for installation, so you can't get there from here …

The FreeWRT mailing list (http://osdir.com/ml/embedded.freewrt.general/2007−01/msg00007.html) claims that their mtd binary can be used for the install, so I tried that …

root@gl:~# ./mtd-static -r write WRT54G_WRT54GL.bin linux
Unlocking linux ...
Writing from WRT54G_WRT54GL.bin to linux ...  [w]

Rebooting ...

Unfortunately, the machine ended up bricked. Actually, both a WRT54GL and a WRT54Gv2 were bricked by this. Luckily, it was only a bad boot loader, and the dd-wrt wiki has a great page for diagnosis and recovery actions – http://dd-wrt.com/wiki/index.php/Recover_from_a_Bad_Flash

So in the end, I just used the firmware's default TFTP-on-boot facility to put the Tomato OS onto the devices, which worked just fine. And without getting involved in huge configuration, WDS is now operating between the ISP-connected unit, and the one with all the wired devices connected; and they both work as Access Points too.


Posted by Jim Cheetham | Permanent Link

Thu Dec 11 21:12:38 UTC 2008

The Heart of the Galaxy

The ESO - European Southern Observatory have been closely watching 28 stars at the centre of our galaxy for the last 16 years, and now they have released some stunning animation showing how these stars are orbiting an unseen object; “Sagittarius A*”, the supermassive black hole at the middle, 27000 light-years away from us, 4 million times more massive than our Sun.

One of the observed stars, S2, managed a complete orbit within the 16-year observation. During observations, an intense flare was spotted from the edge of SgrA* itself, which is probably one of the few ways to directly observe a black hole. See the Max Planck Institute's Galactic Centre Research pages for more information.


Posted by Jim Cheetham | Permanent Link

Tue Oct 21 01:11:21 UTC 2008

Dedicate an Ubuntu console to music playback

My good speakers are hooked up to an old server machine, which presents through a nice small 15" LCD monitor on the desk.

The server doesn't run a GUI of course, so I do music playback from the commandline with programs like mpg123 and mp3blaster.

I decided to dedicate the first text console to playback, so I needed to replace the login prompt with the mp3blaster program. I hadn't noticed that Ubuntu no longer has an /etc/inittab file, because it has switched to the more flexible Upstart system, so it took a few minuted to find out how to get this set up.

Hacking on Upstart

The first port of call is the /etc/event.d/tty1 file, which by default is running getty for us. I'm keeping getty (although other tty programs are out there and may do the job in a nicer way), so I need to ask it to run different “login” program, using the -n and -l options. Just for luck, I also set the TERM type explicitly.

getty doesn't like to send arguments to the login program, so I had to set up a small script to do the hard work. Make sure that the filesystem this script lives in is available when Upstart is started … however I suspect that Upstart is actually smart enough to figure this out :-)

/etc/event.d/tty1

# tty1 - getty
#
# This service maintains a getty on tty1 from the point the system is
# started until it is shut down again.

start on stopped rc2
start on stopped rc3
start on stopped rc4
start on stopped rc5

stop on runlevel 0
stop on runlevel 1
stop on runlevel 6

respawn
#exec /sbin/getty 38400 tty1
exec /sbin/getty -n -l /usr/local/bin/jimp3 38400 tty1 linux

Next, the helper script; I need to invoke mp3blaster autostarting a playlist, but I also want it to run as my user, rather than root. Good old su is a simple way of achieving this.

/usr/local/bin/jimp3

#!/bin/sh
/bin/su -c '/usr/bin/mp3blaster -a /home/jim/allmusic.lst' -- jim

Do NOT reboot!

No need to reboot the server to get this all running! Use the initctl command to find the ‘tty1’ job that is currently running a login shell, stop it and then restart it.

# initctl list
control-alt-delete (stop) waiting
logd (stop) waiting
rc-default (stop) waiting
rc0 (stop) waiting
rc1 (stop) waiting
rc2 (stop) waiting
rc3 (stop) waiting
rc4 (stop) waiting
rc5 (stop) waiting
rc6 (stop) waiting
rcS (stop) waiting
rcS-sulogin (stop) waiting
sulogin (stop) waiting
tty1 (start) running, process 5622
tty2 (start) running, process 4235
tty3 (start) running, process 4236
tty4 (start) running, process 4230
tty5 (start) running, process 4231
tty6 (start) running, process 4238
# initctl stop tty1
tty1 (stop) running, process 5622
tty1 (stop) pre-stop, (main) process 5622
tty1 (stop) stopping, process 5622
tty1 (stop) killed, process 5622
tty1 (stop) post-stop
tty1 (stop) waiting
# initctl start tty1
tty1 (start) waiting
tty1 (start) starting
tty1 (start) pre-start
tty1 (start) spawned, process 6469
tty1 (start) post-start, (main) process 6469
tty1 (start) running, process 6469

Job done! You should now have a copy of mp3blaster running on the first virtual console, playing your playlist for you, as your userid … and if you quit the program, it'll restart straight away.


Posted by Jim Cheetham | Permanent Link

Sun Oct 12 21:04:12 UTC 2008


Posted by Jim Cheetham | Permanent Link

Wed Oct 1 21:05:43 UTC 2008

The WindFire Cursor kite ...

Tim Elverston's latest kite appeals to the computer geek …

http://www.windfiredesigns.com/timbofolio_pages/PointerKite.html

/images/WindFireOSCursor.jpg

He promises more to come in the OS series of kites …. probably Windows :-(


Posted by Jim Cheetham | Permanent Link

Mon Sep 1 09:26:05 UTC 2008

Goodbye Twitter

I've been using Twitter for a little while; racked up just over 100 tweets. But at the end of the day, there was nothing of lasting value coming through, no point in telling people what I'm doing, I'd rather be doing things than talking about doing them.

Well, there's the point. On Twitter, you're not really talking about things, it's too lightweight. You can't say anything subtle, unless it's an in-joke. I'd rather have a few high-quality interactions than a flood of noise.

It's an interesting experience to look out at a social network of friends of friends, but a touch voyeuristic. So, my account is now deleted. Perhaps I'll get round to more blog entries now …


Posted by Jim Cheetham | Permanent Link

Thu Aug 14 02:42:13 UTC 2008

The legal basis for Free Software (and Open Source)

Lawrence Lessig is happy – a US Court of Appeal has provided precedant for the theory behind copyleft ; the basis behind numerous Free Software licenses such as the GNU GPL and specifically in the court ruling, the Artistic License.

The copyleft premise is this: source code has been published in a written form, therefore copyright law restricts your ability to distribute copies of it. A Free Software license grants you an additional license, allowing you to distribute copies; but only if you follow certain conditions.

If you fail to follow the conditions, you are not allowed to claim usage of the Free Software license; therefore full copyright law is in play, and you cannot distribute copies at all.

However, in the US at least, it hasn't been clear whether the conditions attached to these Free Software licenses have actually been “conditions”, and aren't just “contractual covenants”. It makes a big difference when you break them; in the latter case, you are penalised for breaking a contract, and that's all. It would probably result in some monetary damages being due, and they're difficult to assess when the original product was generally available without charges being made. However, given that these clauses are now known to be “conditions”, breaking them means that you have no license at all, and you are infringing copyright – and there is no confusion here regarding money or lack of money.

So, a high-quality precedant from the US legal system supporting the copyleft principal.


Posted by Jim Cheetham | Permanent Link

Mon Aug 11 05:37:36 UTC 2008

RMS on New Zealand

I've typed up a transcript of Richard Stallman's recent interview on the Kim Hill Saturday programme on Radio New Zealand.

See /articles/rmsrnz/index.html for the full transcript.


Posted by Jim Cheetham | Permanent Link

Thu Jul 3 09:42:37 UTC 2008

Early spam references -- 1891

Early spam references

The Picture of Dorian Gray / Oscar Wilde / 1891

Chapter VIII

… He sat up, and, having sipped some tea, turned over his letters. One of them was from Lord Henry, and had been brought by hand that morning. He hesitated for a moment, and then put it aside. The others he opened listlessly. They contained the usual collection of cards, invitations to dinner, tickets for private views, programmes of charity concerts, and the like, that are showered on fashionable young men every morning during the season. There was a rather heavy bill, for a chased silver Louis Quinze toilet-set, that he had not yet had the courage to send on to his guardians, who were extremely old-fashioned people and did not realise that we live in an age where unnecessary things are our only necessities, and there were several rather courteously worded communications from Jermyn Street money-lenders offering to advance any sum of money at a moment's notice and at the most reasonable rates of interest.


Posted by Jim Cheetham | Permanent Link

Wed Jun 25 10:44:08 UTC 2008

Bug hunting ...

I'm feeling a little virtuous at the moment. Worik on the DUNLug mailing list asked how to delete a user and eradicate all their files. I said “ deluser –remove-all-files ”. Worik said that didn't work.

Rather than assume that he'd made a mistake, I tried it. It doesn't work, just like he said. A bug!

We're both using Ubuntu, so I turned to the Launchpad and checked for bugs on the adduser package. There was a “fixed” bug that said it fixed a specific failure, the inability to remove the Ubuntu default symlink ~/Examples, in 2006. I checked my test machine, and this was exactly the problem I was seeing – everything except ~/Examples had been removed OK.

Further testing showed that the --remove-home option worked just fine. Hmmm …

Luckily, deluser isn't an executable, it's a perl script. So I was able to do some digging, even though my perl is quite rusty (thanks http://perldoc.perl.org/ !) I added some debug comments and managed to categorise the problem … which lead to a fix … and a small patch file, all submitted onto the launchpad bug.

Usually I stop at the categorise-and-report stage. It's nice to be able to propose a fix too :-)


Posted by Jim Cheetham | Permanent Link

Mon Jun 16 23:49:42 UTC 2008

MS Word fails basic MS Excel integration

Yeah, I know I like finding fault with MS … but I have to work with their tools, too.

I have an Excel spreadsheet, with some currency values formatted as “Accounting”, which provides nice alignment of the currency symbol and decimal point.

When these cells are cut/paste'd into Word, the presentation of these cells is “preserved” by simulating the alignment with multiple spaces … but actually these cause the presentation to break, and the cell contents split onto multiple lines, and no longer align.

So, the hack would be to replace all those extra spaces, wouldn't it? Except MS Word doesn't have greedy matching! You can't replace, say, 8 spaces with a pattern of <space><star> … or even <space><at> (which is the “one or more” operator). You have to manually repeatedly do replace-all for decreasing explicit numbers of spaces; e.g. repeat “replace-all <space>{8} with <space>” until there are no matches, then repeat “replace-all <space>{4} with <space>” until there are no matches, then {2} …


Posted by Jim Cheetham | Permanent Link

Mon Jun 9 21:06:30 UTC 2008

Dual SIM mobile phones

There has always been a conflict between my personal and working life over the subject of a mobile phone. My employer needs me to have a mobile phone, and provides it (well, at least the SIM! And a ‘free’ handset to a reasonable value too). I also value having a mobile phone of my own; but I don't want to carry two.

Therefore I have to use just the one incoming number – it belongs to work, not me. And my outgoing personal calls have to be separated out from the work ones for expenses purposes, too.

I've been waiting for the sensible option – a phone that can hold two SIM cards at the same time. That way, you can differentiate between personal and work calls both incoming and outgoing; and if you change employer you don't lose all your contact data and have to change your number!

While reading a post about the OpenMoko GTA02 getting into production, I spotted a google ad for “Dual SIM phones”, and ended up on a page from a Malaysian company, DuoSIM. It looks like the world is finally catching up on what people really need from their technology, eh?

(Now, what will be more fun? An OpenMoko Neo FreeRunner or the new iPhone? Both with Wifi, touch screen, bluetooth, GPS, accelerometer, similar battery life; the iPhone has significant data storage that the Neo doesn't (but it will take microSD), but has a mostly-closed development environment …)


Posted by Jim Cheetham | Permanent Link

Thu Jun 5 02:08:05 UTC 2008

Warning signs for the future world ...

In September 2000, on the comic strip Schlock Mercenary we saw inside the workshop of Commander Kevyn Andreyessand …

/images/schlock20000903a.png

The worrying safety warning signs on the wall was part of the inspiration for Anders Sandberg's article Warning Signs For Tomorrow

/images/warning1.png

And now … (well, soon) you can get your hands on your very own set of Schlock Mercenary Magnetic Miniature Warning Signs !! Dust off that credit card and haunt the Schlock Store …

/images/magnetprototypes.jpg


Posted by Jim Cheetham | Permanent Link

Tue May 27 02:13:01 UTC 2008

The SNOM 300 SIP phone

As part of the new home office setup, I decided to run with a SIP phone service from my wireless ISP rather than any fixed-line installation.

I don't want to be tied to a headset, so a real desk phone was the order of the day. Initial trials with a D-Link DPH-120S were disappointing; there was a nasty audible hum coming through, and the unit felt a little too lightweight in construction.

So off to http://nicegear.co.nz and see what they recommend … a SNOM 300 VoIP phone!

This unit feels much more solid on the desk, and has a nice handset too. There was a little bit of trouble getting it set up with WIC, which needed a full factory reset and reconfigure to fix (it looks like the device breaks the authentication hashes under some circumstances, and just re-entering the account details doesn't fix it). However, if this became a problem in regular usage it would be easy enough to use DHCP/TFTP to provide full automated configuration at boot time anyway.

The web interface is nice and comprehensive, and the phone can be configured with up to four separate SIP accounts; so you can separate between business and personal lines, or between incoming/outgoing calls – just indicate which identity you want to use in the address book for that number. Settings are flexible and well documented – in order to encrypt SIP all I had to do was specify ;transport=tls at the end of the Registrar IP address (RTP was already encrypted, thanks!)

As the phone receives calls and other events happen, you can ask it to hit a URL on one of your own servers. This would nicely form the basis of a “stop the music!” on an incoming call :-) Of course, you can also hand off to a syslog server, or query the phone with SNMP.

So, it's a very flexible device, which makes it easy to fit in with however you want to handle calls. Thanks to Hadley of Nicegear for the recommendation and prompt shipping!


Posted by Jim Cheetham | Permanent Link

Sun May 25 09:44:02 UTC 2008

Multiple remote controls ...

For many years I've been using the excellent Philips SBC RU880 8-in-1 remote controller … although only for three devices at a time, but the learn ability meant that it was always easy to program in a new device.

However, I finally wore out it's abilities with a Panasonic home theatre (SC-PT450 … not multiregion hackable AFAICT, unfortunately); it wasn't able to reproduce the IR signalling. So time for a new remote …

Welcome to the Logitech Harmony 525 (from Dick Smith Electronics, NZ$99). It will run up to 15 devices (now I have 5; TV, Freeview, theatre, multi-region DVD, video), but more usefully it thinks in terms of “activities” rather in devices. This means that I can “watch TV” or “listen to radio”, and the remote will change the state of all the devices to match the goal.

As an example, when I want to watch a non-NZ DVD I need to use my old DVD player; so the remote needs to have three systems switched on, and to set the correct inputs on them all … This takes a long time and uses three separate remotes, but with the Harmony it is one button press …

“When you start this Activity, the remote will ensure your system is set up as follows:”

Device Status / Actions
Mustek DVD Mustek DVD is on
Philips TV Philips TV is on
Panasonic Mini System (DVD, CD, Radio) Panasonic Mini System (DVD, CD, Radio) is on
Other All other devices are off
Philips TV Philips TV is set to “SVHS”
Panasonic Mini System (DVD, CD, Radio) Panasonic Mini System (DVD, CD, Radio) is set to “AUX”

This isn't “Macro” programming, this is the way the whole device likes to think and operate. It keeps track of the state of all the devices over time, so it knows what operations to use to get things into the requested state. If you do change things with your old remotes (or even manually!) then things will go wrong … at which point you press the ‘Help’ button and it steps through a whole bunch of corrective actions (“Is the TV on? (yes/no); Did that fix it?” etc.)

The biggest downside to the remote is the programming method; a Windows or OSX bit of code that mediates between the USB-connected remote and the Logitech website, where they hold not only a full database of current AV equipment remote control codes, but they also seem to hold your remote control's profile. If I were dedicated I'd sniff the traffic to be sure that's what is happening, but it feels like the case.

Overall, it's a great remote, not just to replace the set of originals, but also to control complex interactions between systems.


Posted by Jim Cheetham | Permanent Link

Mon May 12 08:40:07 UTC 2008

Using wubi to install Ubuntu into Windows

So now I've used wubi to install the latest Ubuntu onto my Windows machine. Interestingly easy.

For some reason it won't allow you to set a default user password that has a space in it – but at least it tells you that before you commit the install! Otherwise a peaceful and anonymous install process, that naturally asks for a reboot when it has finished, but politely doesn't demand it.

The second-stage installer carried on happily, but it wasn't immediately obvious that it wanted a reboot, it looked a little like it had crashed. Each real boot takes a long time to get past the swap initialisation stage, but I had the restraint to leave it alone, and it eventually came up into a nice functional Ubuntu 8.04 Hardy Heron system.

With the exception of the mounted disks, we have direct access to hardware, and have to do all the usual things to install Broadcom wireless support, bah. On my laptop there was no Restricted Hardware support required, and compiz worked well. Unfortunately, my acid test is running bzflag, and it's performance was terrible at even medium graphics levels. Perhaps I'll have to hunt down a non-free video driver … :-)

So, that was wubi installing Ubuntu. Now, what did it do within Windows?

At boot time, the Windows selection menu pops up – most of the time Windows users won't see this option. Ubuntu is listed at the bottom, but Windows itself is still the default choice.

C:\ubuntu now exists, taking up just over 8.16GB for the 8GB install of Ubuntu. There are a couple of large .dsk files in there, one for the root volume and one for swap. Under “Add or Remove Programs” there's an entry called “Ubuntu”. There isn't anything under the Programs menu, but hopefully that won't confuse anyone.

Uninstall was very quick, but left the Windows boot menu in place. Not a problem for people who have figured out what dual-boot is in the first place, I guess.

So, pretty straightforward from the Windows perspective. I don't really like dual-boot solutions in general, but this is a good one – simple, straightforward, functional. And none of that dabgerous messing around with partitioning that used to be necessary!


Posted by Jim Cheetham | Permanent Link

Fri May 9 05:29:13 UTC 2008

Mounting ISO files in Windows

I've downloaded my Ubuntu ISO files … and now I'm sitting on a Windows XP machine I'd like to try the wubi installer to be found on the Desktop CD.

But it's not exactly easy mounting an ISO file under Windows …

Luckily I ran across a blog post from Michael Bowman that discusses a few options :- http://proxy.11a.nu/2005⁄05/08/mounting-iso-image-files-under-windows

There's an ugly-as-but-functioning put of code available from Microsoft, the Virtual CD-ROM Control Panel for Windows XP that needs some manual installation. I think I'd rather install crap code from Microsoft than some random third-party all-singing-all-dancing thing to use only one small feature once …


Posted by Jim Cheetham | Permanent Link

Thu May 8 09:37:54 UTC 2008

Vodafone 3G Coverage ...

For some reason, the Vodafone Coverage page is really difficult to locate on their site …

And it tells me that my new home, Dunedin, is not very well blessed with 3G … up on Highgate, I'll get “excellent” 2.5G, but no 3G or 3G Broadband. Guess I don't need to get too excited about the new iPhones, then …


Posted by Jim Cheetham | Permanent Link

Thu May 8 09:14:25 UTC 2008

So ... Vodafone NZ for the iPhone

A great relief to hear that Vodafone NZ will be supporting the iPhone, I presume after the June release of the 3G/GPS models. Probably a deal related to the Australian situation, where unlocked phones seem to be the only way forward for Apple … and therefore no barrier to adpotion in NZ.

Not that it will make any real difference to early adoptors – we're already using more services from our devices than Apple provide, and therefore we're independant of carrier. And I still want a handset separated from a 12 or 24 month contract …

But imagine the impact on businesses – with ActiveSync in place, the iPhone will start to threaten the rollout of Blackberry services that I have to keep on looking at for the larger customers. All we need is a better set of wireless authentication options (client certificate PEAP for a start) and a decent VPN (although I suppose we could support IPSec with too many tears if we had to). Much cheaper than a couple of BES servers and a deal with data going to Canada …


Posted by Jim Cheetham | Permanent Link