Posts

Showing posts from April, 2012

Change dota key mapping

This is how to change dota key mapping , for accessing inventory faster. Use xkeycaps to help determine keys F1 = keypad 1 F2 = keypad 2 etc. xmodmap -e "keycode  0x43 = KP_1" xmodmap -e "keycode  0x44 = KP_2" xmodmap -e "keycode  0x45 = KP_4" xmodmap -e "keycode  0x46 = KP_5" xmodmap -e "keycode  0x47 = KP_7" xmodmap -e "keycode  0x48 = KP_8" #key 1 and 2 only: xmodmap -e "keycode 0x0A = KP_1 exclam KP_1 exclam" xmodmap -e "keycode 0x0B = KP_2 at KP_2 at"

Script to backup virtual machines

Prerequisites: - VM must be located on LVM - virsh This is my script (all vm will be backup-ed): #!/bin/sh ############################## VOLGROUP=sugriwa LOGVOLSRC=episode1 ##SOURCE=/home/export/vm TARGET=/home/backup/backupvm ## ##default LOGVOLSNAP=snapvm1 SNAPSIZE=15G ############################## if [ "x$1" != "xY" ] ; then echo $0 Y exit fi mkdir "$TARGET/xml" ALLVM=`virsh list --all | tail -n+3 | head -n-1 |  awk '{print $2}'` for a in $ALLVM; do virsh suspend $a virsh dumpxml $a > "$TARGET/xml/$a.xml" done echo creating snapshot lvcreate -L$SNAPSIZE -s -n $LOGVOLSNAP $VOLGROUP/$LOGVOLSRC for a in $ALLVM; do virsh resume $a done mkdir /mnt/$LOGVOLSNAP mount /dev/$VOLGROUP/$LOGVOLSNAP /mnt/$LOGVOLSNAP echo copying... rsync -ahvx --inplace --progress /mnt/$LOGVOLSNAP/ $TARGET/ umount /mnt/$LOGVOLSNAP rmdir /mnt/$LOGVOLSNAP echo removing snapshot lvremove -f...

Your project contains errors, developing android with eclipse

This is how to fix it: # rm  ~/.android/debug.keystore Then close your project, re-open, clean, build http://stackoverflow.com/questions/4954316/your-project-contains-errors-please-fix-it-before-running-it#_=_