HTTP User agent string

When designing web pages we have to be careful of various browsers different ways of interpreting the specification. Traditionally developers read the HTTP_USER_AGENT when the user connects to the server and then send that user content that matches the browsers ability to display. Over the years things have gotten better, Internet Explorer is moving to be standards compliant and thats a good thing.

This recent article points out that Microsoft are putting the words "like Gecko" in its user agent string, so that web servers send them content that is meant for the Firefox browser. Rather than content that was designed for older versions of Internet Explorer. This of course is wrong, claiming to be something you're not could cause other bugs, Microsoft have weighed up the balance of cost/benefits and decided to go ahead. Fair enough, but what is the real solution?

Well whenever you have to do something its best to look around to see what others are doing. If you look over a…

The living wage failure

There has been growing talk of paying a living wage:

The concept irks me, businesses voluntarily paying good wages is like businesses volunteering to pay tax. Many millionaires have stated they don't mind paying more tax, just they don't want to pay more then their peers.

The living wage is the same problem, you've either got to make it the national minimum wage or not bother.

Personally I would prefer to see the wage increased so we can do away with Working Tax Credit which is at the end of the day a benefit from the state to the shareholders of low paying companies.

USB Wakeup

Further to my earlier post on this, I tried setting up a udev rule so I created the following in /etc/udev/rules.d/90-hid-wakeup-enable.rules

# USB hub
SUBSYSTEM=="usb", ATTRS{idVendor}=="1a40", ATTRS{idProduct}=="0101" RUN+="/bin/sh -c 'echo enabled > /sys$env{DEVPATH}/../../power/wakeup'"
SUBSYSTEM=="usb", ATTRS{idVendor}=="8087", ATTRS{idProduct}=="0024" RUN+="/bin/sh -c 'echo enabled > /sys$env{DEVPATH}/../../power/wakeup'"
SUBSYSTEM=="usb", ATTRS{idVendor}=="1d6b", ATTRS{idProduct}=="0002" RUN+="/bin/sh -c 'echo enabled > /sys$env{DEVPATH}/../../power/wakeup'"
SUBSYSTEM=="usb", ATTRS{idVendor}=="1d6b", ATTRS{idProduct}=="0003" RUN+="/bin/sh -c 'echo enabled > /sys$env{DEVPATH}/../../power/wakeup'"
# logitech keyboard
SUBSYSTEM=="usb", ATTRS{idVendor}=="046d", …

Windows Server and the Task Scheduler Error Code 0x3

Wow, so again this is me documenting a problem I've had. Recently I was asked to diagnose a problem with a Windows Server 2008 on which its scheduled tasks were failing with the helpful error 0x3.

So what does 0x3 mean? Well according to Microsoft it means:

"The system cannot find the path specified."


Given that the paths were there and that up until midnight the tasks were running fine this lead to a problem. So I checked the following:

1, Can I run the task manually?
2, Can I run the task in the "Only if user is logged on" mode
3, Has the anti-virus done something?
4, Is there anything in any of the event logs for the last 24 hours that relates to this?

Nothing appeared to offer a reason for the failure. I ended up doing the thing I hate the most and that was scheduling a reboot. Once the server came back up the tasks sprang into life. If anybody knows what happened, please let me know.

IDE's and speed

I am a big fan of the the command line and keyboard shortcuts, however the one thing I've never managed to  do it move away from a graphical development environment. Eclipse, Visual Studio, Notepad++ and in the last few years QtCreator have all delivered exactly what I needed. However I always felt they might not help me work at my best, I always ran compiles via the command prompt and always had a strong grasp of scripting and the ability to reproduce my steps for a build machine.

Editors like vi and Emacs always seemed non-intuitive to me, holding legacy with keyboard sequences such as :w! always grated at me.

So for 2014 one of my new years resolutions will be to find the right text editor for me, starting with the one I use the most nano. I've found some cool syntax highlighting and I've just got to find function lookup or code completion to make it ideal.

One of my new years resolutions - done

So one of this years New Years resolutions was to be an open source developer. As part of that I am spending time writing software, today I created a tool which I know I'll use myself:

Offline Sitemap generator:

Its a small command line utility that allows me to create a sitemap file for my websites. Sitemaps files are used by search engines to know what pages they need to look at. With the advent of access to content delivery networks (CDN) such as Rackspaces Cloud files, it means I can quickly and cheaply use a distributed network of servers to deploy my websites.

If anybody wants installers, then let me know. It should run on Windows, Mac and Linux.

KDE and the Windows key

By default the KDE Application launcher doesn't have its pop-up mapped to the windows key like Windows or Gnome does. This was a a constant pain because I am so used to just hitting that key. I understand that KDE wanted to use the key as a modifier like the CTRL and ALT keys but I already have those two modifiers. So I found this:

Basically I'll repeat the important bit it here in case it gets lost to time:

"unless you configure the Win key, it acts as a Meta modifier by default, and cannot be used as a shortcut. To change this, create a file ~/.xmodmap and put the following in the file: keycode 115 = F14 This makes your system think the Win key is actually the F14 key. Note: different keyboards sometimes have different key maps for the Win key (i.e. on my Thinkpad, the keycode for the Win key is 133). You can use the application "xev" from the terminal t…