Deadnode

New Platform

With the dawn of 2010, I decided it was time to move away from Radiant as the CMS for most of the sites I host and maintain. Radiant does a reasonable job, with a nice simple user interface non-technical users can grasp quite easily, but it takes a great deal of memory and slows down the site being served with all the overhead of going from the web server, through Mongrel or FastCGI into Radiant then rummaging around in MySQL to retrieve all the page components.

Radiant’s caching helped – and, in conjunction with Lighttpd’s mod_magnet facility, I was able to add a simple Lua script which would turn any recent cache hit into a simple static content delivery through Lighttpd, bypassing Radiant entirely – but for sites with very infrequent changes, having over a hundred megabytes (on a server with 360Mb total!) tied up in a CMS whose features weren’t used from one week to the next seemed silly.

In particular, after an unexpected reboot of the server which holds this site and a few others, the two Radiant instances each took over 100 Mb of RAM – which, on a server with 360 Mb total and several other services active, meant hitting swap and several minutes of disk thrashing before the sites were live again.

At the time, I had one Radiant instance hosting the SUE-MoT project website, with a second hosting the remaining sites including this one. With the SUE-MoT project having officially ended some months earlier, there would be no significant updates – perhaps no updates at all – this site was an easy one to migrate: a simple wget command was enough, with a second to retrieve the current sitemap XML file.

For the other sites, more actively maintained, it’s a little more difficult. I decided to migrate this site second; rather than taking a static snapshot as for SUE-MoT, I wanted something that would keep updates nice and simple. A few options came to mind: rebuilding the pages using something like SSI to pull in the common elements, or running the files through a pre-processor of some sort to generate static content to upload.

Enter Jekyll: a simple Ruby tool for generating static content from templates and text files, with Textile support, so I could simply copy most of my content directly from Radiant into Jekyll files, layouts to simplify editing common elements the same way I could with Radiant – all that’s missing is the dynamic content (recursion etc) with Radiant’s inline tags starting <r:.

It isn’t quite perfect – very limited support for generating content such as page lists, and documentation which leaves almost everything to be desired – but it will do the job I need for now. In the longer term, I’ll find or develop a replacement, probably not using Ruby and hopefully having at least basic documentation for all the features. The SUE-MoT site relied on simple Radiant iteration and conditional statements; the Jekyll documentation suggests such things exist but fails to give enough information to use them, which forced me to use wget instead. Fortunately, this site never used those – just a hard-wired list of headings in the page template – and there are clever ways to achieve similar results quite elegantly with CSS selectors which I will use and document in the near future.

Posted on 10 March 2010.

Windows woes: STOP 0x0000007b after changing partition sizes

Last week, I found myself short of space on my Windows Vista partition on my main development PC. Originally, that machine dual-booted Windows XP x64 and Windows Vista x64, each from their own partition on one fast (10kRPM ‘Raptor’) SATA disk, with data living on two other disks. This meant a simple procedure: shrink the old XP partition to a few hundred Mb (I couldn’t delete it entirely, since the Vista bootloader lived there) and enlarge the other partition to fill the new space. Simple enough using any of the partitioning tools; I chose Paragon Partition Manager in this instance.

All fine – until I came to reboot, and was confronted with the dreaded STOP 7B error (‘inaccessible boot device’). Windows was able to load the kernel and associated device drivers, using the simple boot-time drivers, but failing when it came time to mount the file system properly and hook in the filter drivers. Contacting Paragon support and posting in their user forum got me a suggestion to boot from their recovery CD (which fails to boot on my system anyway), then delete both partitions and hope the partition undelete feature would recreate them in working form.

Posted on 28 November 2009.

Google Voice: AT&T's real fear?

Much has already been written about the rejection of Google’s official iPhone application from the Apple App Store. For some reason, Apple – at AT&T’s request, people suspect – refused to allow the application to be offered through the offical App Store, and indeed deleted unofficial applications offering similar facilities which had already been approved previously.

