Latest bloggage

If you keep seeing "Time Machine completed a verification of your backups. To improve reliability, Time Machine must create a new backup for you", this might help...

My Mac backs up my data using Apple's Time Machine backup software, and it backs up to a network fileserver thingbob. It's been doing this quite happily for the last couple of years, but a couple of months ago I would see the following message every week or two, and I would have to re-build my backup from scratch, which usually means leaving the laptop on and connected to the wireless for 18+ hours:

"Time Machine completed a verification of your backups. To improve reliability, Time Machine must create a new backup for you"

Well, somebody else has done all the hard work of finding a possible solution which doesn't involve nuking and re-building your backup, which you can find here: "Fix Time Machine Sparsebundle NAS Based Backup Errors"

Hopefully it'll help you fix your backup if you run into the same corruption problems I do :)


Footnote: there's also some more useful discussion on this Apple forums post.

So it turns out I'm rubbish at keeping this website up to date...

Pretty much as the title thingbob up above says, I've been neglecting this website for quite a while.

But fear not! Because I've been doing stuff elsewhere, so I have a plan; I will put up some links or something to those things and you can click them and...

Okay, who am I kidding? I've been very lazy. Mainly because little things like Life and Work have gotten in the way of Writing Stuff On The Intarwebs. And that's highly unlikely to stop any time soon.

So the updates on here might be sparse, but that's okay, because I'm not really all that interesting, and there are plenty of websites where more-interesting folks can be found.

Until next time :)


Please leave your message after the tone...

I'm a busy monkey right now; I left my job last Friday, I moved out of my flat the Friday before, I've put all my worldly possessions on eBay or into storage, have had a number of jabs for diseases I hope I never catch, and am getting ready to live off four t-shirts, four pairs of pants, a pair of trousers and some flipflops for somewhere between one and six months. Maybe longer. Maybe less long if I really don't get on with the culture shock.

I must get to bed now - tomorrow I'm going to be trying to make my lovely new bergen look like it's totally worthless and uninteresting to thieving types with the help of some spray paint that looks like dirt and plenty of duct tape. Ahh, the life of the traveller...

Here's a bit more about my plans, and how you can contact me in case you need to :).





This is, quite simply, teh awesome:


Greyheaddotcodotukay's cookie policy

So apparently there are some bad people on the internet, and they're offering naive folks cookies in exchange for stealing the souls of said innocents' first-born sons. Or something.

So, in an unusually candid gesture of goodwill, I thought I should point out that I and the team of kidnapped-in-early-childhood slave-labourers employed at Greyhead towers have precisely zero interest in you, your soul, cookies, European cookie law - whatever the deuce that may be - or Ceiling Cat.

This website will almost certainly try to put a cookie on your computer. C'mon, it's a website. They do that kind of stuff - if it was a dog, it would do dog stuff. How many dogs do you see with a mandatory faffin' European Court Of Human Rights warning that they may or may not try to have sex with, wee on, poo on, or roll around in, your personal space?

All this website's poor cookies do is tell this website (not me, you'll note, since I don't care) that you've been here before, and if you're logged in to the site (here's a pro-tip: if you're not me, you won't be. Logged-in I mean, not humped-by-a-dog-with-an-ECHR-health-warning).

In any case, what this cookie won't do - although it probably should - is say "wow, you've seriously come back here for a second time? What the hell's wrong with you that you think that's in any way a good idea?".

... I mean, if web browser cookies could speak. Which they can't. I assume you understand why that is? (If not, there's absolutely nothing I can do to help bridge this educational gap before either your attention span peters out or I die of old age).

Anyway, I think I've covered everything some dusty Belgian law-maker says I have to say... At least, I have in my head: it's not my fault if you're sitting in front of your computer with a bemused expression wondering how the hell you've just been robbed of the last two minutes of your life reading this.

Well, okay, maybe it's sliiiightly my fault but, y'know, it's the internet. Bad things happen. At least I didn't offer you a cookie...


Would you like a cookie?


(Coding) How to resolve a conflict in Git by choosing {theirs}

Very quick aide-memoire for me: to quickly choose {theirs} when faced with a Git conflict, just do:

git checkout HEAD [filename]



Such a waste

Warning: morose, rambling words follow; this is more an attempt at catharsis than anything I particularly care if anyone else reads -- Al

I suppose it's inevitable that, if you travel around enough on the rail network, you're going to come into close contact with a suicide attempt where someone has thrown themselves under a train at some point.

