Garmin Forerunner 910xt: Delayed, again

The Garmin Forerunner 910xt, which has been due for release for a few months and keeps being delayed, was supposed to finally arrive at my local shop in the UK on 01-Feb-12. It looks like one hell of a bit of kit, and although pricey, ticks all the boxes if you’re ever going to consider doing a triathlon.

So today I thought I’d just check with my running shop to make sure that the date they told me (01-Feb-12) was still on target. They checked, and no… it’s delayed, again. This time, stock is expected to arrive 12-Feb-12. You do have to wonder whether this date is as reliable as all the others, which would be roughly defined as “unreliable”. Still, at least the delay is only (ha!) another 11 days.

The watch was originally expected long before Christmas 2011. Slightly annoyingly, Australia seem to have received theirs a couple of weeks ago. Maybe that’s fair enough; it’s summer down there at the moment, and a bit chilly up here right now, so maybe that was Garmin’s thinking. Who knows. I’m just making up excuses for them now.

Keep those fingers crossed for a mid-February release date.

Fixing HP C4580 Printer Woes

I have an HP C4580 printer, and it’s connected to my home network wirelessly. Wireless printers have to be the most unreliable things I have ever come across. Today was a typical day; attempting to print 4 photos, it took me 45 minutes. And I work in IT, so you’d think I stood a better chance than most of getting the damn thing to work. I honestly don’t know how “normal” people manage to cope with these things.

There were two main problems; first, there was some crazy, half deleted / cancelled job sitting in the print queue that just wouldn’t go away. Turns out, in Windows 7 (yep, I should have used my Mac, I know), you can get rid of stalled jobs by doing two things: restarting the printer and restarting the Print Spooler. The first I’m sure you can work out yourself. Just unplug it, for example, then plug it back in. The second one is only slightly trickier, but still ludicrously simple, in that you go to your Control Panel, then Administrative Tools, and then Services. Find “Print Spooler”, right click it and choose “Restart”. You might need to through this process twice (reboot printer, restart spooler) until it finally clears your jobs.

That should have been it, I’d thought. But it still didn’t work. This time, it was because my PC had managed to get all confused about the IP address of the printer. It is usually on my network at 192.168.2.200, but somehow it got 169.254.134.14 instead. I changed the IP address somewhere in the Printer settings on my computer, but it made no difference. So I just deleted the Printer entirely from my computer and added it back in, within Devices and Printers. After doing that, printing started working again.

It really shouldn’t be this difficult. Goodness knows what happened to cause this trail of devastation. Good luck if you too have a wireless printer.

Verifying Apache htpasswd entries

I’ve been considering converting a web app that I have, which currently uses Apache htpasswd functionality, to allow people to log in with a more ‘normal’ login page, and thus have the app check the password. The thing is, I’ve never quite been sure how the entries are generated because when you generate the same password twice, it gives you two different results. It transpires that this is because the htpasswd utility uses a random salt each time, it’s just that it is not immediately clear from the output.

So, here’s a quick overview of how htpasswd entries are generated, using crypt. Other hash mechanisms are available, but they are a little clearer with their salt, whereas crypt is a little bit unclear (to me, anyway).

First off, try generating an htpasswd value for ‘foo’, three times, and confirm that you get different values each time:

user@host:~$ > openssl passwd -crypt foo
NdvuO3.Ki960s
user@host:~$ > openssl passwd -crypt foo
weaIHa2FdRhR6
user@host:~$ > openssl passwd -crypt foo
/OLzr1ObOaktU

Not much use, eh? Next, look in your htpasswd file that I’m guessing you might already have. Here’s an entry of mine:

bert:abQ9KY.KfrYrc

I know the password for ‘bert’ is ‘foo’, but I know that I can’t replicate that (see above). However, the magic is the salt. It transpires that the salt for a password that has been hashed using crypt is the first two characters in the htpasswd line, so if you look at my example, the salt is ‘ab’, which comes directly after the colon. In other words, the format seems to be:

  • username (variable length)
  • : (fixed length, 1 character, the colon character)
  • salt (fixed length, 2 characters)
  • crypted password (variable length, I think, although does tend to be 11 chars)

