5 whys on current geo-political situation

I don’t get a lot of chance to write here anymore, but the current geo-political situation has left me without a suitable communications channel, so although it is slightly off topic (although does connect to technology and software engineering), I return to wordpress to voice an opinion that I have not heard voiced before.

I recently read this article by the LA Times, on how the CIA is using the the Paris Terror attacks as an excuse to smear Edward Snowden and Silicon Valley for their privacy agenda.

Former CIA chief James Woolsey said Snowden “has blood on his hands” because, he asserted, the Paris attackers learned from his disclosures how to hide their communications behind encryption. Woolsey thus decreed on CNN that the NSA whistleblower should be “hanged by the neck until he’s dead, rather than merely electrocuted.”

Since the former CIA chief, is going on CNN to voice his (rather weak) assessment of the reasons behind the Paris terror attacks and suitable remedy, I thought I would like to do the same.

However in my version, I will use the principle of root cause analysis and technique of 5 why’s to try and get to the bottom of the situation, as this is a method I am lucky enough to use day in and day out at my job as associate head of technology in Razorfish to uncover failure scenarios in different software projects and get them running more smoothly.

So, what follows is highly subjective and controversial (and I also go over the limit of 5, but sometimes you need to). Enjoy.

Problem  : One hundred and twenty nine people were killed in Paris on the 13th of November. Why?

Answer :  Because extremists murdered them.

Problem : Why did extremists murder them?

Answer : Because they were trained and ordered to do so.

Problem : Why were they trained and ordered to do so?

Answer : Because the group of extremists they belonged to decided they needed to retaliate against the French government.

Problem : Why did the group of extremists feel they needed to retaliate against the French government?

Answer : Because the French governments has performed air strikes of various territories in Syria and Iraq over the last 1.5 years, also killing unknown numbers of soldiers and civilians.

Problem : Why has the French government performed air strikes of various territories in Syria and Iraq over the last 1.5 years?

Answer : Because they are part of a coalition of western nations fighting an extremist movement.

Problem : Why is there a coalition of western nations fighting an extremist movement?

Answer : Because this region of the middle east became extremely unstable and a breeding ground for extremism since 2003 (probably longer but this is out of scope).

Problem : Why did this region of the middle east become unstable in 2003?

Answer : Because a coalition of US and UK forces, invaded Iraq and destroyed it’s government/dictatorship and a lot of infrastructure.

Problem : Why did a coalition of US and UK forces invade Iraq in 2003?

Answer : Ok, so this is probably most contentious of all, at the time the invasion was supposedly about defence, and the claim that Iraq had weapons of mass destruction, however in the time since then, this has been shown to be untrue and the more likely motivator of the Iraq invasion was actually commercial reasons. Iraq has the second biggest known oil reserve in the world and having a competitive oil market not dominated by one group/country is a big plus for a market driven economy. Although, many scholars agree the war was not directly to ‘steal’ oil, the underlying premise of creating a consumerist nation in the image of the US with significant oil wealth happy to trade for luxury goods and have it’s natural resources willingly depleted and it’s government and social policies influenced by wealth and the global elite would act as a signifier to other nations in the region to follow suit and encourage overall prosperity in the US and west, whose economies at this point were in stagnation.

SO, my answer to this one can be summed up as : BIG OIL :)

The CIA chief above suggests that the solution to the terror attacks is to murder Edward Snowden and remove privacy from the software of the world.

With my slightly more in-depth (but by no means exhaustive) analysis, my root cause analysis suggests that having a market economy over dependant on one natural resource (in this case Oil) can cause global instability.

Advancing decentralised alternative solutions to oil (electric cars & infrastructure, renewable energy for example) would alleviate this addiction and add redundancy and resiliency to the market economy. This in turn would remove the need to practice ‘work arounds’ in the middle east and ensure consistent resource flow into the economy. The lack of interference in the middle east would begin to allow a lasting government and increase stability there (think wound that you keep itching, which doesn’t heal until you stop itching) and this stability in the middle east would in turn lead to stability and lack of extremist attacks on western cities.

Preventing this in the long term might involve a system to identify highly sought after natural resources that have the potential to spark conflicts and investing in a system to ensure there are always decentralised alternatives.

It’s pretty straightforward when you think about it, and there are a lot of possibilities. I’m damn sure murdering one person and removing some code from computers will not create a useful or even lasting effect. I suggest you ignore the calls of this clearly incompetent and former director of the CIA and if you want a  fuller understanding, I would recommend reading Peter Senge’s ‘The fifth discipline’ to aid in understanding of the systems theory involved in all this.

