Apache Redirect Permanent and ProxyPass

July 02, 2010
You have a Apache running and you have a permanent redirect configured. For example;
Redirect permanent /subfolder/ /
This would redirect www.yoursite.com/subfolder to www.yoursite.com.

Then later on you to add proxy config:

ProxyPass / http://localhost:8080/site/
ProxyPassReverse / http://localhost:8080/site/
ProxyPassReverseCookiePath /site /


But after that your redirect fails. It turns out that ProxyPass config overrules Redirect. Add exclusion to the ProxyPass to fix this:


ProxyPass /subfolder !
ProxyPass / http://localhost:8080/site/
ProxyPassReverse / http://localhost:8080/site/
ProxyPassReverseCookiePath /site /


Note that the exclusion is before others.

Frame rate tool for OS X - ReelSnail

June 28, 2010
I have been experimenting with both DSRL video and Objective C. The result is a simple tool to modify the frame rate metadata in Quicktime h.264 files. This kind of tool is handy when I need to import 60fps file to 30fps or 25fps iMovie project. This results nice slow motion effect otherwise hard to achieve in iMovie.

The project is based on Python script that did the same in command line. But I wanted to add a OS X native front end and I also wanted learn Objective C so I decided to rewrite the whole thing in Objective C. I managed to get most of it working in a weekend. I had one old Cocoa book (Hillegass - Cococa Programming for Mac OS X) and Apple's online guides. XCode and Objective C were pretty different compared to Eclipse and Java but I managed to get my head around some of the concepts.

Another new experiment for me was to use Git for the project. I used GPLv3 for the project because the original Python version used that. Being open source project it was possible to set the repository to GitHub for free. Having gone through some nasty merges in SVN I wanted to try out distributed approach. In a one man project there is not too much to merge but I was curious to try out Git tooling. I ended up using both command line tools and GitX.

ReelSnail project wiki
ReelSnail downloads

Moved back to Edinburgh

May 07, 2010
We left Kirkcaldy a month or so ago and moved back to Edinburgh. The new flat is in Leith so the area is somewhat familiar. Quite many things changed though.

This new flat is reasonably new, it has some modern comforts like dishwasher and double glazing. Hmm... I must have spent long enough in UK because I am mentioning double glazing as an extra. Anyways, nice and modern flat with some sea view. I think I should write down an article about flat hunting and related matters. At least I have experience from three different occasions.

Otherwise life is pretty much same here, I am still working in the same company developing open source Java CMS. It will be published soon but the exact date is still unclear at least for me.

Hacking Canon IXUS 60

March 27, 2010
I got some nice features like time lapse shooting and it wasn't even difficult with CHDK. Full story at Apertoire blog.

Experimenting with analog technology

March 14, 2010
I wrote some thoughts down after photographing couple days with Asahi Pentax Spotmatic F. That is a film SLR camera from the 70s. Read it from my photography blog.

Media convergence, publishers and Apple iPad

January 27, 2010
Today I checked what is the Apple's new iPad all about. A very nice looking tablet as expected but I was more curious how the content available for iPad will look like. This device comes with browser so normal web content is available as usually. Books, tunes and videos are sold via Apple's own stores. But the announcement featured 'The New York Times' app and that shows where the progress is taking us.

Traditional web or mobile optimised version of the print publications wont cut anymore. Some publishers have announced their own iPhone application but many of them are simple page flipping applications. Not much difference to PDF reader. Seamlessly embedded videos and photo galleries are not that common as one would expect. Especially when new devices like iPad support much larger screen and computing power than previously so they should be able to handle them easily.

At the moment many of those magazine or newspaper reader applications are free with their content but paid content will definitely become more popular. Instead of subscribing or buying physical printed magazine you would receive an access to the extra content - all edited and formatted in a single package. Simple 'subscribers only' area with content snippets lying around might have been the way to do previously but now users are expecting much more elegant presentation. I see iPad and similar devices as premium content platforms and their users are already used to pay for applications, videos and music.

There are two sides of the iPad publishing - a CMS and a reader. Recent development on digital photography has enabled photo reporters to shoot both stills and video - actually they expected to do so now. Presenting this variety of media formats is not straightforward. Publishers had to find way to add all this content in to their sites and I can imagine how their CMSs are being pushed against the limits. Publishers need to have highly flexible content management system that handles vast amount of different media formats and is able to transform them to another (i.e. downscaling videos). The same content needs to be available for normal web, lightweight mobile devices, smart phones and now also for tablet. The extra effort and cost required for each platform version should be minimal.

The content reader can be either the standard web browser or a custom reader application. Publishing content for specific application allows much more freedom for layout and media formats. is an example of how a digital magazine would look like in the future. Developing such reader application is not trivial task but I assume iPad SDK has some new features supporting this. Unfortunately the documentation is available only for members of the iPhone Developer Program.

As Apple did not announce their own de facto reader for rich content there is now an open space for iPad developers to conquer. The solution offering the intuitive user interface on iPad, excellent performance and seamless integration with content management systems will be a winner.

Some file organizing with Python

December 09, 2009
It has been a while since my last Python session but couple days ago I had a perfect opportunity for some Python scripting. The initial situation was that we had tons of files in a single directory. File names were UUIDs so the idea was to create subdirectories and move each file in right directory. We planned to have three levels of directories based on the first characters of the filename. So something starting with 4c14 would go under 4/c/1/.

I implemented this in two parts. The first part created the required directory structure:

import os

