Category Archives: Uncategorized

Amazon (or just “online ordering”) rant

There are some items which are just not possible to order online any more, assuming you want something of minimal quality. These include:

  1. chargers for mobile phones — all now fake as far as I can tell
  2. batteries for older mobile phones — second hand, dead, fake, or simply the wrong battery
  3. consumer cables, like USB to micro USB
  4. convection heaters — didn’t expect this, but I can’t find a reliable one (for the new office) online

That’s not counting the stuff where it’s still just about possible to get non-fake stuff, but it’s a crapshoot, eg. computer memory, hard disks, batteries, flash memory.

3 Comments

Filed under Uncategorized

Using rsync with libguestfs

Since libguestfs 1.20 it has been possible to use rsync to upload or download files to a disk image incrementally. This is one way to do backups, but note that it won’t work on live guests unless you take a snapshot.

rsync involves using a network connection into or out of the appliance, and is therefore a lot more involved to set up. The script below shows one way to do this, by running an rsync daemon on the host, and letting the libguestfs appliance connect to it.

The script runs rsync inside the appliance, copying /home from the attached disk image out to /tmp/backup on the host. If the operation is repeated, then only incrementally changed files will be copied out. (To incrementally delete files on the target, add the deletedest:true flag).

Note you will need to open port 2999 on your host’s firewall for this to work.

#!/bin/bash -

set -x

# The target directory.
mkdir -p /tmp/backup

# Create the daemon.
rm -f /tmp/rsyncd.pid

cat <<EOF > /tmp/rsyncd.conf
port = 2999
pid file = /tmp/rsyncd.pid

[backup]
  path = /tmp/backup
  use chroot = false
  read only = false
EOF

rsync --daemon --config=/tmp/rsyncd.conf

# Run guestfish and attach to the guest.
guestfish --ro --network -a /dev/fedora/f19rawhidex32 -i <<EOF
trace on
rsync-out /home rsync://rjones@192.168.122.1:2999/backup archive:true
EOF

# Kill the rsync daemon.
kill `cat /tmp/rsyncd.pid`

2 Comments

Filed under Uncategorized

Garden office – undercoat done

image

Inside there’s a ring for sockets and a lighting circuit. The windows and doors are pre-made double-glazed units.

image

2 Comments

Filed under Uncategorized

Garden office – roof going on

image

6 Comments

April 19, 2013 · 2:15 pm

Garden office – construction continues

image

Update: Further progress this morning …

image

9 Comments

April 18, 2013 · 5:39 pm

5 minute introduction to Augeas (config file editing library)

Dominic Cleal’s short introduction to the Augeas configuration API.

We use Augeas a lot in libguestfs and virt-v2v, and it’s been very effective for us.


I asked Dominic how he made this video.

He uses gtk-recordmydesktop, max 100/100 audio/video quality, 30fps, 2 channel audio at 48kHz.

Sound and video are recorded at the same time, with a Sennheiser headset.

Editing is done in kdenlive.

Leave a Comment

Filed under Uncategorized

Garden office – construction starts

image

The cabin has a double wall which will contain insulation. Shown here is the ring main for the four sets of sockets around the room.

image

2 Comments

April 18, 2013 · 1:55 pm

Garden office – constructing the base

Also (not shown) they dug a trench down the side of the garden for electrics and network cables. We’re going to run some hefty armoured cable, plus two or three cat 7 network cables, covered with bricks and warning tape, at a depth of 18″ (mandated by building regulations).

Leave a Comment

April 17, 2013 · 1:31 pm

Garden office

As some readers might know, I work from home, and have worked from home for about 12 years. However I’ve never had a proper dedicated office, just a corner of a second bedroom or a bit of space on a sofa. That’s about to change.

Tomorrow, work starts on constructing a real office in my garden.

Work already started (for me) about a month ago, when I took down a shed and jack-hammered a patio to bits:

office-1

Shifting the whole lot into two skips:

office-2

Resulting in this empty, mostly flat space (about 20′ wide and 16′ deep, damn you council for chopping that tree down at the back …):

office-3

To be continued …

6 Comments

Filed under Uncategorized

Use guestfish, virt tools with remote disks

New in libguestfs ≥ 1.21.30 is the ability to use guestfish and some of the virt tools with remote disks.

Currently you can use remote disks over NBD, GlusterFS, Ceph, Sheepdog and (recently upstream) SSH.

For this example I’ll use SSH because it needs no setup, although this requires absolutely the latest qemu and libguestfs (both from git).

Since we don’t have libvirt support for ssh yet, so this only works with the direct backend:

$ export LIBGUESTFS_BACKEND=direct

I can use a ssh:// URI to add disks with guestfish, guestmount and most of the virt tools. For example:

$ virt-rescue -a ssh://localhost/tmp/f17x64.img
[... lots of boot messages ...]
Welcome to virt-rescue, the libguestfs rescue shell.

Note: The contents of / are the rescue appliance.
You have to mount the guest's partitions under /sysroot
before you can examine them.

><rescue> mount /dev/vg_f17x64/lv_root /sysroot
><rescue> cat /sysroot/etc/redhat-release
Fedora release 17 (Beefy Miracle)

Apart from being a tiny bit slower, it just works as if the disk was local:

$ virt-df -a ssh://localhost/tmp/f17x64.img
Filesystem                           1K-blocks       Used  Available  Use%
f17x64.img:/dev/sda1                    487652      63738     398314   14%
f17x64.img:/dev/vg_f17x64/lv_root     28316680    4285576   22586036   16%
$ guestmount -a ssh://localhost/tmp/f17x64.img -i /tmp/mnt
$ ls /tmp/mnt
bin   dev  home  lib64       media  opt   root  sbin  sys  usr
boot  etc  lib   lost+found  mnt    proc  run   srv   tmp  var
$ cat /tmp/mnt/etc/redhat-release
Fedora release 17 (Beefy Miracle)
$ guestunmount /tmp/mnt

Leave a Comment

Filed under Uncategorized