This is the blog of Krister “SirPing” Brus, full stack developer at Adelo AB. The views expressed in this posting are mine, and do not necessarily reflect the views of my employer.

Using iPad as .pdf-viewer in Airplane Mode

The following script generates a very simple site with index.html file and the site.manifest file from a directory with .pdf-files. The generated site enables Offline-storage mode which lets iPad access cached content, even when in Airplane Mode. apache needs an “AddType text/cache-manifest manifest” to serve the correct Content-Type header. lighttpd is already configured to serve correct headers. You can test it here! Refer to this article for background. #!/bin/bash MANIFEST=site.manifest

Make the right Windows-key an extra AltGr-key

My T61 has a stupid Windows-key stuck between AltGr and Ctrl. It gets in the way all the time. I never use the key; my old R51 didn’t have it and I only use Model-M’s on my workstations. To fix this annoying “feature”, put this line last in your .bashrc-file : xmodmap -e "keysym 0xff67 = ISO_Level3_Shift" Now that key is an extra AltGR-key ! Problem solved !

Progress report for commands processing large files

How many times have you done $ md5sum a-large-and-probably-important-file and during the thumb-rolling wait, cursed yourself for not remembering to use the excellent pv – Pipe Viewer program ? pv shows a nice progress report as well as a useful ETA time. $ pv ] 38% ETA 0:00:03 The pv program is only an apt-get install pv away! Yeah, pv is very good if you remember to use it…. Can we get a progress report after we started md5sum ?

Innovators get Linux to boot in 1 second

This is the first post of the new and weekly best-of-interesting-stuff in programming, operating systems and cool solutions. The idea is to gather the good stuff here; for myself and others to enjoy. “For those who wonder why a processor doing billions of instructions per second needs to take minutes to boot up, wonder no more; MontaVista has shown that you can boot up a complete modern operating system in less than a second.” Read the interesting article on how they did it.

Black Day

This is the very sad day when mountains of code and machines is being repossessed by a bunch of utterly clueless and useless people.

XEN to KVM Migration

I will describe a way to move a XEN domU virtual machine into a KVM virtual machine. Xen stores the machine as one partition in one file. KVM stores the machine as a whole disk. There are many ways to do this. This might work for you. NOTE! The packages parted and kpartx must be installed for this. First, install grub and a kernel in the virtual machine (xen domU), since a KVM-machine is a self contained machine and needs its own kernel.