force Grunt to fail when source files are not matched

Grunt is a great build tool and has revolutionised the way front-end developers work. However recently I discovered a drawback using the file function from the core of Grunt.

The problem stemmed from a project which had been moved around and refactored heavily, when moving from one build system to the next, various files and directories needed to be moved and restructured. As part of this some directories had moved and changed places. In the process the Gruntfile had also been refactored with the updated directory path.

That’s when the troubles started. The new build, built, but the files it built, just didn’t work. After some digging, the team discovered that some of the files that were being copied, and minified, were not actually being copied and minified on the build system. Everything was included when building locally on the OSX, but when the build was compiled on the remote CI system, something was going wrong.

The cause was our old friend case insensitivity on the OSX.

You see OSX, unlike other flavours of unix will tolerate incorrect casing on directory names, this means if you reference a file with the wrong case it will work on mac whereas it wouldn’t work on another linux system.

Take the following example :


can be referenced on OSX as :

/tmp/jQuery/jquery.min.js OR /tmp/jquery/jquery.min.js

In of itself, this is not actually a problem, until you discover that as part of the default behaviour, Grunt, FAILS SILENTLY when it cannot find a reference to a file. It appears to be a contentious issue in Grunt land as some want it to remain so in order that they can glob for files and if none are returned carry on as normal.

However from my point of view with complete file paths, it seems stupid to return success when the file is missing.

After much Googling and reading Git issues and stackoverflow, the work around seemed ugly but straightforward. If you don’t want Grunt to fail silently on missing files you can include this code in your Gruntfile.

var gruntWarn = grunt.log.warn;