Therefore, if we try to generate the password using the salt of ‘ab’, we get the right result:

user@host:~$ > openssl passwd -crypt -salt ab foo
abQ9KY.KfrYrc

Try it twice. You’ll see it’s the same.

XLaunch and Debian Squeeze

Have been hitting my head off a brick wall for about an hour attempting to get Xemacs running on my windows machine via X11 from my linux vm. In other words, I have a linux vm running on VMware Esxi 5, and I wanted to run Xemacs (that is on the linux machine) on my Windows 7 box. I just kept on getting “X11 forwarding refused”.

Now, even getting to the point of seeing that error message was a PITA. I have been attempting to run XLaunch (part of Xming), and it’s pretty damn good, but it was crashing without giving me any output, so I had to run it from the CLI like so:

C:\Program Files\Putty>plink.exe -ssh -X -v user@vmhost xemacs21

When I ran that, I got the error message. I tried in vain to figure it out, and all it took was to edit the /etc/ssh/sshd_config file and add this in:

AddressFamily inet

…and restarting the ssh service after, obviously. And it worked. I shall give my head a rest now.

Alesis io|2, Logic and dropped audio

I used to have problems with Logic Pro and the audio routing through my alesis io|2 device. The problem was simple – everything would be fine for ages, then for no reason, the audio output through the io|2 would stop, and the only apparent way to get it going again was to restart Logic. Annoying.

I discovered one way to resolve it a bit quicker, which was to change the bit rate of the audio, say from 256 to 512, and it would work again. It then occurred to me that the device was losing connectivity to the iMac, so I went to look to see whether the io|2 was plugged directly in to the iMac or whether it was in to a USB adapter, the kind that gives you 4 USB connections from one connection, and it was. I swapped devices round so it was plugged straight in to the iMac, and hey presto – I have never had the problem again!

Therefore, this is a tip for others who might have the same problem…

1and1 Upgrade Breaks Your Site, Blames You

So I host various web sites, including this blog, with 1and1. Over time, I’m becoming more and more likely to move away from them, because I’d prefer to host on a VPS that I control and am not therefore at their whim.

Today is a day when I feel more strongly about this.

One of the sites I host is a simple Perl CGI based site hosting photos of my kids since my eldest was born over 11 years ago. Today (or at some point in the past 2 days), 1and1 upgraded the host and the site broke.

First, the upgrade. They went from Debian Etch to Debian Squeeze. Yep, they skipped Lenny. However, I’m glad they were to Squeeze, because Etch is fucking ancient, and Lenny is no longer the stable distribution. Quite why they didn’t upgrade to Lenny 2 years ago is anyone’s guess.

The site stopped working, I deduced after 10 minutes of adding debug logging, because the environment variable REMOTE_USER is sometimes called REDIRECT_REMOTE_USER. 1and1 sent out a notification beforehand, and in it, they said this:

If you are using very old scripts or software, please note that after
a redirect by Apache, certain internal variables, such as ‘REMOTE_USER’,
will henceforth only be available as ‘REDIRECT_REMOTE_USER’.

Now, I have to chuckle at this. They are blaming my “very old scripts” despite the fact that it is 1and1 who have been running a very old operating system, which therefore exposes environment variables.

Sigh.

So, if you have a bust website and you are using htaccess, as I am, and things are no longer working, it might be because of this. I thought it worth mentioning because it might save one random person a headache.

Downloading using Sky Go on a Mac

OK, so I discovered Sky Go the other day, and it looks pretty useful. The one thing I couldn’t get to work, though, was downloading stuff to watch it using Sky Go Desktop. I use a Mac, OS being Snow Leopard. The problem was that I couldn’t get the download queue to acknowledge that I’d added stuff to my queue from their web site. In other words, on skygo.com I had attempted to download Trollied episode 3, it said it was added to my queue, but when I went to the Sky Go Desktop app, the queue was empty and when clicking “Check Queue”, nothing happened.

I looked down the bottom of the app in the status bar, and it said “Queue last checked: Never”. Hmm. There was a triangle in the bottom right hand corner and when clicking it, said that it had failed to acquire a licence. Odd.