A couple of weeks ago I was on a train passing through a local station when I saw a man crouching less than a foot from the edge of the fast train platform, almost at the end of the platform. It was late at night and there was no reason for him to be there. Going on the way he was dressed, he didn't look like the train-spottery type. I didn't see a camera. It looked, in short, like he had no reason to be there. I remember thinking at the time that he looked out of place. I even tweeted, in some impotent attempt to alert the gods, that I hoped he would maybe get back from the edge of the platform, rather than get any closer to the passing trains. Thankfully, to the best of my knowledge, nothing came of it; I was just being paranoid. That was enough stress for me though, thanks very much...

Flying in the face of my GCSE statistics tutor's warning that just because something rare has occurred - a lightning strike, for example - it can just as easily reoccur, I thought that that would probably be as close as I'd come to seeing someone put themselves in the path of danger on the railway in my presence. Maybe, somewhere deep down, I even went so far as to hope that was the case. I know these things - suicides, accidental deaths, whatever - will happen; I just hoped, like anyone who doesn't slow down at the scene of road accidents and crane their heads round to try and see some gore, that that was it for me, and that I would be spared any more unpleasantness for the forseeable future.

Clearly, my powers to foresee the future are somewhat lacking...

Having just got onto my train to work this morning, about as late for work as I've ever been and therefore on a train I shouldn't have been on, as we pulled into the next station along the line, and with the train almost into the station and therefore moving no faster than a brisk walk, I realised that the brakes were on harder than usual, felt the wheels skid momentarily, and then we stopped abruptly. The doors didn't open, and the driver, whose compartment was just ahead of my seat in the front carriage, jumped out and started looking under the train.

Passengers on the platform almost as one turned their heads to look at something I couldn't see, a couple with hands to mouth. The look of a person who's seen something, but they don't know what; a person no longer standing where they were just a moment ago, as it happened.

Almost as if under water, or maybe in slow motion, everything slid sideways slightly. Standing up, I looked out of the window at the passengers on the platform, as one seemingly frozen in place, unable to decide what to do, looking for an authority figure to take charge. Railway workers working nearby in their fluorescent orange safety clothing suddenly realised what had happened; presumably it was one of them who went to cut the power to the third rail.

I remember commenting, seemingly inanely, to another passenger still engrossed in his book that I thought someone had gone under the train. It was so quiet; no sounds, certainly no screaming. It felt unreal. I questioned my sanity. Was I imagining something that simply wasn't there?

Those of us on the train were stuck; the doors were deactivated, and moments later as the power was switched off, only a handful of the train's lights remaining lit from the train's backup batteries. That's when it became clear that it was really happening. Something had gone very wrong.

The guard came up from the back of the train. He didn't seem to know what was happening either, just knew that something was up. I told him what I had gathered. He pushed on, letting himself into the guard's compartment, locking the door behind himself.

Unable to get out of the train, I called to a person standing on the platform whether they knew what had happened. Their reply confirmed my fears that someone was down there, had gone under.

Still there was no sound, even as people started to stand inside the carriage, getting out of their seats as they realised something wasn't right. A woman in her '60s asked me whether the train would be going soon; I told her that someone had fallen under the train. Maybe it didn't register with her; she responded that it was very important that she got to her meeting. It didn't even occur to me to be angry, or disappointed, or to make a judgement about her response. I just let it pass me; I had to do something, keep myself busy. Didn't want to think about what had happened, how powerless I felt to help.

That's the thing that always gets to me; the times when I've witnessed a road accident, or anything bad happening, where I can't help - I always feel the same absolute need to help, and I always feel completely powerless to do so.

Still, at least I've never run away. God knows it occurs to you to do so, but you're all in it together. Can't shirk the responsibility thrust upon you. Wouldn't be right, would it?

I ended up walking the length of the train, telling the passengers sitting in the gloom what I knew, which wasn't much, just to do something. Minutes later we were able to file off. I was last, checking the train was empty as I went; there were maybe thirty passengers walking up the platform to the station exit, a route which thankfully didn't allow a view of the body. A sideways glance showed me that paramedics were already present, presumably having come from the nearby hospital; one at the edge of the platform at the front of the train with a red-blanketed stretcher, the other standing on the tracks in front of the train.

Exiting the station, I just wanted to get past the people variously milling in the ticket hall demanding to know what the train company would do to ensure they got where they wanted to go, or simply in shock that this had happened in front of them, the back-and-forward exchanges of people simultaneously trying to work out what had just happened, and what to do next.

A lost-looking girl told me she needed to get to Wimbledon. Somehow we muddled our way to the nearby bus stop, making inane chat, both of us trying to avoid talking about the one thing we felt compelled to discuss. She's training to be an accountant and simultaneously studying philosophy, the latter a subject she thinks is a waste. I disagreed, as you do...

