Category Archives: Weblog

Mail to the ambassador of Saudi Arabia

While waiting for news from France I wrote an email to the ambassador of Saudi Arabia about the punishment of Saudi blogger Raif Badawi.

Dear Mr. Al-Shagroud,

Today I learned about the cruel flogging of Raif Badawi for creating an online forum for public debate and on accusations that he insulted the Islam. I find it incredible that this punishment takes place only two days after the massacre in France. The assailants there were angry at the cartoonists at Charlie Hebdo for the same “offences”.

Saudi Arabia could be the shining light of how an Islamic country can be a forward thinking country. The establishment of the King Abdul University, with its mixed-gender campus, indicated to me that Saudi Arabia is slowly but surely changing for the better. I heard positive stories about the university and even looked for jobs there. I’m glad I didn’t find any.

Instead of being a shining light Saudi Arabia is, like the gunmen in Paris, cowardly punishing people who disagree with it. By doing this your country is doing all peaceful and well-meaning Muslims a disservice. While the actions of three gunmen can be seen as an exception and un-Islamic, this can not be said about the actions of a large and influential Islamic country. With its actions your country is fuelling the prejudice that Islam equals barbarism and intolerance.

No matter how much effort is put into making King Abdul University a success and a poster child for a more progressive Saudi Arabia, as long as it keeps punishing critics it will be seen as a backward country.

Stop flogging critics. Stop flogging Raif Badawi.

Dr Robbert Bloem

CC: president of KAUST

I have no illusions that my mail will change the mind of the Saudi government, but writing it feels better than tweeting #JeSuisCharlie all the time. #FreeRaif

Workflow to import photos from iPhone and iPad to a Mac

In this post I describe an automated way to import images from your iPhone and iPad to your Mac without using iPhoto or Photo Stream. Instead I use the system utility AutoImporter and Hazel, a $30 app.


As nice as the iPhone and iPad are to make photos, it is rather difficult to archive them properly. Photo Stream is nice to quickly transport a picture from your iPhone to your iPad or vice versa, but I wouldn’t rely on it as an archive. It may or may not function as an archive, I don’t know. And that is exactly the point: if I don’t understand how it works then I don’t trust it. The same is more or less the case for iPhoto. It is also a black box for pictures. Some are imported. Some are not. Others seem lost. The end of the Christmas holidays and the purchase of a new computer seemed the right moment to finally delve into the problem: how do I safely store my photos?

The workflow

The goal is to move the photos from my mobile devices to a subfolder of ~/Pictures/JPG/. The subfolder contains the year and “iDevice” (i.e. 2015_iDevice). This is to fit with the way I store the photos from my DSLR.

The best way would be if I could do it over the air using Photo Stream. However, it seems that you first need to start iPhoto before Photo Stream updates. Not really an option for me. Instead I ended up using ImageCapture and AutoImporter (two system utilities) and Hazel (“Automated Organization for your Mac”, a $30 app).

ImageCapture automatically starts when you connect a camera/iPhone/iPad to your Mac (or use Spotlight or something). By default it wants to open iPhoto but you can also select AutoImporter. This starts an obscure utility that does what you think it does: it imports photos automatically to a specified directory — nothing more, nothing less. Finally I use Hazel to copy the photos to a subfolder in my JPG-directory.