Apple themselves have no apparent motive for rejecting the Google Voice application; even if it used an undocumented interface, which is normally enough to trigger an app’s rejection, Google have done this before (in Google Mobile, with the proximity sensor) and Apple turned a blind eye. It isn’t Apple’s revenue stream Google Voice threatens, give or take whatever cut Apple get under the revenue sharing deal. Apple, on some official level, will have been aware of the unofficial Google Voice client applications when those were submitted, but still approved them, suggesting the functionality did not break any of Apple’s own rules, stated or otherwise.

AT&T, on the other hand, are in a very different situation. It has already been established that they influence the application approval process, which is why the Slingbox client was restricted to prohibit use over AT&T’s network, streaming only over WiFi. In that case, the change AT&T wanted was obvious: they prevented this use of their network, since without installing the Slingbox client you couldn’t stream that video. With Google Voice, the situation is very different: what would AT&T gain by blocking the installed native application, when you can use Google Voice through the web interface anyway? Unlike Apple, AT&T don’t see every single application submitted, only those which attract attention – for example, by coming from a multi-billion dollar corporation just breaking into the voice communication business. Once they started investigating, they would then discover the third party clients doing the same job, and want to put a stop to those as well.

Most analysis seems to assume it’s all about the calls, those precious minutes of airtime charges. Many seem to have assumed – wrongly – that Google Voice is a VoIP service, that Google Voice routes your calls over the data connection just as the (approved) Skype application does over WiFi connections. If that were true, AT&T would certainly have a reason to object – but it isn’t: Google Voice services are regular voice calls. Initiate a Google Voice call via the client application – native or web – and Google Voice triggers a three way call between itself, your handset and your destination, so AT&T get to charge for the minutes of airtime you’re using. It’s an incoming call rather than an outgoing one, but that has no impact on the charges: a minute of airtime is a minute or airtime, regardless of direction! Equally, blocking the application makes little difference: you can still use this feature through the web interface anyway.

Where the difference does matter, though, is text messaging. Sending and receiving text messages via Google Voice does indeed divert traffic onto the data connection, bypassing AT&T charges of up to $20/month – which, of course, are almost pure profit for them. You can still send messages through the web interface and escape these charges – but to receive any replies that way, you would have to have the web page open! Native applications can receive push notifications, which would allow your Google Voice text messages to pop up in exactly the same way as regular messages sent through – and charged by – AT&T. The web interface can’t do that: by blocking the native application, AT&T ensures that only their own expensive text messages have this important feature. Hit ‘reply’ to such a message, and that reply gets charged for by AT&T as well.

The only weakness of this hypothesis is that AT&T have not blocked the Google Voice client for BlackBerry. That is easily explained: where iPhones (unless jailbroken) can only run applications downloaded from the offical Apple store, requiring explicit prior approval from Apple to run – permission AT&T can persuade Apple to withhold or revoke – the BlackBerry simply downloads and installs applications over the Internet. Using RIM’s push notification requires going through their servers and paying them a fee – perhaps AT&T could push RIM to withhold that, but unlike the iPhone case, all this would achieve is preventing them from using push notification, not block the whole application; it also seems likely AT&T have less influence over RIM than they do with Apple in this respect, thanks to the big-ticket exclusivity contract.

Posted on 21 August 2009.

Unsubscribing from McAfee/Network Associates AVERT

McAfee offers quite a useful virus alert service by email – more details here – but unfortunately their mailing list is rather difficult to unsubscribe from. There are no instructions in the body of their emails at all; the headers do contain this promising looking entry:

List-Unsubscribe: <mailto:leave-512213-327810Xlistserv.mcafee.com>@

Frustratingly, however, although listserv.mcafee.com actually resolves and accepts SMTP connections, it rejects all delivery attempts for that domain:

RCPT TO:<leave-512213-327810Xlistserv.mcafee.com>@

550 Relaying denied.

The solution, it turns out, is to change the domain to listserv.nai.com – presumably the domain they were using when they first configured the mailing list software, and the only address it will actually accept. That domain resolves to the same server, 205.227.136.228, but this corrected address will actually be accepted. (McAfee was founded in 1987, then merged with Network General in 1997 to become Network Associates, reverting to the name McAfee in 2004.)

(The numbers are presumably subscriber-specific, so using this exact address will attempt to unsubscribe an old address of mine which has already been unsubscribed. Obviously, you will need to change these numbers to match those in your own email headers!)

