Wednesday, 26 January 2011

How to get on twitter/facebook in Egypt during protests

Since the #jan25 demonstrations in Egypt started yesterday thousands of Egyptians were unable to access their Twitter/Facebook accounts. The government will most likely be blocking access to these websites for some time ahead, and these activists will need to find a way around them.

There are solutions of course, this blogpost ( points some of them out. I personally recommend downloading a Tor browser package ( This is a browser that has been set up to connect to the Tor network (your data will take random routes within this worldwide secured network before making an unsecured request to the website you want to visit). Download it for Windows, Mac or Linux now!

Update January 28th 2011

This will of course not work when your government disconnects the entire country ;)

Monday, 24 January 2011

[Solved] Reduced performance Thinkpad W510 on 90W power adapter

My dad's W510 had been acting painstakingly slow for some time. We found out that this was because of the 90W ultra-slim adapter (the W510 thinks it needs more power and slows down the processor and gpu). A quick fix is to pull out the power plug and to put it back in, this resets the power manager software. 

However, this gets frustrating when you have to do it every couple of minutes. Someone at the lenovo forums  suggested a more permanent fix: shorting some pins under the keyboard (read the forums for more details). You should only do this on your own risk, and you need some technical skills, but in our case it does work!

Friday, 21 January 2011

HP Laserjet 1018 (or equivalent) printing to Netgear router with Tomato USB firmware

Yesterday I got a new router (Netgear N3000 WNR3500L with USB) to which I wanted to connect a printer. Unfortunately the firmware only supported USB hard drives, and no printers. Following the terrific blogpost on I managed to install the Tomato firmware. It is a delight. The guide mentioned the following steps:

2) Go to the “USB and NAS” -> “USB Support” page and enable at a minimum Core USB support, including both 2.0 and 1.1 support (some documentation I saw found that occasionally printers would not work if 1.1 support was not enabled even if they were using USB 2.0).  Also enable printer support, including Bi-directional printer support. [my emphasis]  Optionally enable File Storage support if you will also be connecting a mass storage device.   Save settings and reboot router.

After setting up USB printing (it recognized the printer straight away) I wanted to add the HP Laserjet 1018 in my Ubuntu (10.04) setup. It didn't work at all. I was under the impression that the error would be on my system, until I found this blogpost which mentioned to uncheck the bi-directional printing option. After this it worked like a charm.

I believe this applies to virtually all HP USB printers.


Update from 2012:

After power-cycling my printer this didn't work anymore, so right after I wrote the above I stopped using the printer via my router.

Today I decided to try and fix it permanently.

The problem was, these printers need to get a firmware loaded every single time you power it up. After each power cycle it start out with a blank mind as it were. Your computer probably loads a firmware for you, if you've set it up properly you can hear the printer making noises after plugging in. Your router will not do this automatically. So if you've plugged the printer into your computer, leave it on but connect the usb cable to the router, it will still work because the firmware is still loaded. I don't want to do this every time I shut down the printer though. Luckily, I finally found this page for the tomato firmware, explaining that it can in fact load a firmware to a printer.

To start with that howto, you need two things: ssh access to the router and a jffs filesystem (enable both of these settings using the web-interface). Then, copy the downloaded firmware like so:
scp your_firmware_file root@

Then follow the rest of the manual. Now, when plugging in your printer to the router, you'll hear it loading up the firmware. Then simply set up printing on this uri: socket://

Personally, I have all my special devices locked in dhcp and I've added DNS entries for them in the router itself, like router ->, raspberry-pi -> 192.168.1.x, nmt -> 192.168.1.y

Great stuff.

Monday, 17 January 2011

LaTeX documents with utf-8 foreign accents, Word quotation marks etc.

And then, all of a sudden, this post got a lot easier...

