So i searched for a way to remap 'AltGr + y' to '|', 'AltGr + ,' to '<' and 'AltGr + .' to '>'
Console
evaluate the key to change with
#> sudo showkey -s
press the key
here y is 0x2c = 44
here , is 0x33 = 51
here . is 0x34 = 52
test remap with
echo "altgr keycode 44 = bar" | loadkeys
bar is a symbolic name i found at German-Howto
Finally i extended /etc/rc.local with
LOADKEYS=$(which loadkeys)
if [ -x $LOADKEYS ]; then
cat << EOT | $LOADKEYS
altgr keycode 44 = bar
altgr keycode 51 = less
altgr keycode 52 = greater
EOT
unset LOADKEYS
fi
Xorg
evaluate the key to change with
#> xev
press the key
here y is keycode 52
here , is keycode 59
here . is keycode 60
test remap with
xmodmap -e "keycode 52 = y Y y Y bar"
dump keys with
#> xmodmap -pke > ~/.Xmodmap
remove all lines except lines starting with desired keycodes to change.
my ~/.Xmodmap now looks like
keycode 52 = y Y y Y bar U203A guillemotright
keycode 59 = comma semicolon comma semicolon less multiply periodcentered
keycode 60 = period colon period colon greater division U2026
[ view entry ] ( 2530 views ) | print article
These are scripts to backup system's and build an image for an usb stick or kvm for testing:
rescue.tar.gz
The only thing to configure is the backup-script:
All your partition's must have an UUID.
With "uuidgen | xargs mkswap /dev/sda1 -U" and "uuidgen | xargs tune2fs /dev/sda1 -U" you can generate one.
This is an example of a backup of a system with two partitions:
#!/bin/sh* for each tar an exlude-file can be defined
cat >root_exclude <<EOF
/lost+found/*
/tmp/*
EOF
cat >var_exclude <<EOF
./tmp/*
./run/*
./lock/*
./log/messages*
./lost+found/*
EOF
sudo tar -cSp --one-file-system --numeric-owner --atime-preserve \
--exclude-from=root_exclude -f $(hostname).root.tar /
sudo tar -cjSp --one-file-system --numeric-owner --atime-preserve \
--exclude-from=var_exclude -f $(hostname).var.tar.bz2 --directory /var .
uuid() { sudo blkid -o value -s UUID /dev/$1; }
fstype() { sudo blkid -o value -s TYPE /dev/$1; }
inodesize() { sudo tune2fs -l /dev/$1 | grep "Inode size" | sed -e 's/[^0-9]//g'; }
raiduuid() { sudo sed -n "s/^.*$1.*UUID=\(.*\)/\1/p" /etc/mdadm/mdadm.conf; }
partitioninfo() { echo "$(echo $1|sed -e 's/[^0-9]//g') $(uuid $1) $(fstype $1)"; }
cat >$(hostname).cfg <<EOF
DISK_PARTITIONS=",1024,S;,10000,L,*;,,L"
ARCHIVES="$(partitioninfo sda2) $(hostname).root.tar.bz2
$(partitioninfo sda3) $(hostname).var.tar.bz2"
SWAP="1 $(uuid sda1)"
GRUB=1
GRUB1_PARTITION=1
GRUB1_INODESIZE=$(inodesize sda2)
EOF
* files are named HOSTNAME.root.tar.bz2, HOSTNAME.var.tar.bz2 and HOSTNAME.cfg
* this backup needs a small config-file (HOSTNAME.cfg)
DISK_PARTITIONS is used by sfdisk and has to be definded in its INPUT FORMAT
ARCHIVES takes a config line for each partition with an optional tar archive at the end
SWAP starts with the number of the partition and the uuid of it
GRUB needs the version of grub
GRUB1_PARTITION is only needed for grub 1 and is the boot partition (counting starts with 0)
GRUB1_INODESIZE is needed because older grub1 can not boot with a filesystem of different inode size
For a raid1 system with only one filesystem the config looks like
DISK_PARTITIONS=",8000,S;,,L,* ,8000,S;,,L,*"After running the backup script HOSTNAME.root.tar.bz2, HOSTNAME.var.tar.bz2 and HOSTNAME.cfg are build.
RAID_UUIDS="$(raiduuid md0) $(raiduuid md1)"
ARCHIVES="$(partitioninfo md1) $(hostname).root.tar.bz2"
SWAP="0 $(uuid md0)"
GRUB=1
GRUB1_PARTITION=1
GRUB1_INODESIZE=$(inodesize md1)
Now you can run ./rescue-build.sh or copy these files to your backup server (where you put the files from other systems) and run there ./rescue-build.sh. Now you got a directory called image with all your archives, your running kernel and a configured initrd (initramfs).
With ./rescue-create-stick.sh /dev/STICKDEVICE your stick to restore is prepared (Warning all data on the stick is erased!).
With kvm you can test the restore process:
Therefore run sudo ./rescue-create-kmv-image.sh.
The build image can be mounted with sudo ./rescue-kvm-mount.sh to ./mnt and unmounted with sudo ./rescue-kvm-umount.sh.
Test the image with rescue-kvm-restore.sh and test the restored image with ./rescue-kvm-test.sh.
[ view entry ] ( 1539 views ) | print article
$ sudo apt-get install build-essential fakeroot dpkg-dev
$ mkdir build
$ cd build
$ sudo apt-get source foo
$ sudo apt-get build-dep foo
$ cd foo
$ dpkg-buildpackage -rfakeroot -b -us -uc -nc
-nc does not clean, usefull if you change something and rebuild
http://www.cyberciti.biz/faq/rebuilding ... y-package/
[ view entry ] ( 1329 views ) | print article
dpkg-query --show --showformat='${Installed-Size}\t${Package}\t${Status}\n' | grep -v deinstall | sort -nr | less
adapted from Martins Blog
Clear dpkg status file
dpkg-Status sorted:
grep Status /var/lib/dpkg/status|sort|uniq -c
purge rc packages:
dpkg -P $(dpkg -l \*|grep ^rc|awk '{print $2}')
purge for other status:
grep -B 2 'deinstall ok config-files' /var/lib/dpkg/status|sed /^$/d |grep Package|awk '{print $2}'
[ view entry ] ( 1080 views ) | print article
Clusterssh opens for each connection a xterm and sends a keystroke to each window.
You can also work in only one xterm.
#> apt-get install clusterssh
I use approxd for caching .deb's using port 9999. This port is not reachable by all my hosts,
therefore i use remote port forwarding from ssh.
I can type
#> cssh -o "-R9999:approxy:9999" host1 host2 host3
or create a default config
#> cssh -u > $HOME/.csshrc
You can define different clusters aliases. Each alias consists of some hosts:
clusters = apt monnow i only type
apt = host1 host2 host3
ssh_args= -x -o ConnectTimeout=10 -R9999:approxy:9999
#> cssh apt
a small patch makes "retile windows" working for me:
--- ClusterSSH.pm.orig 2010-09-27 13:23:02.561375883 +0200
+++ /usr/share/perl5/App/ClusterSSH.pm 2010-09-27 13:09:27.011375882 +0200
@@ -1319,7 +1319,7 @@
logmsg( 3,
"x:$current_x y:$current_y, r:$current_row c:$current_col" );
- $xdisplay->req( 'UnmapWindow', $servers{$server}{wid} );
+# $xdisplay->req( 'UnmapWindow', $servers{$server}{wid} );
if ( $config{unmap_on_redraw} =~ /yes/i ) {
$xdisplay->req( 'UnmapWindow', $servers{$server}{wid} );
[ view entry ] ( 947 views ) | print article
<<First <Back | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | Next> Last>>