Monthly Archives: September 2012

A weekend with many impressions

I have just had a nice weekend, where I visited Aalborg Kaserner, went goose and duck hunting two times in Thy, went to my grandfather’s birthday in Øsløs and ran in the – now famous – windmill plantation near Østerild.

My brother, Christian Toft, is a volunteer in the 1st Logistics Battalion in the Danish Defense. My family and I visited him and his colleagues on September 22, 2012, where Aalborg Kaserner hosted an “open house” event. It was an interesting day, where Christian told us about daily life in the barracks, we tasted their field rations (not bad at all!), and we saw a fine parade, a series of exercises and a variety of hardware. If I was 18-20 years old again, I would volunteer – not to be in the military for life, just to work out, be in nature, learn about first aid and shoot some rounds with machine guns. Nowadays they have wifi in the barracks, they can play badminton and other sports in the evenings, they can borrow mountain bikes for free, they have modern sports clothing, their participation in some external sport events, e.g. Xtreme Mandehørm, is supported financially, and the gender distribution has improved a lot.

My father and I went hunting in the evening of September 22 and in the morning of September 23. It was with dogs, waders and 12 gauge shotguns. We believe that the evening hunt should have presented the best chances, since the morning weather was too fine (sunny and no wind), but we ended up shooting a goose each on the morning hunt. I shot a greylag goose and my father shot a pink-footed goose. It was much easier to pluck the feathers of his goose, I promise you!

My grandfather’s birthday was celebrated with very delicious pork roast followed by an equally delicious dessert consisting of old-fashioned apple pie, cookies and coffee. The best part, of course, was to be with family and hear how everybody was doing. This time we were reminded by the old days and some of the family roots, as we browsed old photo albums.

Being near a fine, green, moist forest of course prompted a run, so I ran 8 km. For fun I did it in 2 km pieces, letting my heart rate decrease to 120 bpm between each piece. It is when you race up your heart rate you improve your fitness (…and when you work out very intensely, but racing your heart rate up several times should be better than just keeping it at 70-80% of your max for a long time). I try to force myself to only increase my weekly distance by 10% each week, to avoid the almost unavoidable breakage that haunts most runners. Recently, I have signed up for Copenhagen Marathon on May 19, 2013, and I really, really, really want to run it this time. My FiveFingers experiment goes well – I enjoy wearing them while weight training and I am able to run 5 km in them without pain (even on asphalt).

Helping people

Okay, I know I promised to write some stories to the pictures in Pictures tell stories, but that will either happen later or never…

Here is a feel-good episode from work – or at least related to work.

A guy asks on the channel #bsd-dk on EFnet for a piece of software to receive UDP packets and forward them to a number of hosts:

09:28:46 <some_guy> hmm, can anybody recommend something from
                    /usr/ports that can receive udp packets and
                    forward them to multiple hosts?

Nobody suggests anything, and some people, myself included, jokes that it will only take a “few” lines of Perl, Python or C to do the trick.

While waiting – at work – for nodes to be drained in our loadbalancer and Tomcats to deploy, I read up on sockets, putting sockets (and file handles) in an array/hash and registering a signal handler, and I write this proof of concept UDP forwarder:

A few moments later the guy responds:

11:49:19 <some_guy> toft: perfect, it works just fine. directly
                    into production it goes. thanks :-)

Of course, in retrospect, the operating system’s kernel does housekeeping of sockets when a process dies, so the lines 6, 15-23 and 31-33 are not strictly necessary. In conclusion, a “few” lines of Perl in this case is equal to 31.

The forwarder in action: