Python hug with apache mod_wsgi

I found it surprisingly difficult to find a plain explanation of setting up hug and apache mod_wsgi. So here is how I did it.

Minimal hug API

Writing an API with hug is really easy. You can write a "hello world" in four lines of code:

import hug

@hug.get ...
more ...

Cloning a Linux Partition

Whenever I want to test a new release of Ubuntu I find myself cloning the root partition so I can safely upgrade and still keep my old install.

However, I usually forget some step and end up needing to debug grub boot. So this is a summary of what needs ...

more ...

Remote Control Rhythmbox from Command Line

I have a mostly-headless HTPC without keyboard, so it is easier to control it remotely. VNC lets you do anything, but for simple things a command line is faster.

My media player of choice is rhythmbox, so there's an easy way to control it: rhythmbox-control. However, it requires an ...

more ...

Merging Persistence Changes in Ubuntu Live USB

When using Ubuntu Live USB there is the option of using persistence to store changes on the USB. It uses aufs to layer a read-write filesystem on top of a read-only squashfs compressed filesystem. This is great, because it fits over 2GB worth stuff into a c. 700MB default live ...

more ...

Reboot to Another Kernel (or Windows) with grub2

Update: Updated below for 11.04/Natty.

So I had some trouble getting grub-reboot to work, since it only seems to like numbers, but I figured it out. I made a script to reboot to another kernel or OS (Windows for me) once, leaving the default unchanged.

First one must ...

more ...


Radeon Power Management in Ubuntu 10.10 (Maverick)

One of the changes in the recent Ubuntu 10.10 (Maverick) is the upgrade of Linux kernel from version 2.6.32 (in Lucid) to 2.6.35. The change introduces several new features of which I especially like Radeon power management (for use with open drivers).

Unfortunately the default ...

more ...

Asus Eee PC 1001PX and Ubuntu Linux

To make the wireless of my 1001PX work in Ubuntu Lucid I had to install the 2.6.35 kernel from Kernel team PPA. The package name is linux-meta-lts-backport-maverick and it should eventually become available in the Lucid package archives.

Unfortunately, the touchpad didn't support multi-touch OOTB and the ...

more ...


Aliasing Hostnames on Linux (Ubuntu)

When Googling for hostname aliasing on Linux, the most prominent answers were for SSH hostname aliasing, which is simple. For a general purpose solution the common answer was "install a DNS server", which is way over the top. Here's what I managed to figure out.

The objective is to ...

more ...

Splitting Files in-Place on Linux

Ok, so I have a 160GB disk image I need to split to small pieces (so I can compress those individually in the background later), but I only have a few GB free on the disk containing the image. Unfortunately, split isn't in place. Here's what I managed ...

more ...

Trust Slimline Sketch Tablet on Ubuntu Karmic

Update: See the bottom for Ubuntu Lucid

I just installed my new Trust Slimline Sketch graphics tablet on Ubuntu Karmic 9.10. It was reported as "UC-LOGIC Tablet WP8060U" by xinput. Here's how I made in work, (based on Ubuntu wiki and some Googling):

1. Install wizardpen from Michael ...

more ...


Increasing Display Resolution in Virtual Machine Manager

With KVM you can use a high resolution by passing kvm the -vga std parameter (or -std-vga before KVM-77). When using virt-manager to manage virtual machine guests, there is no option to change display resolution. However, it is possible to work around it as follows.

First, create a bash script ...

more ...