Important note for people who restore their devices regularly.


  • Open ImageCapture (/Applications/Image
  • Connect your device.
  • At “Connecting this iPhone opens”, select
  • I leave “Delete after import” deselected. The workflow will not duplicate photos.

You have to repeat those steps for every device you have.


  • Open AutoImporter (/System/Library/Image Capture/Support/Application/ Spotlight will not find it.
  • Go to Preferences. If the app is not used for some time OS X will kill it, so do this quickly-ish.
  • Specify a folder for intermediate storage. By default it creates a folder “AutoImport” in ~/Pictures, but I don’t like that. You can delete the folder afterwards, but it means more work when the device is connected the next time. I used ~/Temp.
  • I import the files to a subfolder that specifies the camera name (it uses the name you gave the device, in my case that is RBiPh5). You should do this when you have more than one device, as the iPhone and iPad use the same format for the filename and there may be confusion.

From now on, every time you connect an iPhone the photos will be imported to ~/Temp/RBiPh5/. For the iPad this is ~/Temp/RBiPa5/.


The files are put in the JPG folder by Hazel. First, in the left pane, select the intermediate folder (i.e. ~/Temp/RBiPh5/). If it doesn’t exist yet, create it manually in order to make the rule.

Then set up a new rule as shown below.

  • We only want to look at the files that have been modified after the last time we ran this rule.
  • We first copy them to the folder JPG. This is an intermediate step. At the “i” I selected that duplicates will not be copied.
  • Then the photo is renamed.
    • The image numbering on iPhones and iPads is not synchronised. To make sure IMG_0002.JPG shot in January is shown before IMG_0001.JPG which was shot in February, I prefix the date.
    • Both an iPhone and iPad may make the photo IMG_0001.JPG on the same day. To prevent conflicts I also add the device name (iPh5/iPa5) to the filename.
  • Finally, I sort the file into a subfolder, with the year as prefix. At the “i” I selected that duplicates will be thrown away.

You’ll need to make separate rules for different devices, since they have different source folders. Better: set it up for one device, then copy it and modify it.

The order of operations in Hazel is important. If you rename the photos while they are in the intermediate folder AutoImporter will re-import the files. If you rename them after they are sorted into the subfolder duplicates are not recognised.

What happens…

…when I connect the device it for the first time?

AutoImporter will copy all files to the intermediate directory (and make it if it doesn’t exist). Hazel will copy the files to the folder JPG and then sort them into folders for the year. If the year-folder doesn’t exist yet Hazel will make it for you.

…when I connect the device subsequently?

AutoImporter will copy new photos to the intermediate folder with the photos on the device. If photos have been deleted from the intermediate folder they are copied as well. If photos are deleted on the device they will not be deleted from the intermediate directory.

…when I restore my device and the photos start numbering at 0001 again? (important!)

I didn’t test it, but the new photos will probably be thrown away. You can prevent this by changing the device name in Hazel (from iPh5 to iPh5b or so).

…when I delete the intermediate folder and then connect the device again?

AutoImporter will create the missing intermediate folder and then import all photos again. Hazel will either recognise that it already ran the rule for the photos that have been deleted (it has a memory). If it doesn’t, the duplicates will be thrown away at the “sort into subfolder” step.

It is not a problem when you delete the intermediate folder, but Hazel will copy and rename all files again, only to throw them away later. If there is no reason to delete it, keep it.

…when I manually move or rename photos in the final directory?

You can manually move and rename the photos. Hazel shouldn’t try to copy, rename and sort the photos again (they have already been matched). However:

  • When you delete the intermediate folder and Hazel doesn’t recognise that the photos have already been matched you will end up with differently named duplicates.
  • When you rename files use a name that won’t conflict with future photos. Otherwise Hazel will throw away the new photos.

…when I rename my device?

AutoImporter will make a new intermediate folder and import the photos to that. Since Hazel won’t look there they will not be copied to the JPG folder.


I’m really happy with the workflow. In most cases I have the feeling that making the workflow costs more time than you’ll ever save by using it. With this workflow I know my photos are safe. This peace of mind is worth the effort. (I probably spent more time writing this blog post than making the workflow).

It is a pity that it doesn’t work over-the-air. The weak link is that I’ll need to connect my iPhone/iPad every now and then. I don’t do this very often, but often enough to be okay with it. I don’t know how this works with iPhoto. Could it be that you needed to connect your iPhone AND start iPhoto? In that case this workflow is clearly a step forward.

Finally, I’m wondering if you could use Automator instead of Hazel. Hazel is more flexible, especially regarding sorting into subfolders with a year in front of them. Maybe AppleScript can help… If you care more about $30 than subfolders then Automator will probably work fine.

Why do I have a free day today? New Years’ Edition

Are you kidding me? Januari 1st is an institutionalized get-over-your-hangover-day. Why are you actually reading this site? You should be in bed with a headache. Courtesy of the people who didn’t drink too much on New Years Eve, there are some traditional events in Europe and the Netherlands.

  • Ski jumping at Garmisch-Partenkirchen: I have to admit that seeing people plummet from a mountain is an entertaining way to start the new year. Just when you started to think you were stupid last night to drink this much you see people doing something even more stupid.
  • New Year’s Concert in Vienna: Also stupid, but frankly too loud to be entertaining. Also, I don’t like Srauss. This years playlist: Franz von Suppé, Johann Strauss, Jr., Josef Strauss, Eduard Strauss, Hans Christian Lumbye, Johann Strauss, sen.
  • New Year’s Dive: At various places in the Netherlands (and across the world I guess) people try to get over their hangover by jumping in the see or lakes. They did this for years and as it gained popularity it attracted commercial interest. Uno, maker of low-quality sausages, started to sponsor the event and advertised it, making it even more popular. Now you can see people dive into the see with a stupid Unox-hat on. Once they are out of the water they can eat a disappointing sausage. No harm done, but not my hangover-curing cup of tea.

Why do I have a free day today? Christmas-edition

What can I say about this holiday? Ages ago people recognized the periodical passing of the seasons. Midwinter was a day to celebrate, as the days were shortest and would be getting longer again. On the other hand midwinter is also the start of the actual winter. A long and cold period during which you can endlessly ponder if your family will survive. After all, the harvest is in and the animals slaughtered (no need to feed them precious food). Most of the meat is preserved for the long winter ahead, but what about the better cuts? Why not eat them to celebrate midwinter?

The Syrians had a feast called “Sol Invictus” which started on December 21st and lasted a few days (three, later five). The Romans adopted the feast, renamed it Saturnalia and celebrated it on December 25th [1]. It included naked dancing and singing.

When Emperor Constantine converted the Roman Empire to Christianity he realized that it would be unpopular to take away this holiday and he decided to co-opt it for Christianity instead. The birth of Jesus, also a sort of new hope for some people, seemed like a good fit.

So what is celebrated?

And more importantly: do I have the day off?


The countdown to Christmas starts four Sundays before Christmas: the advent period. Every Sunday a new candle is lit. This is the meaning of the candles:

  • 1st candle: Start thinking about Christmas dinner.
  • 2nd candle: Start thinking about Christmas presents.
  • 3rd candle: Make a spreadsheet with all the things you’ll need to buy.
  • 4th candle: Run to the shops in panic because you actually sat on the couch the previous three weeks.

I don’t think there is a real religious reason for advent. In the church of my grand parents the period was used to remember the people who died during the year. Some people (I think it is very popular in Germany) give each other an advent calendar, with a small present for every day.

December 24th: Christmas Eve

To make sure that the Christmas days can be used for traveling to family members and eating, there usually is a church service on Christmas Eve [2]. For some reason it is not unusual that people who are usually not very religious attend this service as well. It is a cheesy story about a kid being born with some singing. Is there booze afterwards? I hope so.

December 25th: Christmas Day

The day that the birth of Jesus is celebrated, even though there is only a 1 in 365 chance that this was actually the case.

People who call this the most holy day of the Christian calendar are of course mistaken. Christianity is about Jesus dying for our sins and then walking (floating?) away. In order to die he had to be born first [citation needed] [4], but it is not the most holy day of Christianity.

People who say Christmas is not about food are also wrong: as written earlier, the pagan feasts that preceded Christmas had everything to do with eating, drinking and dancing around naked.

December 26th: Second Christmas Day (or Boxing Day)

Why have one free day when you can have two? I couldn’t find any reason for this day being a holiday. It is convenient if your parents are divorced though. Or if you have a massive hangover from the day before.

For unknown reasons the English call this Boxing Day. Maybe Santa Claus had to clean up the boxes or something [5]. A more plausible explanation is that boxes were filled with stuff for the poor. Nobody really knows.

January 6th: Epiphany

Christmas is a holiday that just keeps giving… especially for the Germans, who have yet another free day (no such luck elsewhere). Epiphany “celebrates the revelation of God the Son as a human being in Jesus Christ” (copy-pasted from Wikipedia — this is too much for me to type).

What exactly happened (or is supposed to have happened) is not entirely clear to me. Wikipedia spends a lot of text on which day it is celebrated and the by which names it is called, but is rather unclear about the event itself. It seems that a star rose and “three wise men from the East” came to visit the newborn Jesus and baptized him. Sometimes it seems as if the emphasis is on the presents, the baptizing or the realization that something was going on.

There is also confusion about what these men (no women) were. Were they kings or wise men? The Economist has a nice article about the different possibilities. In Dutch we call them “Driekoningen” (Three kings). The Dutch Wikipedia page also says that the number three is actually nowhere to be found in the Bible. The number was probably chosen because there were three gifts (gold, incense and myrrh) which means there probably were three kings as well [6].

So… where does this leave us?

Well, probably with a feeling of having eaten too much, a medium to large hangover and possibly some gifts that you may or may not like. Happy Saturnalia!

[1] Wikipedia says this was considered the winter solstice, but winter solstice is on 21st-22nd of December, not the 25th.

[2] Other people say that it was usual to go to church the day before the actual holiday. Yet other people say that the service [3] should take place at midnight, but that is not very popular with parents of young kids.

[3] Catholics called it a mass, Protestants a service.

[4] Was it naive to expect ‘citation needed’ more often in Wikipedia articles about religion?

[5] This would explain why the Dutch don’t call it Boxing Day: they had their gifts with Sinterklaas

[6] I imagine that there was a fourth cheapskate king. His failure to bring a present came to bite him by being erased from history.

Why do I have a free day today? December 5th/6th: St. Nicholas

It is usually not a free day [1], but St. Nicholas Day is widely celebrated in mainland Europe. It also served as inspiration for Santa Claus in the US. The details differ widely per country, but there are three overarching themes:

  • There is a bishop-like figure, St. Nicholas.
  • He usually has helpers.
  • Good kids get presents, naughty kids get punished.

The story is that Bishop Nikolaos of Myra (15 March 270 — 6 December 343) had a reputation for secret gift-giving. Children would leave their shoes out overnight and the day after it would be filled with a small gift. The next 1000-1500 years are a bit sketchy but there was a bit of a gift-giving tradition around December 6th.

In most of Europe it is celebrated one way or the other. In Southern Germany and Austria Sankt Nikolaus is accompanied by Krampus, a beast-like figure. In Switzerland it is called Samichlaus and there are no beasts involved. Wikipedia has a summary of celebrations in different countries.

In the Netherlands

In the Netherlands Sinterklaas (a corruption of Sint Nicolaas, the Dutch version of Saint Nicholas) is celebrated on December 5th, not December 6th. The modern version was introduced in an illustrated children’s book written by a teacher. According to Wikipedia:

The modern tradition of Sinterklaas as a children’s feast was likely confirmed with the illustrated children’s book Sint-Nicolaas en zijn knecht (‘Saint Nicholas and his helper’), written in 1850 by the teacher Jan Schenkman (1806–1863). Some say he introduced the images of Sinterklaas‘ delivering presents by the chimney, riding over the roofs of houses on a grey horse, and arriving from Spain by steamboat, then an exciting modern invention. Perhaps building on the fact that Sint Nicholas historically is the patron saint of the sailors (many churches dedicated to him have been built near harbors), Schenkman could have been inspired by the Spanish customs and ideas about the saint when he portrayed him arriving via the water in his book. Schenkman introduced the song Zie ginds komt de stoomboot (“Look over yonder, the steamboat is arriving”), which is still popular in the Netherlands.
In Schenkman’s version, the medieval figures of the mock devil, which later changed to Oriental or Moorish helpers, was portrayed for the first time as black African and called Zwarte Piet (Black Peter). [2]

Since then a lot has changed. In the 19th century Sinterklaas had a large carrot-and-stick element. Good kids got presents and candy, naughty kids would get “the birching rod” (i.e. corporal punishment). For the worst kids there would be a single ticket to Spain. I guess the last thing was more scary back then than it is today. In the old days kids were actually afraid of Sinterklaas. Nowadays there are more presents and no punishments.

The role of Zwarte Piet also changed. It started out a bit like the Krampus in Germany: a scary figure. Remember that it wasn’t until the 1950’s that mass immigration of non-white people to the Netherlands started. Up until then the few colored people were considered a scary oddity. After the Second World War, and especially after television started to broadcast the arrival of Sinterklaas, the number of Zwarte Pieten increased. They have their own dedicated tasks that they usually screw up (for example, Route-finding Piet is never going to find the right route). Zwarte Piet transformed from a scary oddity to a clown-like figure. I expect Zwarte Piet will transform a bit more in the coming years…


A few weeks before December 5th Sinterklaas arrives from Spain. At night the kids can leave the shoes with a carrot (for the horse of Sinterklaas) near the chimney. The next morning they find some candy in it. [3]

Finally, december 5th is the gift-giving day. Young kids wait impatiently until the presents arrive. Older kids help making the presents, which are usually packaged in a humorous way (“surprises”) and accompanied with a small poem.

Sinterklaas really is the gift-giving day for families (parents + children) in the Netherlands. As the kids leave the house the celebration is discontinued, moved to the weekend before/after December 5th or moved to Christmas.

[1] The title of this post really should be ‘Why wasn’t I free last week?’

[2] I don’t know how it happened, but somehow the Bishop Nikolaos of Myra moved from Turkey to Spain.

[3] My mom sometimes tells that at some point she almost got sick of eating all the carrots.