Jenne's regexp

perl -p -i -e 's/\\\"\$([a-z]+)\[([a-z]+)\]\\\"/\047\"\.\$$1\[$2\]\.\"\047/g'

perl -p -i -e 's/\$([a-z]+)\[([a-z]+)\]/\$$1\[\047$2\047\]/g'


make nbd and dm available in lxc

change config inĀ /usr/share/lxc/config e.g. debian.common.conf

uncomment / add

lxc.aa_profile = lxc-container-default-with-mounting

lxc.mount.auto = cgroup

## dev mapper

lxc.cgroup.devices.allow = c 10:236 rwm

## loop devices

lxc.cgroup.devices.allow = b 7:* rwm

## nbd devices

lxc.cgroup.devices.allow = b 43:* rwm

## dm devices

lxc.cgroup.devices.allow = b 251:* rwm

lxc.cgroup.devices.allow = b 252:* rwm


convert ext4 to xfs

apt-get install xfsprogs!!

boot gparted to shrink partitions / setup empty partition for xfs (e.g. vda3).

boot debian live rescue:

- mkfs.xfs -f /dev/vda3

- mount both partitions and cp -a /mnt2/* /mnt

- empty /mnt2 and move everything from /mnt/boot over

- umount /mnt2 ; mount /dev/vda1 /mnt/boot ; mount -o bind /dev /mnt/dev ; mount -o bind /sys /mnt/sys ; mount -o bind /proc /mnt/proc

- nano /mnt/etc/fstab -> /dev/vda1 /boot etx4 defaults 0 1 ; /dev/vda3 / xfs defaults 0 1

- chroot /mnt ; grub-install /dev/vda ; update-grub

- exit ; umount /mnt/boot ; umount /mnt/dev ; umount /mnt/sys ; umount /mnt/proc ; umount /mnt

reboot to hdd and check.

afterwards may resize all partitions with gparted accordingly and change /etc/fstab to UUIDs and wanted mount options.


resparse raw image

qemu-img convert -O raw ./vm-210-disk-1.raw.bak ./vm-210-disk-1.raw


hard kill multiple processes by grepping

kill -9 $(ps ax  | awk '/spiceproxy/ {print $1}')