That person who decided that they couldn't go on was, to the best of my knowledge, a woman in her '50s. Just "a woman"; her name hasn't been publicly reported yet. It may never be. The saddest thing about this all, as far as I can see, is that, reading the news website article about the incident, a police spokesperson was quoted as saying that they were opening an investigation to identify the woman; did she set out that morning with no identification on her, knowing she was going to finish things in this way?

It doesn't bear thinking about. There's certainly nothing more I can do or say to help her, or her family, if she has one.

Maybe it would be better if it turned out now that she didn't have any family left behind to wonder where they went wrong, how they let her down.

That's the point about suicide, isn't it? It's designed to kill two people, not just the one...


Drupal: strange MySQL "table doesn't exist" error caused by CCK, Features and Strongarm

Ran into a bit of a strange error today; I was getting a Drupal "table not found" SQL error on my live site after pushing an updated feature from the dev site, and then reverting the feature to get the settings back to default.

The query was:

user warning: Table 'greyhead.node_field_instance' doesn't exist query:
SELECT * FROM node_field_instance nfi 
LEFT JOIN node_field nf ON nf.field_name = nfi.field_name 
WHERE = 1 AND nfi.widget_active = 1 
in <noodle foo bar>/sites/all/modules/cck/content.install on line 187.

... So I dived into the CCK module's content.install and line 187 called this function: content_instance_tablename(), which I tracked down to content.module, where the function calls this: variable_get('content_schema_version', 0);

On both dev and live sites, this returns 6009, so the content_instance_tablename() function should return a value of content_node_field_instance, but instead seems to be returning a value which is evaluating to < 6001; i.e. the function returns the old CCK schema table name of node_field_instance, and this breaks any queries which rely on this value.

Putting two and two together, my guess was that Strongarm is over-writing the content_schema_version value in the {variable} table at some point during the execution of certain pages, which is breaking CCK's variable_get call.

So I hopped over to the command line to look into the feature files for "content_schema_version"; cd'ing to the feature's directory, I ran:

grep -irn "content_schema_version" *

... which showed that the variable was defined in the feature:

That Strongarm value

... but that it was providing the right value of 6009. At this point I figured that I was likely to be running into a strange issue being caused by the variable_get running during a variable_set, or some other such voodoo-based weirdness. Easy solution? Remove the field's definition from the feature and allow CCK to look after provision of that variable au-naturel.

So, in the end I simply recreated the feature from the live site (admin > build > features > greyhead settings > recreate) and under the Strongarm drop-down, unticked the checkbox for content_schema_version. Then I re-exported the feature and unpacked it into my MAMP localhost install, did a git commit on the localhost followed by a git push, the over on the server did a git pull, followed by drush cc all and a drush updatedb, just for good measure. Finally, I had to run variable_set('content_schema_version', 6009); using the Devel module.

Touch wood, so far, I haven't seen that error since.

Very odd...


Attached files: 


Just a quick "hello" to anyone passing by who might for some inane reason be worried that this blog may actually be dead; it isn't! Huzzah, rejoice, etc.

The terrible truth of the matter is much more mundane; I've simply not been particularly motivated to write on here when microbloggage is so much more easy and accessible.

Anyway, I'd better get back to work - I'm currently in the middle of figuring out how to debug a strange Apache Solr/Drupal 6/Views 3 issue which is proving very odd...

Ttfn //Al

Amateur geeknote: see which Git repository branch you're currently in at the command prompt

This is a very cool little tip from Lullabot (down the page under "What branch am I on?") for those of you using Git on the command line which allows you to see which repository branch you&#39;re currently in via the command prompt. Simply add this code to the ~/.bash_profile file (or create it if you don&#39;t already have it):

## Bash prompt
function parse_git_branch {
  git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/'

function proml {
  local        BLUE="\[\033[0;34m\]"
  local         RED="\[\033[0;31m\]"
  local   LIGHT_RED="\[\033[1;31m\]"
  local       GREEN="\[\033[0;32m\]"
  local LIGHT_GREEN="\[\033[1;32m\]"
  local       WHITE="\[\033[1;37m\]"
  local  LIGHT_GRAY="\[\033[0;37m\]"
  case $TERM in

$BLUE[$RED\$(date +%H:%M)$BLUE]\
$GREEN\$ "
PS2='> '
PS4='+ '

Open a new Terminal shell and your command prompt should now look a little different. Try cd'ing to a directory containing a git repo and you should see the branch name shown. Handy stuff, innit?

You might want to tweak the colours a bit to suit your tastes; if you manage to break anything, you can always revert the file back (perhaps put it into it's own mini Git repo...?). If you come up with a better colour scheme, please let me know!


Most-mentioned in the blog