Query CERN LDAP from the shell

Here’s one for the shell nuts:

sudo $EDITOR /etc/ldap/ldap.conf

Add the following line:


Warning: This is not completely secure, since it ignores the certificate checks. There are instructions, but it’s not clear which of the two CA certificates I should use, and whichever I try, I get no useful feedback from ldapsearch even with -d 255. If you manage to use the certificates properly, I’d be grateful if you’d let me know how.

Now for the meat (replace $(whoami) with your CERN user name if it’s not the same as your login):

ldapsearch -v -H ldaps://ldap.cern.ch:636 -s sub -b O=CERN,C=CH -D cn=$(whoami),ou=users,o=cern,c=ch -x -W "(uid=$(whoami))"

Howto: Timelapse video from photos

It’s amazing what shell tools can do: Flickr accepts HD video (720p, or max 1280×720) up to 30 FPS, so I tried to create one within those limits from the high resolution photos from today’s sunrise. Turns out to be incredibly easy with free tools on Linux:

  1. Resize to 720 pixels height (if your images are still wider than 1280 you’ll have to replace x720 with 1280 (without the “x“): mogrify -resize x720 *
  2. Find the width of the images, and plug that into the following command instead of 1080.
  3. Create the video: mencoder mf://* -mf w=1080:h=720:fps=30:type=jpg -ovc copy -oac copy -o output.avi

The result