The answer turned out to be something to do with the browser I was logged on to skygo.com with. I usually use Firefox, but what I had to do to get it to work was to totally quit Firefox, fire up Safari, go to skygo.com, log in, then fire up Sky Go Desktop at which point the download queue was filled up correctly.

Quitting Firefox appears to be important; I had tried leaving Firefox running and running Safari at the same time, but this wasn’t making any difference; I could only get the queue to pick up the stuff if I totally quit Firefox.

So, not the end of the world, but a bit of a PITA. Thought I’d mention this here as others will no doubt be having the same problem.

Kayaking

For no apparently good reason, I’ve suddenly become interested in kayaking. Well, I say interested, but in reality it has so far got as far as reading stuff on web sites about how to do it, and where to learn. There seems to be a fair bit of kit needed, but all good things need a bit of preparation, I find. So far, the Imperial College site has a handy list of items, together with an indication of how important they are. So I’ll use that to figure out how much cash I need to spend before I can even get started.

Easy Ajax Push Tutorial

Started having a look at ICEfaces today. Seems ludicrously awesome and complicated at the same time. A good start.

Attempted to run through the easyAjaxPush tutorial, which is here:

http://wiki.icefaces.org/display/ICE/Easy+Ajax+Push

All went sweetly until I got to the first attempt to deploy, and the buttons didn’t appear. I decided to push on and see if they were there by the end, and they were not. However, it transpired that the fix is simple; the XHTML page isn’t being processed as a Faces Servlet. To fix it, all you need to do is add an url-pattern of *.xhtml, such that you have a servlet mapping similar to this:

