Nov 282007

Hi All…

After much waiting, the MIPS4 stages for little-endian MIPS systems are finally built. These are targeted at Cobalt users, but may also work for users of other MIPS4 and MIPS64 systems. The 2007.1 snapshot has seen a few changes in the time it’s taken me to compile this, so I may upload some updated stages later, but in the meantime, I’d appreciate any feedback on how well these stages work.

I plan to use them to rebuild my Qube2, whose root fs has accumulated many cobwebs over the years.

You’ll find the stages on my devspace for now.

Nov 262007

Atomic MPC forum user, freakonaleash, asked an interesting question regarding sending faxes over IP. This got me thinking.

We’ve got solutions for an internal LAN such as Hylafax for an intranet-based fax-over-IP solution. But nothing exists that could be considered similar to Voice-over-IP. I can’t use the internet for instance, to send a fax overseas — and sometimes just like the telephone, one needs to fax a document.

There’s also the situation of inexperienced people. People like my grandparents, wouldn’t have a clue how to use a computer to send an email, or maintain a PC. Linux distributions have gotten to the point where I’d be quite comfortable setting up a minimalist Gentoo or Ubuntu installation on an old PIII box — to allow basic email and web browsing, but I still need to be around to keep it updated and maintained. Even if I were to go throw Windows XP on the same machine — I’d still have to maintain it.

Email offers some very useful options for such people — e.g. the ability to send letters and other correspondence and have it arrive at the other end within a day or so. (and that’s if the mail servers are having a bad day!) These days, one can buy a hardware device that provides VoIP capability, one can purchase devices that offer limited web-browsing capability without the need of a full-blown desktop computer, why not an internet appliance for sending and receiving email?

Well, I don’t see the need for a whole new protocol. SMTP and POP3/IMAP will do just fine for the actual FoIP capability. The issue is the interface to these protocols. I’m thinking an internet facimile would offer the following:

  • Ethernet interface for connection to the internet via a router.
  • Internal ADSL and/or PSTN modem for stand-alone internet access without other hardware, and standard fax capability
  • LCD Display and keyboard for reading/composing mail and user interface (touchscreen)
  • Onboard scanner and printer
  • Handset/headset jack for voice communications (either VoIP or standard land-line)

The idea, is that someone who doesn’t have a proper understanding of computers, could send a message over the internet using this device. They would simply hit the “Compose” button, fill in the recipient’s fax number (standard fax) or email address (FoIP), a subject for the message and cover letter, then scan in whatever attached pages they wish to add (these would appear as PDF, JPEG or PNG attachments). Some models may include USB ports and card readers, to allow attaching arbitrary files from USB drives and flash cards. Once they’re happy, they get the option of either sending it right then and there, or storing it to send in a batch run.

For privacy, perhaps something like PGP could be incorporated, thus allowing messages to be encrypted. There’s scope for this device to act as an internet router, networked printer/scanner, and VoIP ATA box too, which could be add-on features.

In essence though, the box could just sit in the corner… and say, overnight, connect to the internet, download any new messages, send any unsent messages out.

I might look into something like this, as it seems in the open source world, we have pretty much all the necessary pieces — just a matter of piling the right software on a standard PC and we’ll have a proof-of-concept prototype.

Nov 262007

Tony Abbott has become opposition leader and is now announcing his front bench. We cross now to Parliament House in Canberra…

