Posts

Some experiences with Puppet

For political correctness I will use the term Chefpet for either Chef or Puppet. At Mendix we are now managing quite a lot of servers. They are all very similar. Over the last year we've set up about 200 new servers with the same bash script. Whenever we updated the script, we pushed the changes to the existing servers using Fabric. From the start we anticipated and indeed soon ran into an issue: "This will not scale." Everyone in the devops field, or in a startup that grows too fast, will tell you that you require a tool like Chefpet or if you are very brave CFEngine. So, this week we decided to give Puppet a try, next week we'll try Chef. We're probably going to write up on this on the Mendix Tech Blog, but I can already tell you this: When I first read someone comment " So, if you're in the market, good luck making your choice. I'm not making a recommendation here because, quite frankly, I wouldn't recommend either to anyone other than ...

Finally found the tomato router settings for laserjet 10xx firmware!

Hurray! I've updated the original post at:  http://programmerstrouble.blogspot.nl/2011/01/hp-laserjet-1018-or-equivalent-print-to.html

So you think you can Vim?

I love vim. After giving it my best for about a week I was getting more productive than in previous editors for writing code like javascript, python or bash. Unfortunately, I also love statistics. Have I really improved my editing speed? If yes, how much? It's difficult to tell really, because I have not kept statistics. I've been using it full time for over half a year by now and I keep picking up new things. Today for example, I added a mapping to F2 to let python run the current file! nnoremap <F2> :w<CR>:!python %<CR> I am absolutely sure that this saves me quite some time when developing python. However, it makes me wonder: how much more functions are there that I am not using? I use macro's, tabs, buffers, replacing, searching, jumping, the . key. What am I still missing out on? What do the real vim masters use that I don't? What would be great is when apps like have something like a statistics plugin that keeps track of which functions ...

Google Code Jam 2012 - My solutions for the qualification round

I participated and managed to find reasonable solutions for A,B C en D-small. I code in Python, as its compactness and focus on sets, dicts and lists are great for coding challenges like these. They read input from stdin, so a command like cat input | python program.py prints the output to your terminal. A - Speaking in Tongues B - Dancing With the Googlers C - Recycled Numbers D - Hall of Mirrors I'm not proud of this solution, but it got the job done. It's not elegant and it only works for the small set. (The only mirrors are the ones on the sides). It works by tiling mirrored versions of the original map to cover.

java.lang.Thread considered harmful

As Moore's law seems to be moving horizontally instead of vertically these days, most CPU intensive programs have split up their logic in threads so it can be run on multiple cores simultaneously. This seems appealing, but for the programmer it is not. It is no wonder that thinking in parallel operations results in more bugs, as there is only so much that a programmer can mentally keep in his head. Consider this engineering comparison: No matter how fast you make a train, it has to stop at every station where passengers have to be picked up. This is annoying for the passengers who have no business at the current station. This is the serial way of doing things. Recently a parallel alternative was proposed that would allow trains to never stop moving. It is a simple idea that no doubt has popped into many an engineer's brain in the last 150 years: passengers start their journey on board of a small train that will match up to the speed of the “main train” and passengers will be ...

NS API: stationslijst naar een array

Om de lijst met stations direct uit het geheugen te kunnen gebruiken plaats ik twee arrays: codes[] en names[] in mijn code. Het converteren van de api xml output naar twee plaintext arrays was een aardige klus die steeds vaker terugkwam, omdat de NS nieuwe stations bouwde. Ik besloot om een script te schrijven. Het was zonder twijfel veel mooier om een parser in een mooie programmeertaal te schrijven, maar de oefening met pipes en de commandos sed, awk, grep, paste en cut was leuk. Het script converteert uppercase stationscodes naar lowercase, internationale karakters (umlaut etc.) naar normale karakters en haalt enkele stations zoals "Utrecht" weg omdat er ook al een "Utrecht Centraal" bestaat. Ik besloot verder om namen als Munchen te schrijven als Munchen (zonder umlaut) om het typen te vergemakkelijken. #!/bin/bash cat ns_api_stations.xml | grep code | sed s/\<[\/a-z]*\>//g | sed 's/^[ \t]*//' | awk '{print "\"" tolow...

Moving to Google's App Engine

I transitioned the social analysis application to http://socialgraphanalysis.appspot.com/ last week. It turned out to be quite easy. What I came across was this (among others): When the application is being developed, database structures change often. In MySQL I could select my old data and convert it without much of a hassle. The kind of queries that you can run on App Engine are so limited that the old data and the new data cannot be properly distinguished. In the end, I added a version attribute to all my entities, so that I could later do a "SELECT  * WHERE version = '3'" to perform a transition.