<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>/faces/*</url-pattern>
<url-pattern>/icefaces/*</url-pattern>
<url-pattern>*.xhtml</url-pattern>
</servlet-mapping>

Note that this only involves adding one line to your web.xml file, don’t add the whole lot, as you should already have a servlet-mapping element for Faces Servlet there to begin with.

Once that was there, the example worked beautifully. It’s a bit scary how simple it is, tbh.

[ Later ]

OK, I’ve since discovered that, instead of adding this element:

<url-pattern>*.xhtml</url-pattern>

…you should instead add this element:

<url-pattern>*.jsf</url-pattern>

Now, this confuses me at the moment, because there isn’t a file with a .jsf extension, but something is doing that conversion for you. In other words, if you have foo.xhtml, you access it by going to foo.jsf and so long as you add in that url-pattern I just mentioned, the JSF tags won’t be ignored.

Virtualbox: cloning a vm just got easy

I figured out earlier this evening how to clone a vm in virtualbox. Then an hour later, they release a new major version (4.1) where you can do this in a ridiculously simple way. Here’s some brief notes on how to do this, without needing to go anywhere near the GUI (not that the GUI is bad, but it’s just ultra-fast in the CLI). Oh aye, and this is done by cloning a guest instance that is running Debian Squeeze. Some of the info is specific to Linux and/or Debian.

First, you need to get Guest Additions installed on your instance. It’s easy; just go to the docs to see how to do it. Doing this will allow you to find out the IP address later.

Next, you want to boot the instance and delete the following file:

$ sudo rm /etc/udev/rules.d/70-persistent-net.rules

This saves your machine getting confused about the network interface of your machine, as otherwise it’ll start without eth0 and with eth1 or eth2 (or higher; you get the idea) instead, and it won’t be configured.

Next, on the server itself, run this to clone it:

$ VBoxManage clonevm "Squeeze" --name Clone --register

…where “Squeeze” is the name of the original instance, and Clone is the name of, you guessed it, the clone we’re about to create. This might take a while depending on the size of your hard disk in your Squeeze instance, and how fast your disk is on your server. Go get some 15k disks; they are awesome.

Next up, we want to get the instance booted, so again from the server, run this:

$ VBoxManage startvm Clone -type headless

It’ll take a minute or two to boot up. Go make a cup of tea. Finally, to get the IP address of the instance once it’s booted, nail this command:

$ VBoxManage guestproperty get Clone "/VirtualBox/GuestInfo/Net/0/V4/IP" | awk '{split($0,a," "); print a[2]}'

That’ll return an IP address, and you can now SSH on to the host (assuming you have openssh-server installed on it, of course; if not, this was kinda pointless).

Gerrit: painful install

Gerrit is a web based code review system, and I decided I’d have a look at it. The install process is not easy, and not documented in such a way that I’d consider simple.

[Note: I later discovered the document that caused my confusion, which is http://en.wikibooks.org/wiki/Git/Gerrit_Code_Review – note that it, at this time, doesn’t contain anything about creating the project on the gerrit host!)

First off, installing the software (v2.2.1) to use MySQL just didn’t work; some unknown problem happened and the stack trace wasn’t helpful. I took the cowards way out and use the embedded H2 database instead, which gave me no such problems.

Next, the questions asked during install were not particularly obvious, if you didn’t know what it was really asking. For example, “Location of Git repositories” – what’s it asking here? It transpires that this is the location that Gerrit wants to store its own copies of the git repositories; or at least, that’s what I think it means. I ended up letting it use the default value which is simply “git”, because then it stores them within its own directory structure.

After this, I figured the documentation would tell me how to set up a new project. I’m not sure what I was originally looking at, but the first thing you need to do is to create a project repository by doing something like this:

ssh -p 29418 review.example.com gerrit create-project –name new/project

One of the guides I used did not have that in the instructions. This was a fail. As in most things, once you know how to do it, it’s easy, but on the basis that the instructions I was first using didn’t make any mention of needing to create a project outwith the web interface, I was stumped.

Now, at this point, I ended up causing myself no end of problems by thrashing around trying to get it to work. I ended up deleting something that I really shouldn’t have deleted, while attempting to get the git repository that I had initially stated in the setup (/usr/share/gerrit) to work. Bad move. Don’t go in and delete stuff in a terminal as otherwise you’ll confused the crap out of the web interface which then doesn’t cope well with things disappearing. So my bad there, but the lack of clear docs on how to get started didn’t help.

After the success of managing to get the new project created, it was relatively plain sailing. You need to create a branch within the web interface, I’ve yet to see any documentation about this but I didn’t look too hard as I figured it out from the error messages when attempting “git push” and from looking at the web app itself. I’ve yet to figure out how the workflow goes when making comments on a code change, but the UI at this point looks pretty neat, so I shall give it more of a chance from this point on (I’d given up an hour ago, judging gerrit to be pish, before my brain refused to be defeated and I came back and got it working).

So, ultimately, if you want to try it out, here’s my tips:

  1. when installing, just use the H2 db, especially if you’re just trying it out
  2. when asked for the location of git repositories, just let it put them in the default location
  3. don’t go changing things in the filesystem after you’ve installed it; a schoolboy error, admittedly, but the tool doesn’t appear defensive enough to say “Oi! you’ve broken something here, mate!”
  4. you need to ‘create-project’ from the command line before you can “git push” anything
  5. you need to create the branch in the web ui before you can “git push” changes on a branch
  6. be prepared for the ui to be green. I hate green with a vengeance.

Other than that, it looks good enough to continue investigations…

Sky+ HD box upgrade: ludicrously simple

So my Sky+ HD box started to collapse on me. In fairness, I had pretty much version 0.1, as I got it just after Sky HD was released. I can’t exactly recall when this was, but it is a few years so no real surprise that the box was playing silly buggers. Ultimately, even changing channel was beginning to be a PITA because it would take up to 3 minutes to register that I had pressed a button on the remote. Time to upgrade.

Two options: do it through Sky, or obtain a box from elsewhere. Seemed a risk to get it from elsewhere, but from what I’d read elsewhere, it seemed simple enough, so I went for it. One Sky+ HD box costing £106 was delivered, and it was time to install.

How easy? Possibly the easiest thing in the world. I unplugged the old one, taking note of which cable went where. The only thing that might have caused a problem was that there are 2 inputs from the Sky dish in to your box, funnily enough numbered 1 and 2, so I just made sure that the cables went in the same way round in the new box. Would it make any difference if they were the other way round? I have no idea, but I decided not to risk it. Anyway, back to the story. Plugged cables in, put Sky card in slot, turned on. Bingo, BBC immediately available. Lots of channels immediately available. Odd, I thought – I’d read that I would need to call Sky to link the card and the new box. I tried Sky Sports, and there it was – that didn’t work. But the message on the screen told me why, and gave me the number to call Sky. So I did that. The dude asked me to press a few numbers on the remote which I did, and asked for some numbers from the screen, and 20 seconds later, Sky Sports is working.

That was it. Simple, eh? It’s rare that an upgrade like this goes so smoothly, so it’s worth mentioning it when it does.

If only Renault were like this… <grumble />

Marathon attempt: fail

Today is the day of the Edinburgh marathon, which I entered, but didn’t run. It all seemed to be going well in my training up until 15-Apr, when, well, it stopped going well.

Turns out I had a bit of a medical issue in April which seems to have knocked my ability to run longer than 2 hours. The first sign of it was that I was running slower than I had been, but not dramatically. Then I had an incident forcing me to go to the doctor, then the hospital variously to get unpleasant things done to me. It’s still not finished; I’m back at the doc tomorrow and back at hospital in a fortnight.

Still, it’s not the end of the world, and I was fully expecting problems to happen. People with MS don’t normally run marathons, after all. I do think I ended up being unlucky this time around, so I’ll just try again next year.

My colleague at work also didn’t make it. I wasn’t that confident about how he’d get on as he was struggling to hit 20 miles in his training and only managed it a week before the marathon, which is far too close to the main race to be running such a long distance, but I realised that, psychologically, he needed to do it. Then 2 days before the race he caught a sickness bug, at just the point he needs to be taking on carbs, not having them exit his body violently. So neither of us were that lucky this time around.

The good thing is that I know some things I’ll do differently next time around. For example, I thought I’d started my training with plenty of time to go, but next time, I’m going to get up to half marathon distances in my training long before I did this time. Considering the marathon was today, 22-May, that’s 20 weeks from the start of the year to train. My starting point was being able to run 10km relatively comfortably. Next time, I will look to be at _least_ 10 miles at the same point, if not further. I want to be able to run 20 miles at some point this year, so I’m going to keep running for now during the summer months mainly so that I can myself hit and smash that psychological barrier of being able to do it. Then, towards the end of the year, get up to 10 miles before Christmas, hit half marathon distance in January and hit 20 miles again by the end of March, but definitely at least 9 weeks before the race itself. Then I can do another two, possibly three runs of 20 miles up to 3 weeks before the race, and then taper down.

At the moment, I’m still feeling quite pissed off at not doing the race, but the three attempts I had at 20 all failed quite badly, and it seemed a surprise at the time because I’d hit 18 with relatively little problems at all. However, it’s not the end of the world and I’ll hopefully still be capable of running this time next year.

Other things to do differently? Don’t get sponsored; puts too much pressure on to do the race. Don’t run up to the top of Liberton; that was just crazy. Run double loops when aiming for the 20 mile distances, meaning that instead of running to Musselburgh and back, just run to Meadowbank and back, then do another 6 mile loop to Gorgie and back. Have not tried that yet, but if I feel totally gassed after 14, then at least I’ll be near home and not have to get bailed out by the wife picking me up in the car. Now _that_ was a psychological kick in the nuts.

Gym. Can I be bothered?

I joined the gym, as I suggested I would a couple of weeks ago. Both times I’ve been so far, I’ve come down with a cold 2 days afterwards. Also, I am now starting to remember why I stopped going in the first place; I don’t do cardio when I’m there (because running on pavements is far more interesting) and I can’t be bothered doing more than half an hour of weights, and even that’s a stretch. So I’m finding it boring, and I also tend to find it does very little for all the effort, whereas I can do certain exercises (squats, for example) without needing to go anywhere near the gym. So I’m already thinking about jacking it in. Terrible, but true. The running, however, I’m going to keep up, because I’m finding it still interests me.

Getting fitter

On the basis that being fitter appears to be doing me some good on the MS front, I today went back to playing football again after a 3 month layoff due to knee injuries, and now I am going to re-join the gym to build up some muscle again. Having a bit more muscle will also help the footie too, not least because my groin is really struggling at the moment because, funnily enough, you don’t need to use your groin in the same way when you are running long distances in a straight line. And having more strength in the legs has, in the past, made a he’ll of a difference to the football. Apparently, there’s no joining fee this month too – win!