I was having some trouble with latex documents. Many of the documents I make have different writers, who hand in their articles in Word documents. They use foreign characters, accents and quotation marks that LaTeX does not understand. When you paste such a content in a .tex file, (encoded as utf-8), the source looks alright. However, they do not appear in the generated pdf, div or ps. Latex does not give an error, it simply skips over the unrecognized characters. To overcome this problem I set out to make a preprocessor (which would simply scan the latex document and replace all the accents with \'{} and graves with \`{} etc.) and started looking for a list of all foreign characters in latex.

Then I found that latex has an option for utf-8 encoding. It was here that this post got easy. Simply put
in your document and you're done.

Saturday, 8 January 2011

Complete list of NS stations


This is outdated, as the list can now be downloaded using the NS api.

I'll post this in Dutch as this is of most use to people in the Netherlands.

Voor een android applicatie waar ik in de avonduren aan werk had ik een lijst van stations nodig. Ik heb dit met een scriptje van de website gehaald.

Het resultaat: Een complete lijst van de stations van de Nederlandse Spoorwegen, inclusief id.
Kopieer het van hieronder, of download ze in xml.

ahbf: Aachen Hbf
asch: Aachen Schanz
aw: Aachen West
atn: Aalten
ac: Abcoude
ahau: Ahaus
aime: Aime-la-Plagne
akm: Akkrum
albert: Albertville
amr: Alkmaar
amrn: Alkmaar Noord
aml: Almelo
amri: Almelo de Riet
alm: Almere
almb: Almere Buiten
alm: Almere Centrum
almm: Almere Muziekwijk
almo: Almere Oostvaarders
almp: Almere Parkwijk
apn: Alphen a/d Rijn
apn: Alphen aan den Rijn
alt: Altenberge
amf: Amersfoort
amfs: Amersfoort Schothorst
avat: Amersfoort Vathorst
asd: Amsterdam
shl: Amsterdam Airport
asa: Amsterdam Amstel
asb: Amsterdam Bijlmer ArenA
asd: Amsterdam Centraal
ashd: Amsterdam Holendrecht
asdl: Amsterdam Lelylaan
asdm: Amsterdam Muiderpoort
rai: Amsterdam RAI
assp: Amsterdam Science Park
ass: Amsterdam Sloterdijk
asdz: Amsterdam Zuid
anger: Angermuende
ana: Anna Paulowna
atw: Antwerpen-Centraal
apd: Apeldoorn
apdm: Apeldoorn De Maten
apdo: Apeldoorn Osseveld
apg: Appingedam
akl: Arkel
arn: Arnemuiden
ah: Arnhem
ahpr: Arnhem Presikhaaf
ahp: Arnhem Velperpoort
ahz: Arnhem Zuid
asn: Assen
augsb: Augsburg Hbf
avtgv: Avignon TGV
cps: Capelle Schollevaar
cas: Castricum
chamb: Chambery
cvm: Chevremont
coes: Coesfeld (Westf)
co: Coevorden
ck: Cuijk
cl: Culemborg
da: Daarlerveen
dln: Dalen
dl: Dalfsen
ese: De Eschmarke
dvnk: De Vink
dei: Deinum
ddn: Delden
dt: Delft
dtz: Delft Zuid
dz: Delfzijl
dzw: Delfzijl West
ht: Den Bosch
hto: Den Bosch Oost
dld: Den Dolder
gvc: Den Haag
gvc: Den Haag Centraal
gv: Den Haag HS
laa: Den Haag Laan v NOI
gvm: Den Haag Mariahoeve
gvmw: Den Haag Moerwijk
ypb: Den Haag Ypenburg
hdr: Den Helder
hdrz: Den Helder Zuid
dn: Deurne
dv: Deventer
dvc: Deventer Colmschate
did: Didam
dmn: Diemen
dmnz: Diemen Zuid
dr: Dieren
dtc: Doetinchem
dtch: Doetinchem-De Huet
ddr: Dordrecht
ddrs: Dordrecht Stadspolders
ddzd: Dordrecht Zuid
dortm: Dortmund Hbf
dortd: Dortmund-Derne
dortk: Dortmund-Kirchderne
db: Driebergen-Zeist
drh: Driehuis
drp: Dronrijp
duelk: Duelken
dulm: Duelmen
kdr: Dueren
dussel: Duesseldorf Hbf
duisb: Duisburg Hbf
dvn: Duiven
dvd: Duivendrecht
ebers: Eberswalde Hbf
ec: Echt
edc: Ede Centrum
ed: Ede-Wageningen
edn: Eijsden
ehv: Eindhoven
ehb: Eindhoven Beukenlaan
ekeren: Ekeren
est: Elst
emn: Emmen
emnb: Emmen Bargeres
emnz: Emmen Zuid
em: Emmerich
ekz: Enkhuizen
ennep: Ennepetal (Gevelsberg)
es: Enschede
ese: Enschede De Eschmarke
esd: Enschede Drienerlo
epe: Epe (Westf)
eml: Ermelo
ese: Eschmarke
escht: Eschweiler Talbahnhof
eweis: Eschweiler-Weisweiler
esn: Essen (Belgie)
etn: Etten-Leur
egh: Eygelshoven
eghm: Eygelshoven Markt
fn: Franeker
fffm: Frankfurt (M) Hbf
fnaf: Frankfurt Flughafen Fernb
freibb: Freiburg (Breisgau) Hbf
gdr: Gaanderen
gdk: Geerdijk
geisl: Geislingen
gdm: Geldermalsen
gp: Geldrop
gln: Geleen Oost
lut: Geleen-Lutterade
gz: Gilze-Rijen
gbr: Glanerbrug
gop: Goeppingen
gs: Goes
go: Goor
gr: Gorinchem
gd: Gouda
gdg: Gouda Goverwelle
gbg: Gramsbergen
gk: Grijpskerk
g: Gronau Westf
gn: Groningen
gerp: Groningen Europapark
gnn: Groningen Noord
gw: Grou-Jirnsum
gunzb: Günzburg
hlm: Haarlem
hlms: Haarlem Spaarnwoude
hagen: Hagen Hbf
hamh: Hamburg Hbf
hamm: Hamm (Westf.)
hann: Hannover Hbf
hde: Harde ('t)
hdb: Hardenberg
hd: Harderwijk
gnd: Hardinxveld-Giessendam
hrn: Haren
hlg: Harlingen
hlgh: Harlingen Haven
hk: Heemskerk
had: Heemstede-Aerdenhout
hr: Heerenveen
hry: Heerenveen IJsstadion
hwd: Heerhugowaard
hrl: Heerlen
hrlk: Heerlen De Kissel
hrlw: Heerlen Woonboulevard
hze: Heeze
heide: Heide
hlo: Heiloo
hno: Heino
hm: Helmond
hmh: Helmond 't Hout
hmbv: Helmond Brandevoort
hmbh: Helmond Brouwhuis
hmn: Hemmen-Dodewaard
hgl: Hengelo
hglo: Hengelo Oost
hto: Hertogenb ('s) Oost
ht: Hertogenbosch ('s)
hz: Herzogenrath
hil: Hillegom
hvs: Hilversum
hvsn: Hilversum Noord
hvsp: Hilversum Sportpark
hnp: Hindeloopen
hld: Hoek van Holland Haven
hlds: Hoek van Holland Strand
hb: Hoensbroek
hor: Hollandsche Rading
hon: Holten
holt: Holtwick
holzw: Holzwickede
hfd: Hoofddorp
hgv: Hoogeveen
hgz: Hoogezand-Sappemeer
hks: Hoogkarspel
hn: Hoorn
hnk: Hoorn Kersenboogerd
hrt: Horst-Sevenum
htn: Houten
htnc: Houten Castellum
sgl: Houthem-St Gerlach
hdg: Hurdegaryp
kn: Kaldenkirchen
kalmth: Kalmthout
kpn: Kampen
bzl: Kapelle-Biezelinge
kapell: Kapellen
karls: Karlsruhe Hbf
krd: Kerkrade Centrum
ktr: Kesteren
koln: Keulen
kbk: Klarenbeek
kmr: Klimmen-Ransdaal
koblen: Koblenz Hbf
kkd: Koeln Deutz
koln: Koeln Hbf
kohl: Kohlscheid
kbw: Koog Bloemwijk
kzd: Koog-Zaandijk
kmw: Koudum-Molkwerum
kbd: Krabbendijke
kma: Krommenie-Assendelft
kw: Kropswolde
krg: Kruiningen-Yerseke
zlw: Lage Zwaluwe
lg: Landgraaf
landry: Landry
lang: Langerwehe
leer: Leer (Ostfriesland)
ldm: Leerdam
lw: Leeuwarden
lwc: Leeuwarden Camminghaburen
leg: Legden
ledn: Leiden
ledn: Leiden Centraal
ldl: Leiden Lammenschans
lls: Lelystad Centrum
lette: Lette (Kr Coesfeld)
ltv: Lichtenvoorde-Groenlo
luik: Liege-Guillemins
flb: Limburg Sud
lc: Lochem
lp: Loppersum
lud: Luedinghausen
lun: Luenen Hbf
ltn: Lunteren
mz: Maarheeze
mrn: Maarn
mas: Maarssen
mss: Maassluis
msw: Maassluis West
mt: Maastricht
mtr: Maastricht Randwyck
mainz: Mainz Hbf
mannh: Mannheim Hbf
mg: Mantgum
mrb: Marienberg
marne: Marne-la-Vallee-Chessy
mars: Marseille-St-Charles
mth: Martenshoek
mech: Mechelen
mes: Meerssen
mp: Meppel
metel: Metelen Land
mdb: Middelburg
minden: Minden (Westf.)
mcgb: Moenchengladbach Hbf
kmb: Montabaur
mmlh: Mook Molenhoek
mout: Moutiers-Salins-Brides
munchh: Muenchen Hbf
munsz: Muenster (W) Zentrum Nord
munst: Muenster (Westf) Hbf
nien: Muenster-Häger
ndb: Naarden-Bussum
neuss: Neuss Hbf
na: Nieuw Amsterdam
nvp: Nieuw Vennep
nwk: Nieuwerkerk ad IJssel
nsch: Nieuweschans
nkk: Nijkerk
nm: Nijmegen
nmd: Nijmegen Dukenburg
nmh: Nijmegen Heyendaal
nml: Nijmegen Lent
nvd: Nijverdal
nvdw: Nijverdal West
nord: Nordwalde
ns: Nunspeet
nh: Nuth
obd: Obdam
oberh: Oberhausen Hbf
ocht: Ochtrup
offen: Offenburg
ot: Oisterwijk
olden: Oldenburg (oldb) Hbf
odz: Oldenzaal
ost: Olst
omn: Ommen
olv: Onze Lieve Vrouwe t. Nood
otb: Oosterbeek
op: Opheusden
osnh: Osnabrueck Hbf
o: Oss
ow: Oss West
odb: Oudenbosch
ovn: Overveen
paris: Parijs
paris: Paris-Nord
ploch: Plochingen
preus: Preussen
pmr: Purmerend
pmo: Purmerend Overwhere
pmw: Purmerend Weidevenne
pt: Putten
rat: Raalte
rvs: Ravenstein
rv: Reuver
rh: Rheden
rheine: Rheine
rhn: Rhenen
rsn: Rijssen
rsw: Rijswijk
rb: Rilland-Bath
rm: Roermond
rd: Roodeschool
rsd: Roosendaal
rs: Rosmalen
rtd: Rotterdam
rta: Rotterdam Alexander
rtb: Rotterdam Blaak
rtd: Rotterdam Centraal
rlb: Rotterdam Lombardijen
rtn: Rotterdam Noord
rtst: Rotterdam Stadion
rtz: Rotterdam Zuid
rl: Ruurlo
sptn: Santpoort Noord
sptz: Santpoort Zuid
spm: Sappemeer Oost
swd: Sauwerd
sgn: Schagen
sda: Scheemda
sdm: Schiedam Centrum
nwl: Schiedam Nieuwland
sog: Schin op Geul
sn: Schinnen
shl: Schiphol
schwe: Schwelm
schwer: Schwerte (Ruhr)
selm: Selm
selmb: Selm-Beifang
ksb: Siegburg
std: Sittard
sdt: Sliedrecht
sk: Sneek
sknd: Sneek Noord
st: Soest
stz: Soest Zuid
sd: Soestdijk
sbk: Spaubeek
utm: Spoorwegmuseum
stv: Stavoren
stm: Stedum
swk: Steenwijk
stdal: Stendal
stola: Stolberg Altstadt
stolb: Stolberg Hbf
stutt: Stuttgart Hbf
srn: Susteren
sm: Swalmen
szcz: Szczecin Glowny
szczg: Szczecin Gumience
tg: Tegelen
tbg: Terborg
tl: Tiel
tpsw: Tiel Passewaaij
tb: Tilburg
tbr: Tilburg Reeshof
tbu: Tilburg Universiteit
tbwt: Tilburg West
twl: Twello
utg: Uitgeest
uhz: Uithuizen
uhm: Uithuizermeeden
ulm: Ulm Hbf
unna: Unna
ust: Usquert
ut: Utrecht
ut: Utrecht Centraal
utl: Utrecht Lunetten
utm: Utrecht Maliebaan
uto: Utrecht Overvecht
utt: Utrecht Terwijde
utzl: Utrecht Zuilen
valtgv: Valence TGV
vk: Valkenburg
vsv: Varsseveld
vndc: Veenendaal Centrum
vndw: Veenendaal West
klp: Veenendaal-De Klomp
vwd: Veenwouden
vp: Velp
vl: Venlo
vry: Venray
vlb: Vierlingsbeek
viers: Viersen
fvs: Vise
vdg: Vlaardingen Centrum
vdo: Vlaardingen Oost
vdw: Vlaardingen West
vtn: Vleuten
vs: Vlissingen
vss: Vlissingen Souburg
vdl: Voerendaal
vb: Voorburg
vh: Voorhout
vst: Voorschoten
vem: Voorst-Empe
vd: Vorden
vz: Vriezenveen
vhp: Vroomshoop
vg: Vught
wad: Waddinxveen
wadn: Waddinxveen Noord
wfm: Warffum
wr: Weener
wt: Weert
wp: Weesp
wl: Wehl
wz: Wezep
wienw: Wien Westbf
wdn: Wierden
wc: Wijchen
wh: Wijhe
ws: Winschoten
wsm: Winsum
ww: Winterswijk
www: Winterswijk West
wd: Woerden
wf: Wolfheze
wolfsb: Wolfsburg
wv: Wolvega
wk: Workum
wm: Wormerveer
wupph: Wuppertal Hbf
wuppo: Wuppertal Oberbarmen
wuppb: Wuppertal-Barmen
zd: Zaandam
zdk: Zaandam Kogerveld
zbm: Zaltbommel
zvt: Zandvoort aan Zee
za: Zetten-Andelst
zv: Zevenaar
zvb: Zevenbergen
ztm: Zoetermeer
ztmo: Zoetermeer Oost
zurich: Zuerich HB
zb: Zuidbroek
zh: Zuidhorn
zp: Zutphen
zww: Zwaagwesteinde
zwd: Zwijndrecht
zl: Zwolle

Wednesday, 5 January 2011

Is there a definitive guide to making Facebook applications?

Last month I've made a Facebook application and I was appalled by almost every step in the process. Apparently there have been tons of changes in the way application developing worked. The developers documentation is like spaghetti, it is simply horrible. There are remnants of old, unsupported code everywhere. (Just take a look at But maybe I just don't get it, so please tell me if you think I'm wrong.

Now that I know how it should be done (I'm still not happy with the way it works), I could write a clear introduction to developing apps for Facebook. The thing is: I don't like to do work that's already been done. So: could you please let me know whether there is a good introduction to Facebook application development? Could you also let me know if you think such a guide is necessary? Please comment.

FYI my application is called My Library (

The simplest Drupal / Twitter integration possible!

Drupal is extremely frustrating at times. The organisation of which I manage the Drupal site got on Twitter. We only wanted a a simple block with just our latest posts. I tried three solutions before finding the perfect one:

  1. The Twitter module for Drupal
  2. Another Drupal module called JUItter (
  3. The official Twitter widget
  4. Tweet by seaofclouds (
The last was definitely not least, I can tell you that.

The Twitter module was terrible, much too complicated for this simple task. Besides there is virtually no documentation. A shame for a module of this size! Furthermore the recommended beta didn't really work. After uninstalling (and removing the created views!) I got a long way with the previous stable version, but it seems that twitter stopped allowing old API calls and now only accepts calls made using OAuth.

JUItter seems nice and it is client based (a pro for social media). Above all, it has a ready to use Drupal module, or so they claim. After downloading the zip it contained only 3 files and no traces of any Drupal module. Now something might just be messed up here temporarily, but I went on right away.

The official Twitter javascript widget is rather ok. Just implement the generated code (which creates a twtr object and all that) in a new html Drupal block and you're done. However the script uses document.write so it has to be run by the browser before the document is fully loaded. I, like every serious programmer, like to run my javascript actions using body.onload so it won't mess up loading times for the rest of the site. There was no way to make this script load a-synchronized.

Finally I thought of making a Drupal block, put some javascript jquery code in it and make an ajax call to the twitter api. From there I could parse the XML and use it to display our tweets. However, jquery does need some more configuration to be able to parse the xml file. Upon researching this I came across the best solution:

Tweet by seaofclouds works right away. No hassle whatsoever. It is client based, so no trouble with caching and all that. Use jquery and their .js file. The add the following code to a Drupal block:
<script type="text/javascript">
// <![CDATA[
document.write('<div id="ourtweets"></div>');

$(document).ready(function() {
username: "yourtwittername",
join_text: "auto",
avatar_size: 24,
count: 5,
auto_join_text_default: "we said,", 
auto_join_text_ed: "we",
auto_join_text_ing: "we were",
auto_join_text_reply: "we replied to",
auto_join_text_url: "we were checking out",
loading_text: "loading tweets..."
// ]]>

Note that I put the creation of the div in javscript, using a document.write. This is because my Drupal configuration does not allow me to post divs in a block's source code.

So once again, Tweet is the solution. 

Windows software on mac

Someone asked me whether Bibleworks 8 would work on Mac. It is a Windows application.

A virtual machine is a rather drastic solution (windows license, gigantic overhead). A solution like Wine for Mac would be much better. Wine however is not developed for Mac OS. Fortunately BibleWorks 8 works with WineBottler 1.1.44 (

Why this blog?

Whenever I come across a problem I look on google for answers. Every now and then the answer is not straightforward and I have to do some ingenious thinking. This blog allows me to share my finding with other developers.