Abbott: Welcome everyone. As newly appointed opposition leader, I have decided on the following people for my front bench. I have chosen, Who for Shadow Treasurer, What for Shadow Industrial Relations Minister, and No Idea for Shadow Environment Minister.
Rudd: It’s nice to see we have new leadership in the opposition, but working families would like to know who the shadow ministry is.
Abbott: Well, as I’ve just told you, we have Who for Shadow Treasurer, What for Shadow Industrial Relations Minister, and No Idea for Shadow Environment Minister.
Rudd:I’m sure you’re a very clever politician, but the bottom line is this … Who is Shadow Treasurer?
Abbott: That’s correct
Rudd: Pardon?
Abbott: Who is the Shadow Treasurer.
Rudd: On the question of Shadow Treasurer, working families would dearly like to know who is in this role.
Abbott: Yes, Who IS the Shadow Treasurer.
Rudd: Okay, if the opposition leader wishes to get hairy-chested about telling us the Shadow Treasurer, perhaps he’d like to answer another question. Who is the Industrial Relations minister?
Abbott: No, Who is the Shadow Treasurer.
Rudd: Not Interested in the Shadow Treasurer…
Abbott: No no no, Not Interested is our Shadow Foreign Affairs minister.
Rudd: … Right, so who takes the position of Shadow Defense minister then?
Abbott: Why do you insist on taking Who away from Shadow Treasurer?
Rudd: I’m not trying to take anyone out of any role — in due season, we’d all like to know who the opposition front bench is. Okay, let’s go role-by-role here. Please tell us who you have selected for these roles. Shadow Treasurer…
Abbott: Who
Rudd: Sorry?
Abbott: Who is our Shadow Treasurer.
Rudd: That’s what I’m asking you. Never mind we’ll come back to that… Shadow Industrial Relations minister?
Abbott: What
Rudd: Who is the Shadow Industrial Relations minister?
Abbott: What
Rudd: Is this microphone working or has the Opposition Leader gone deaf?
Abbott: I can hear you fine. I’m telling you our Shadow Industrial Relations minister is What.
Rudd: (sighs) Okay, Shadow Environment minister?
Abbott: No Idea
Rudd: You don’t know?
Abbott: Yes, I do know…
Rudd: You’ve lost touch with your own party?
Abbott: …No, No Idea is our Shadow Environment minister.
Rudd: Fine, how about Shadow Communications minister?
Abbott: Tomorrow
Rudd: What’s wrong with today?
Abbott: No, we put Today on the backbench
Rudd: I’m sorry, I don’t follow.
Abbott: Today used to have the role of Health minister but after the reshuffle following the election, we have placed him on the back bench.
Rudd: Well it seems we’ve come to a fork in the road. My challenge to the Opposition Leader is this… It’s time to end the blame game, and decide who you wish to select for your front bench.

(Thanks go to Abbott & Costello for writing the Who’s On First skit that this is based on, and to the Liberals for collating a useful table of Rudd quotes.)

Nov 202007

Hi All…

Well, it seems I’m done building the MIPS1 stages for little-endian MIPS well ahead of time. I used one of the Lemote Fulong systems to build these, and had stage 1, 2 and 3 done in about a day and a half — which is a record for me — the Qube2 normally takes about a week, and it’s still chugging away at stage 1.

You’ll find all the generic stages on my devspace for now. I’d greatly appreciate it if some brave users could give them a try and let me know how they go. I’m doing some tests now, and things look promising, apart from guile failing a “make check”, everything seems to be going fine. These will work on any MMU-equipped little-endian MIPS box with sufficient RAM (~128MB… 64MB if you’re absolutely desperate, but you won’t be able to rebuild system packages like gcc and glibc).

The MIPS4 builds will be a little while, since the Lemote boxes only implement up to MIPS3, I can’t use them to directly build the Cobalt stages, thus they’re being done on the Qube2. I’ll let you know as things progress, but I expect it’ll be tomorrow before I have a stage1 tarball available for MIPS4.

Nov 132007

LG IP Operator main dialogueI discovered an interesting example of poor UI design today whilst checking the wireless configuration on my father’s laptop. The machine runs a factory installation of Microsoft Windows XP Professional (along side Gentoo Linux/x86) , and came with a little network configuration utility called IP Operator.

IP Operator exhibits several interface abnormalities and issues. The main dialogue is pictured left (click to enlarge). Firstly, it’s full of geekspeak, with acronyms even an experienced user like myself would get confused by. Some of the tooltips and UI elements mention terms like SSID (which I understand is the network name), RSSI (what on earth is that? presumably signal strength…), Link speed: 11Mbps (Is that good?!)… Indeed, the very name of the application is geek-speak. IP? Is that Intellectual Property? My father thought it was… (and that’s someone who does have a strong IT background).

The layout of the dialogue isn’t bad per-se, although it’d be nice if it respected the user’s choice of colour sheme. That said — notice the two little arrows just above the Disconnect button? Guess what they do — change the colour of the dialogue. Totally pointless — Windows XP already provides a means of doing that in its Display control panel.

As for keyboard navigation, most applications stick to underlining the mnemonic letter to indicate keyboard shortcuts. I’ve seen examples of this under Linux/Unix (Motif, X/Athena, Qt, GTK+, WxGTK and numerous other UI toolkits), Microsoft Windows, IBM OS/2, Apple MacOS and Mac OS X, SGI Irix … even DOS applications often displayed the mnemonic character using a different colour. As an example, the Firefox web browser I’m using now, does this…

File Edit View History Bookmarks Tools Help

