Democracy is a Farce

19 September 2014

Democracy, in the forms it's employed across the globe, is bullshit. The concepts and ideas are great, but when it boils down to the nitty gritty - actually running a country in it and it's people's best interest - the system fails. The reason for this is because politicians don't do what's best for the country and voters, they do what they believe will gain them a point or two in public favour. Or they work on creating law tailored to the 1%, pushed by lobbying groups, donations and (very likely) all kinds of backhand deals. Sadly, these actions are normally in direct correlation to the countries overall interests.

Take my homeland, the UK, for example. Europe is a hot topic here currently with a worryingly large proportion of the population wanting to exit. The problem is people generally aren't wll versed enough on the subject to make that decision - Europe is essential to our economic power. Yes, we can leave and keep up the various trade agreements - but do we really think the other EU countries will allow this? So, the great Cameron, thinking not about his country or economy, but his popularity alone, offered up a referrendum to the UK population: are we in or are we out of Europe? I, for one, desperately hope we vote in - but it could go either way.

Another example from the UK, and a real sore issue for students - the other great leader, Cleg, promised during his election run and coalition development that university fees would not change. Oh really, Mr Cleg? Now that they've been trippled, it certainly seems like you were bullshitting the whole country to get votes. No wonder your party has plummeted to the bottom of the serious-players ladder, where it deserves to remain.

Now for America, the land of the (supposedly) free. Through an over-complicated and potentially corrupt voting system, the great Obama has been sworn in twice. Now, Obama certainly had some excellent ideas (Medicare) - but the rest of the government (particularly the Republicans) decided that free/affordable healthcare for the majority of the country was... too expensive for the top of it. Seriously? In what world is that democracy.

To be fair, Obama has made his own fair bit of bullshit - check out this list of 23 failed promises. I particularly like this one:

My administration is committed to creating an unprecedented level of openness in government.

-

So what is there to do? I've only looked at two countries but I'm certain these problems affect pretty much every democracy in existance. Here are my (naive) suggestions:

  • Use proportional representation across the whole country. Yes, you're meant to vote for your local/regional official - but everyone knows we vote for the leader.
  • Allow top leaders to only ever serve a single term running the country. This stops their desire to become popular for the next election run, and allows them to focus on the job in hand: running the country for it and it's people's best interests.
  • Ban/limit the money parties can receive for election campaigns - democracy shouldn't be a contests of whose got the deepest pockets.

Learning to Chef

05 April 2014

Over the last three months I've been learning how to cook with Chef. Prior to this I have stuck faithful to bash scripts for provisioning servers, and Chef/Puppet/Ansible/etc all claim to make this job a whole lot easier. Having now used Chef extensively, I can for sure say it does not make the job of deploying easier.

My first encounter with Chef was when working in a Vagrant box to deploy a simple Django app and a couple of email related services. The first thing I noticed when reading through the recipe was that each block could easily be written as a single line in a bash script - it seems like writing a lot of extra code because it's simply easier than writing it out in bash (with all it's pitfalls). Nonetheless I ploughed on and after a few weeks was writing my own Chef scripts to deploy other services. Then the real problems began.

One great feature of Chef is the ability to include other peoples recipes, taking away a lot of the hard work. However on multiple occaisions I've included recipes which either 1. no longer exist or worse 2. references packages/other recipes/files which don't exist. Not only is this frustrating to deal with, but trawling through Ruby's awful tracebacks is certainly not enjoyable. Finally is the attribute system, with a nice and simple fifteen(!) levels of attributes, which require some serious studying to learn by heart.

In my experience all of these problems result in one thing: a decrease in developer productivity. We're not fighting with wierd configs & bash scripts, but instead spending days debugging Chef code. I'm 100% certain I could bash-script deploy anything (including groups/multiple servers) quicker than I could with Chef.

Thankfully there are many other options, such as:

  • Bash: still my favoruite - extremely powerful & flexible, great for deploying/installing single machines
  • Fabric: is like an enhanced form of bash using Python
  • Ansible: great for keeping consistent configs across larger groups of nodes

pngquant vs pngcrush vs optipng vs pngnq

14 January 2014

A couple of days ago I saw pngquant appear on Hacker News. I'd never really looked in depth into image compression, and after reading up on the subject I scanned through the comments on HN, discovering a number of alternative png (and other formats) optimisers. So I decided to benchmark/compare pngquant, pngcrush, optipng and pngnq.

Setup

Images: I tested a number of different images, some of which you'd be insane to render in PNG and more that make sense. The images vary greatly in size, colors and alpha channels and should be a good test for each of the optimisers. To ensure a fair test I opened & exported all the images with Photoshop, to give them all a consistent encoding algorithm.

Optimisers: I used the latest stable copy of each: pngquant 2.0.1, pngcrush 1.7.70, optipng 0.7.4 and pngnq 1.1.

Commands:

pngquant --speed 1 *.png
pngcrush <name>.png ../after/pngcrush/<name>.png
optipng -keep -o7 *.png
pngnq -d ../after/pngnq/ -s 1 *.png
Read more →