Reviving a 1982 HP-41CV

Posted on 14 January 2022 in misc

After 15 years, I finally made time to revive my 1980s HP-41CV calculator: by repairing bad contacts and adding a USB power cable, it now is back as my daily desk calculator.

Continue reading

TUM CTF: Haggis

Posted on 09 October 2016 in ctf • Tagged with ctf

Writeup for the Haggis flag.

The challenge is the following:

  • A message \(m\) is padded, then encrypted using AES in CBC mode, with known key \(K=0\) and IV \(IV=0\), to ciphertext \(c\).
  • \(m\) needs to start with "I solemnly swear that I am up to no good.\0 …

Continue reading

Replacing dead links for the Dutch Royal Library (Koninklijke Bibliotheek)

Posted on 12 September 2015 in wikimedia • Tagged with python, wikimedia

This is mostly a set of notes to allow others to perform these replacements as well. They are written for the specific case of the KB, but should be applicable to URL replacements in general.

The original requests can be found at 1 and 2.


  • a working pywikibot installation …

Continue reading

Using LiveReload with Pelican

Posted on 16 June 2015 in misc • Tagged with pelican, python

LiveReload is magic. As the authors describe it:

The Web Developer Wonderland

(a happy land where browsers don't need a Refresh button) -- LiveReload

What does it do? It's a browser plugin that automatically refreshes a page when the server tells it to. On the other side, we have a web …

Continue reading

Building a Flask project with OAuth enabled on Tool Labs

Posted on 15 May 2015 in wikimedia • Tagged with python, wikimedia

This is a guide to building a simple Flask project on Tool Labs. Tool Labs is the Wikimedia shared hosting project, for projects ('tools') related to Wikipedia or one of the other Wikimedia projects.

This guide assumes you have a Tool Labs account and some knowledge of getting around. The …

Continue reading

Adding a colormap to a figure without imshow/countour set

Posted on 25 March 2015 in matplotlib • Tagged with python, matplotlib

Example: plot a packing using circles, and use the foreground color to show some value for each particle, for example the contact number Z:

The trick to this is to call plt.scatter() to plot a single point outside the axis range. This allows plt.colorbar() to find cmap and …

Continue reading

Rearrangements and plasticity in two-dimensional sheared foams

Posted on 15 December 2014 in science • Tagged with science, Leiden

In collaboration with Vera Janssen, Alexander Siemens and Martin van Hecke

We experimentally apply a slow pure shear deformation to a quasi-two-dimensional foam under glass-liquid boundary conditions. In contrast to earlier research, which focussed on the behavior of dense systems, we investigate the behavior close to the jamming transition.

Continue reading

Rearrangements in Jamming

Posted on 15 December 2014 in science • Tagged with science, Leiden

In collaboration with Johannes Simon, Zorana Zeravcic, Simon Dagois-Bohy, Brian P. Tighe and Martin van Hecke

In the last decade, computer simulations have been used to gain insight in the behaviour of granular matter. This has allowed a description of the behaviour for small deformations. In this project, we are working on what happens beyond small deformations.

Continue reading

raw_input in matplotlib with plot interaction

Posted on 08 August 2012 in misc • Tagged with python, matplotlib

When working with data, you sometimes need to view the data and give input on how to continue. However, a simple

answer = raw_input()
will not work: the plot GUI will block while the raw_input() is waiting. The following is a (admittedly hacky) solution to this problem: run raw_input() in a seperate thread, and poll the GUI using waitforbuttonpress():

Continue reading

git-http-backend on shared hosting, with push

Posted on 12 October 2010 in misc • Tagged with git, servers

There are several posts describing how to get git pull using git-http-backend working on shared hosting, for example this post by mobiphil. However, following those steps, I was left with an unclear 'code 22' error when pushing.

In this post, I will describe shortly how I set-up git on my shared hosting account in a way that does allow pushing.

Continue reading