Now, for a user like myself, I know that hitting ALT+F will get me the File menu, or ALT+H will get me Help. It works the same in every other platform I’ve used. Clearly for LG, this isn’t good enough, instead they opted to explicitly show the mnemonic character separately.

The only time I’ve seen this done legitimately, is when the interface is in a language other than English — and even here, I’m not keen on the idea — I recognise that in that situation, it is done because the keyboards are often designed with English in mind, and thus don’t provide a convenient means of entering in foreign-language characters. OpenOffice 2.0 as factory-installed on a Lemote Loongson, shows its menus like this:

OpenOffice 2.0 in Traditional Chinese

LG even do this in the context menu for the system tray icon, as seen below.

IP Operator System Tray Context Menu

Now here, it’s completely pointless. The system tray is quite difficult to reach via the keyboard — at least for me anyway (there may be some other shortcut for it). The way I reach it, is to tap the Logo key (or CTRL+ESC) switch focus to the “Start” button, then hit tab a few times to reach the system tray where one can use the arrows to move around (or it may be TAB/Shift+TAB… not sure). Most users would just use the mouse — much less stuffing around.

Indeed, LG probably want to have a think about how they present things to the user. I’m happy that I don’t have to deal with it 90% of the time — since it isn’t my computer. I’d have uninstalled it by now if it was (in fact, I’d have completely reloaded the box myself — I don’t trust factory installs). These days I look back to the days when the Interface Hall of Shame was online (there’s an archive of it here) — they’d have a field day with applications like Office 2007 and OSes like Windows Vista (with it’s totally new and fresh UI) … and probably have a dig at us too. But perfection is a journey, not a destination, so this is to be expected. 😉

Nov 122007

Update: Seems I should have read this page first… we were thinking on the same wavelength afterall. I’ll leave the post here, since I think my (and Brian Lozier’s) argument is still valid with respect to the overheads in various templating engines…

It has always fascinated me, with large-scale PHP projects, how people seem to flock to overly complicated templating engines. I’ve worked on a couple of such projects, and it got me thinking about why we do it.

My first real contact with a site that uses templating engines was the Asperger Services Australia site. Originally, it was a static-HTML site done in FrontPage, but after looking at a number of CMS systems, we finally chose TikiWiki to run the site. TikiWiki utilises the Smarty templating engine — a behemoth weighing in at just over 1MB.

Smarty wields a lot of power, able to do numerous transformations with strings — but it’s a big package, and takes quite a while to master. It also seems to occupy a lot of memory, and requires write access to directories to store “compiled” templates.

This year, we built a web application called Teamworker. Our implementation was written in PHP using MySQL, and basically it was a ground-up re-write of an internal QUT webapp of the same name (many QUT students probably know it well). For this project, we wound up using the bTemplate engine, a far simpler engine than Smarty, it uses simple string replacement of XML-like tags. It has quite a few limitations however — for instance, one cannot have two loops of the same name — it’ll substitute one, but not the other. It isn’t difficult to pick up, but some aspects of its syntax are … awkward.

I dare say if I look hard enough, there’s probably some poor sadistic sod trying to do it with XML and XSLTs. Yes, they have their place, but they’re massive overkill. If your data is already in XML to begin with (i.e. Gentoo’s site) then sure, go for it, but otherwise it seems to be (to me anyway) a really messy way to do things.

PHP, believe it or not, actually is a templating engine. It has all the features one needs. All the code I need goes inside tags like this: <?php ?>, and outside of these, I can have just about anything I want. I can also use conditional statements inside PHP tags, to control what gets displayed outside… e.g. suppose I define the variable $logged_in, a boolean, and the string $user… a webapp might have:

... random HTML code...
<?php if ($logged_in) { ?>
Hello <?= htmlentities($user) ?>.
<a href="profile.php">Profile</a>
<a href="logout.php">Logout</a>
<?php } else { ?>
Hello guest. Please <a href="login.php">log in</a>
<?php } ?>
... more code ...

Voila… done. To whistle up this template, a script only needs to initialise $logged_in and $user, then include("template_file.php");, and it’ll appear as they expect.

However, this requires that your templates be structured a particular way. You’re more-or-less generating things on-the-fly, rather than constructing everything in a buffer, then sending it later. This can lead to display code getting mixed up with computation code, which isn’t terrific. So in these situations, PHP needs a little helping hand. Enter, the 8-line templating engine.

PHP since version 4 supports output buffering. These allow the programmer to control when and how, data is released to the browser. In addition, it is also possible to fetch the rendered output from the buffer as a string then clear the slate. This gives us great power to create a very simple but flexible templating engine, in 8 lines of PHP code:

function doTemplate($templateFile, $data) {
$_out = ob_get_contents();
return $_out;

It’s crude, but it works. A site can then be easily put together using this method. No files need to get written at runtime, there’s no special syntax required. The idea is the template files are just very trivial PHP scripts — one uses as few functions as possible to achieve the desired page output. So built-in functions such as if, foreach and similar constructs, and maybe the odd include(). A site might use an overall template like the following:

<title><?= htmlentities($page_title) ?></title>
<h1><?= htmlentities($page_title) ?></h1>
<hr />
Navigation: <?php foreach($navlinks as $link) { ?>
<a href="<= $link["target"]; ?>"><?= htmlentities($link["title"]) ?></a>
<?php } ?>
... other header stuff ...
<?= $content ?>
... rest of page

They may, for instance, have some form widgets. Suppose they wanted all these boolean values to use radio buttons with some sort of tick/cross image beside them? They can define the HTML code for them in one place…

<input type="radio" value="no" name="<?= $name ?>" id="<?= $name ?>_no" /><label for="<?= $name ?>_no"><img src="/images/cross.png" alt="No" /></label>
<input type="radio" value="yes" name="<?= $name ?>" id="<?= $name ?>_yes" /><label for="<?= $name ?>_yes"><img src="/images/tick.png" alt="Yes" /></label>

Then use that widget repeatedly in a document by simply defining some place holders (using <?= $placeholder_name >) and generating the page…

$my_page["show_email"] = doTemplate("templates/yesno.tpl.php",array( "name" => "show_email" ));
$my_page["subscribe_annouce"] = doTemplate("templates/yesno.tpl.php",array( "name" => "subscribe_announce" ));
// ... other definitions ...
$page_content = doTemplate("templates/register.tpl.php", $my_page);
echo doTemplate("templates/overall.tpl.php", array(
"page_title" => "Register for our forum!",
"content" => $page_content,
"navlinks" => $navigation // <-- This may be a global array that's manipulated in various places as needed.

Already, that works in much the way bTemplate does, but doesn’t have nearly as many limitations. There are some manipulations that it can’t do as easily as Smarty does them, such as inline manipulations of text, but then again, it’s a heck of a lot more lightweight. Sure, RAM is cheap these days… but still, why waste the resources if you don’t have to? What I’ve done above, could be viewed as wasteful — even the very act of using PHP in the eyes of some, but sometimes we don’t get a say in that matter, we work with the tools we have at hand. (Heck, I’ve been known to use C and Busybox ash to construct webapps — which works surprisingly well too.) But even in this age of cheap computing power, I think striving for minimalism is still worthwhile.

Nov 112007

Just recently, my old access point (D-Link DWL900 AP) decided to stop communicating with the 2.4GHz world (although ap-utils still talks to it via wired ethernet). So for the moment, we’re using a wireless router, HP’s hn200w.

As an AP, it isn’t too bad, but as a router, it’s overkill for what I need — or is it? For my wireless network, an old P166 box running Gentoo Hardened acts as a DHCP server and OpenVPN endpoint, allowing my wireless clients to access the main network (at layer 2) through an AES256-encrypted tunnel.

The question is … can I get the wireless router to do this? The old PC is doing a good job, but it’s noisy, and a bit hungrier on the power than your typical wireless router. Then again, it has more storage capacity — but there’s nothing stopping me mounting more via NFS from the webserver — so this isn’t a big issue.

A look around revealed there was practically nothing known about this router. I knew from my nmap-probes, and this post that Linksys made the wireless interface — it in-fact uses a 16-bit PCMCIA Linksys WPC11. But what CPU did this thing run? What OS? The firmware had a few more references to “Linksys” in it, but didn’t reveal much else. It doesn’t run Linux — but rather some proprietary RTOS.

If you crack the box open, you’re greeted by a rather uninviting metal box. The PCB is covered by a metal earth shield that’s soldered to the motherboard — at the top, only two ~4mm antenna connectors poke out — these are the connectors on the wireless card.

hn200w wireless card antenna sockets

Remove the cover however, and you’re greeted by a far more interesting mainboard. The critical chips such as the CPU (seen under the wireless card) have heatsinks on them — since I wanted this thing to continue working, I decided it was better to leave the heatsinks alone. The following show the mainboard with, and without the wireless card.

hn200w mainboard without shield hn200w mainboard without wireless card

I’m nonethewiser about the CPU and other components. I realise some of these shots will need to be re-done since not everything came out clearly. The ethernet device seems to be a Realtek RTL8019AS device — very common on NE2000-compatible ISA network controllers. So whatever it is, it seems it has a 16-bit bus. All of these devices are supported by Linux, but something tells me the unit may lack the RAM or flash to run/store Linux. But nonetheless, it was fun cracking the box open and having a peek. If there’s any interest, I may investigate taking better shots of some of the ICs — although the main chips will still keep their heatsinks, since I’m not sure they’re easily re-attached.

Nov 062007
Received: (qmail 4980 invoked from network); 6 Nov 2007 03:19:25 -0000
Received: from (
    by with SMTP; 6 Nov 2007 03:19:25 -0000
Received: by (Postfix)
    id A5E1A13230; Mon,  5 Nov 2007 21:20:05 -0600 (CST)
Date: Mon,  5 Nov 2007 21:20:05 -0600 (CST)
From: (Mail Delivery System)
Subject: Undelivered Mail Returned to Sender
To: me
Auto-Submitted: auto-replied
MIME-Version: 1.0
Content-Type: multipart/report; report-type=delivery-status;
Content-Transfer-Encoding: 8bit
Message-Id: <>

This is a MIME-encapsulated message.

Content-Description: Notification
Content-Type: text/plain; charset=us-ascii

This is the mail system at host

I'm sorry to have to inform you that your message could not
be delivered to one or more recipients. It's attached below.

For further assistance, please send mail to postmaster.

If you do so, please include this problem report. You can
delete your own text from the attached returned message.

The mail system

< someone>: User unknown in virtual alias table

Content-Description: Delivery report
Content-Type: message/delivery-status

Reporting-MTA: dns;
X-Postfix-Queue-ID: 3756B13A92
X-Postfix-Sender: rfc822; me
Arrival-Date: Mon,  5 Nov 2007 20:53:33 -0600 (CST)

Final-Recipient: rfc822; someone
Original-Recipient: rfc822; someone
Action: failed
Status: 5.0.0
Diagnostic-Code: X-Postfix; User unknown in virtual alias table

Content-Description: Undelivered Message
Content-Type: message/rfc822
Content-Transfer-Encoding: 8bit

Received: from ( [])
    by (Postfix) with ESMTP id 3756B13A92
    for < someone>; Mon,  5 Nov 2007 20:53:33 -0600 (CST)
X-Scanned-By: amavisd-new at
Received: from ([])
    by ( []) (amavisd-new, port 10024)
    with ESMTP id gPXXmSrEI3v7 for < someone>;
    Mon,  5 Nov 2007 20:52:54 -0600 (CST)
Received: from [] ( [])
    by (Postfix) with ESMTP id A9C9013B49
    for < someone>; Mon,  5 Nov 2007 20:53:17 -0600 (CST)
Received: from ( [])
    by (8.12.0/8.12.0) with ESMTP id h4JENZ87005617
    for < someone>; Mon, 19 May 2003 09:23:35 -0500
Received: from ( [])
    by (8.12.0/8.12.0) with SMTP id h4JENaDN012327
    for < someone>; Mon, 19 May 2003 09:23:36 -0500
Received: from by via csmap
    id 8818; Mon, 19 May 2003 09:23:54 -0500 (CDT)
Received: from ( [])
    by (8.12.4/8.12.4) with ESMTP id h4JENWtX016165
    for < someone>; Mon, 19 May 2003 09:23:33 -0500
Received: from localhost (localhost [])
    by (Postfix) with QMQP
    id 89F821FAB4; Mon, 19 May 2003 09:20:37 -0500 (CDT)
Old-Return-Path: < me>
Received: from (unknown [])
    by (Postfix) with SMTP id 410B01F581
    for <debian>; Mon, 19 May 2003 09:02:01 -0500 (CDT)
Received: (qmail 975 invoked from network); 19 May 2003 14:01:58 -0000
Received: from unknown (HELO (
    by with SMTP; 19 May 2003 14:01:58 -0000
Message-ID: <>
Date: Tue, 20 May 2003 00:01:57 +1000
From: Stuart Longland < me>

Yaay for timely bounce messages. Let’s see now… sent 20th May 2003, received 6th November, 2007… That is over 4 years and 5 months, for a bounce message. What are they using for an internet connection, RFC1149??  This is back in the days when I ran Debian/MIPS on my Indy, prior to me trying Gentoo.  And back in the days when my internal network used the CIDR (I now use for my boxes).