workPath = "/tmp/test/"
for a in range (0, 16):
   os.mkdir(workPath+hex(a)[2:])
   for b in range (0, 16):
      os.mkdir(workPath+"/"+hex(a)[2:]+"/"+hex(b)[2:])
      for c in range (0, 16):
         os.mkdir(workPath+"/"+hex(a)[2:]+"/"+hex(b)[2:]+"/"+hex(c)[2:])


The next part was to move files to the corresponding directories. This was also quite straightforward but I had problem with os.rename and I had to replace it with shutil.move. The original script worked fine on my home computer but the development server had the source and destination directories in different filesystems. Here is the final version:

import os
import shutil

sourceDir = "/tmp/files/"
destDir = "/tmp/test/"

filenames = os.listdir(sourceDir)
for filename in filenames:
   sourceFile = sourceDir+filename
   print(sourceFile)
   destFile = destDir+filename[0]+"/"+filename[1]+"/"+filename[2]+"/"+filename
   print(destFile)
   shutil.move(sourceFile, destFile)

These did not take too long to make and most likely someone who remembers Python libraries better would have done it in a fraction of time.

What I have been busy with lately...

November 20, 2009
We made a nice and busy trip to Belgium. We spent most of the time in Brussels but we also visited Antwerpen and Bruges. Tasty beer, rude museum staff, sore feet and tons of photos to sort. Plenty of things to see and especially Antwerpen railway station was pretty impressive.

At work I am busy the soon to be released open source CMS. The content management UI is built on Ext GWT aka GXT so it looks pretty nice and it was quite pleasant to develop. The server side is usual EJB3, JPA/Hibernate etc... there is some REST API, website templates can written in Velocity and there is even possibility to add extra functionality with server side JavaScript. So bunch of cool technologies and it has been great learning experience.

Meanwhile we have been enjoying Scottish autumn weather and I have been trying out Android SDK. Tomorrow I will visit Scottish Open Source Awards - this time just as a spectator.

StackOverflow DevDays 2009 London

October 29, 2009
Yesterday I attended DevDays in London and it was pretty good event. Most of the speakers were good and I think I learnt something new from every one of them. Unfortunately there was not too much time to network with other developers as the breaks were short and the catering was failing. I am look forward to attending it next year.

Some photos of the event

Some Google Wave invites to give away

October 25, 2009
In case you are interested, drop me an email. You should know the address :-)

Facebook and Twitter stole my blogging effort

September 22, 2009
I have been really lazy to blog recently but my Facebook and Twitter accounts have received regular updates. This seems to be common among bloggers as it is so much easier to blurp couple lines for an update. But blogging is not dead because it is a medium for longer articles.

So, to summarise past month I could mention couple highlights. We made a trekking trip to Kingussie which was fun but we did not reach our goal. The route to the munro was way too muddy for our shoes. A pair of rubber boots would have been better.

Then we had an autumn holiday. I visited Finland and Dóra visited Hungary. My trip was mostly about hunting with very modest results. I did not have time to visit friends but I met my brothers and their families.

Among other things I have been dreaming about buying Canon 7D but I think it is a bit too expensive. And our Canon 450D is still doing pretty fine after 10K shots so there is no good excuse to spend around 1700 GBP...

Benefits of gym workout and home ergonomics for an office worker

August 09, 2009
In Hungary I sometimes had nasty headaches and clearly they were neck muscle related. I assume some tense muscles were pushing or blocking nerves and that caused migraine. But for my delight that seems to be history now.

I think there are two things contributing to this. First of all, I do much more workout and outdoor activity than in Hungary. Visiting then gym with sauna two or three times a week keeps neck and back muscles fit. It also helps to relax after work and allows me to get rid of some code originated frustrations. The monthly fee of the gym is not too bad and I see it as investing in myself.

Getting a new computer to replace 12" PowerBook has helped as well. 20" iMac results in a much more ergonomic home setup and I think the bigger screen is better for my eyes as well. I picked a nice mesh back computer chair from a local store couple weeks ago so things have improved even more. I think the next step would be buying a bigger table with more space for all these items.

Secrets of sauna

August 02, 2009
Quite often I have been asked about sauna. Being a Finn I, naturally, have an expert level knowledge about sauna. One common question is how one can like hot sauna. Simple, Finns are born in sauna so they get used to it right away. But sitting in a right place in the sauna helps a lot. In a square sauna where the sauna stove is in the corner, the hottest place is usually the opposite corner as the hot steam travels there first. So the Finnish guy sitting next to the sauna stove and throwing plenty of water is barely getting warm.

Problems with JSON and trailing comma with IE6

July 29, 2009
At work a GWT project was modified to use JSON instead of GWT RPC. It worked fine on FF3 and Safari but failed horribly on IE6. The error message was not too helpful: (TypeError): 'null' is null or not an object number: -2146823281 description: 'null' is null or not an object

To investigate this I installed Fiddler to check responses sent by the server. It turned out that our JSON collections had an extra comma after the last item. This trailing comma caused IE to expect yet another item.

Such a small and easy to fix problem but rather tricky to find - but that is life of a programmer.

Spoiled plans

June 15, 2009
Ah, last weekend we were about to go biking around Loch Leven but bad weather and my flu ruined that plan. Instead the weekend was all about resting - which is not bad for some time. But next weekend should be better.

I also had bad luck with cash ISA (tax free savings account) as I applied for higher rate account but First Direct introduced new lower rates while they were processing my application. I did not like that so I cancelled the opening - luckily I did not send transfer order before that.

But at least now GBP seems to get stronger against Euro. That is good because our trip to Finland is approaching... holiday I say!