Technomancy

Entries tagged “tips”

Some qemu tips

written by rory, on Jul 28, 2009 7:49:45 PM.

I’ve been playing with qemu recently and I’ve discovered some tips that make working with it easier. start qemu with “-monitor stdio” in the console, and you can put qemu commands into the console. None of this “ctrl-alt-2″ then “sendkey ctrl-alt-f2″, “ctrl-alt-1″ stuff. Instead of making a big blank 5GB file for the hard disk this way: dd if=/dev/zero of=hda.img bs=1M count=5000 Do it this way: qemu-img create hda.qcow 5G -f qcow This creates a qcow format image. It’s the same, but it will only take as much space as is needed. The first version takes up 5GB. You can eject the cdrom with ‘eject cdrom’ and ‘put in a new cd’ with “change cdrom /path/to/new.iso”

Running a programme overnight and don't want to hear noisy fans?

written by rory, on Jul 9, 2009 10:48:00 PM.

I want to run a long running CPU intensive programme overnight. However I don't want to hear the noisy CPU fans. The more the CPU is used, the hotter it gets and hence the fans turn on to cool it down. The usual way to limit how much a process runs is by using nice. However there won't be any process running, so it will use as much CPU as is available. Mostly this is what you want.

cpulimit (available in ubuntu), is a programme to limit what percent of CPU a process gets. It does this my constantly pausing and resuming it so that it only runs a certain amount of times per second.

This solves my problem completly, since I can limit a process to only having 15% of the CPU time. The rest of the time the CPU will be idle, so it will be cooler, so it will be quieter.

After installing it, just find the process you want to limit. then do a

cpulimit -p $PID -l $SOMEPERCENTAGE
and it'll limit that process right away.