Quite why a major company like McAfee is operating a mailing list with no functioning unsubscribe instructions, I don’t know, but hopefully anyone searching for help will now be able to find it, rather than having to guess the correct address!

Posted on 04 June 2009.

If you don't built it, they may come anyway

A perennial problem in maintaining widely-used platforms is backwards compatibility. Windows suffers more than most in this respect, both because of Microsoft’s unusual degree of commitment to backwards compatibility and the degree to which the platform has changed over time, from a 16 bit collection of libraries with cooperative multitasking running under MS DOS on a single 8086 processor with 640k to 32 or 64 bit pre-emptive multitasking operation on multi-core Xeons with gigabytes of RAM.

They’ve had to jump through endless hoops (NTVDM.EXE, anyone?) just to get those old applications running on operating systems created two decades later on radically different hardware. Further hoops, though, are imposed by applications relying on undocumented characteristics of components – sometimes, as Raymond Chen likes to point out, through laziness when someone just can’t be bothered putting in the effort to use the proper, documented method for something – but in other prominent cases like the MSI SlowInfoCache, an undocumented 552 byte binary block which controls how entries appear in Add/Remove Programs, and showing or hiding the Quick Launch bar, because Microsoft chose not to document an official way to do something out of fear “bad” people would use it. Needless to say, this just means they use undocumented methods instead!

Like many battles, there is merit on both sides. Within Microsoft’s walls, logic like Whether the Quick Launch bar is shown or hidden is an end user setting, and programs should not be overriding the user’s preferences. Explorer consciously does not expose an interface for showing and hiding taskbar bands because it would just be a target for abuse has prevailed. Because someone in Microsoft thinks programs (other programs, that is: clearly their own – Explorer, in this case – get treated differently) should not be tampering with this “user” setting, they choose not to make it easy for programs to do that.

On the other side of the fence, however, there are people who need, or at least want, to change that setting programmatically for some reason. Perhaps to impose a standard corporate desktop (many corporate IT administrators seem to believe “user” settings should actually be “Administrator” settings wherever possible, imposed centrally by them rather than allow mere end users any say in their work environments), or to implement some other feature – perhaps even one the users themselves have requested, having neglected to read Microsoft’s memo telling them they didn’t really want that.

The end result, of course, is usually that the feature gets implemented anyway. In the example above, you can use FindWindow to get the handle of Shell_TrayWnd, then send it message WMTRAY_TOGGLEQL (WM_USER+237) with WPARAM set to 0 and LPARAM set to 1 or 0 to enable or disable the Quick Launch bar respectively. Now, in this particular case, sending WMTRAY_TOGGLEQL messages seems unlikely to pose a future compatibility headache for Raymond and co to work around – but there are less straightforward examples out there: the MSI packaging system, for example, uses undocumented blocks of data 552 bytes long in the Registry (values named SlowInfoCache, under Microsoft\Windows\CurrentVersion\AppManagement\ARPCache) to interact with the Add/Remove Programs Control Panel applet. Since this block controls some of the details shown for your application’s entry in ARP, it is hardly surprising that people want to parse and manipulate this data – but being undocumented, how can we know there isn’t some undocumented flag in there which matters? With people relying on direct access to an undocumented binary block, extended that data structure in future will be painful as well.

Undocumented blocks of binary data. Just say no.

Posted on 04 February 2009.

Software and free utilities

A collection of utilities I have developed and released as a public service, including:

TFind - Quickly locate files by name on an NTFS filesystem.

BarPass - Generate sets of random passwords, with the corresponding barcode attached.

GTools - General tools for deploying Windows systems, including copying and moving files from batch files with a graphical progress indicator and changing or deleting drive letters

Bin2H - Convert binary files into character arrays for embedding in C source code.

Trix - Little snippets of code for re-use

Tablesearch - filter HTML tables based on a simple substring search in pure Javascript (no server side code)

EZMLM utilities - tools for automating some more complex administrative tasks on EZMLM mailing lists


Valid XHTML 1.1! Valid CSS! [Valid Atom 1.0]