grunt.log.warn = function(err) {
if(err.indexOf("Source file") !== -1 && err.indexOf("not found") !== -1) {
} else {


Basicallly you are intercepting the standard warning function, listening for missing file errors and failing the build if you find them, or passing the warning through to the old warning function if it’s not what your looking for. Not pretty. Probably should be in the Grunt core. But that’s software sometimes.

sleep monitor only by code mac osx

Visualising your progress by having monitors running, displaying automated testing runs, is a valuable tool in software development.

However, one concern that arises when adopting this approach is the use of energy. Powered off monitors are cheaper to run than powered on monitors, there’s no argument there.

Showing this progress during the day though is valuable so we do it, but there is something we can do something to minimise our environmental impact, turning off those monitors automatically at the end of the day and switching them on automatically. Not only does this help save energy but it also is a prompt for developers to go home, a central part of sustainable pace of development.

So we have a mac that turns on at 8am and off at 8pm which has a selenium slave that runs our tests in firefox on it.

Problem is using the normal, mac sleep schedule crashes the running selenium slave. So every time we come in in the morning we have to restart the slave. Not great.

Being programmers we decided to fix this with code. The best approach seemed to be, to only switch the monitor off not sleep the whole system. Next problem is macosx doesn’t by default let you do this. So we had to solve it by creating a launchd deamon to run an ssh script on the mac at 8pm.

The bash script (screenSleep.sh) we stored in a local directory and looks like this:

WAKEUP=$(date -v+12H "+%m/%d%/%Y %H:%M:%S")
echo $WAKEUP > /tmp/screenSleepWakeupTime.txt
pmset schedule wake "$WAKEUP" > /tmp/screenSleepOutput.txt
sleep 5
pmset displaysleepnow

Basically, it takes the current date, and adds twelve hours (8pm->8am). Then it runs the pmset command to schedule a wakeup. Then it waits 5 seconds to give the system a chance to catch up. Then it sets the display to sleep.

The launchD daemon looks like this and was stored in /Library/LaunchDaemons/de.razorfish.displaySleep.plist :

<?xml version="1.0" encoding="UTF-8" omit-xml-declaration="yes" indent="yes"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<string>/Users/{your user}/screenSleep/screenSleep.sh</string>

Important things to note:

<string>de.razorfish.displaySleep</string> has to be the same as the file name.

The script has to be saved by root as it will be run as root, only root can run these commands.

To load the launchD daemon you need to run:

"sudo launchctl load /Library/LaunchDaemons/de.razorfish.displaySleep.plist"

If you want to see if it loaded run :

"sudo launchctl list"

If you totally fuck it up don’t worry, run “sudo launchctl unload /Library/LaunchDaemons/de.razorfish.displaySleep.plist” and start again.

How to reboot your organisation culture

I was recently reminded of some consulting work I did last year, for a large well established company that was looking to reboot its technical unit to meet the challenges of competing with the modern day giants like Google or Apple.

Recommendations ranged from small tweaks to large overhauls, but there was one recommendation I felt was most important to the company. It was about developing a vision for the unit, something they could all stand behind but also interpret in their own way.

This straightforward principle turned out to be pretty sticky as it was viewed by the client as ‘fluffy stuff’ which had no practical realisation.

Fortunately timing was on my side, the German world cup victory was fresh in everyone’s mind and a story was circulating in the English media which caught my attention in the form of an article on a British airways in-flight magazine, called ‘How Germany reinvented football’.

Expecting the typical ‘hero’ above all odds narrative that the press tends focus on to attract readers, I was presently surprised by an anecdotal and factually led piece. It focussed on the well researched, planned and executed structural changes Jurgen Klinsmann had introduced into the German national side to focus on training, commerce, organisation and vision.

Fascinated, when I got home I did some more research and read further around the subject. In one bbc article I found the masterstroke behind what he had done that had made his restructuring so successful.

…but we still had to decide on our playing style.
To do that, we quizzed everyone we could.
We held workshops with German coaches and players, asking them to write down on flip charts three things: how they wanted to play, how they wanted to be seen to be playing by the rest of the world and how the German public wanted to see us playing.
If we could define all of that, we thought we could lay out how we wanted to work and then, from there, sort out the training and paperwork behind the scenes.
What we ended up with amounted to 10 or 12 bullet points laying out our proposals. We then announced that it was our intention to play a fast-paced game, an attacking game and a proactive game.
That last term was something the Germans did not really like because they did not really understand what proactive meant. We just told them it meant we did not react to what our opponents did, we played the way that was right for us.

As soon as I read that I realised Jurgen had been to ‘Agile’ school and knew exactly how to reboot an organisation, build consensus and align vision, whether it’s a football team or a hospital or a software development organisation.

Armed with my new found anecdote and practical application I returned to my client to show him how he too could be the Klinsmann of his technical organisation. This of course ended in him telling me that he was running a company not a football team and the two were completely different.

Luckily for me, a lesson learned and a great anecdote is worth more than hollow victory.

Displaying automated test runs

It’s important to display your progress, this is a key tenant of lean and agile and is the underlying principle behind things like scrum or kanban boards.

As software developers we tend to hide all the clever things we do with code to only our screens, which often hides or mask problems but also robs the world or the rest of our company of seeing the great things that we can achieve with computers.

One anti-pattern i’ve encountered is to have an automated build running which runs selenium tests in the browser on a screen that is not visible to the team or on a monitor that is turned off.

The visual information of watching tests running in the background is useful, if a test hangs maybe you spot it while walking past to get a cup of coffee, if a test passes but the screen looks broken, maybe it catches your eye while on your way to the toilet.

The passive information is highly valuable, and provides a sense of progress, visibility and ownership to the tech team. Plus they don’t just sit around looking like they are surfing hacker news all day.

Can we have a basic wage in our companies?

In his later tenure as Apple leader Steve Jobs famously only took a salary of one dollar. The message? He was there for a love of the company not financial gain, and every employee should be there for the same reason. The fact that he owned billions in stock in Apple and various other enterprises giving him a comfortable cushion should his fortunes ever change and one of his risks backfire was rarely mentioned, but Continue reading

open letter to the British government on privatisation of the NHS.

Mrs. Thatcher was wrong, the markets are not the answer to everything.

Something’s work well with markets, somethings get caught in a race to the bottom, the NHS is one of them.

The core issue is the incentives are wrong, when you have a privatised NHS the incentives are and always will be money.

Not people.

A key decision has to be made, what is the core incentive of the NHS? Money or keeping people healthy? One of these focuses on the short term one on the long.

When money is the core incentive then people will stay sick. A company that makes money when people are sick, will keep making people sick, so they can continue to make money! If they cure everyone then they will have no way to make money anymore so it’s obviously not in their best interest, there’s no escaping the core incentive of a company. No matter what regulations you throw at it.

However an organisation where people are the main incentive, where the organisation is incentivised by people. Measured over the course of their life how little amount of time they are sick, then people will start getting better as the incentive will move from treatment to prevention.

A privatised NHS will fail, because at it’s core it’s got the wrong incentive.

Thoughts on the British political system.

If we managed the English football team, like we manage government, every time we lost a game, the entire team and the manager would be swapped wholesale with the reserve side for the next game. In what universe does that make any sense!?!

We really need to find a better way to manage government.

Simple principles built on solid foundations.