Skip to content

Instantly share code, notes, and snippets.

View HoffmannP's full-sized avatar

Peter Hoffmann HoffmannP

View GitHub Profile
@HoffmannP
HoffmannP / gist:7921504
Created December 12, 2013 00:59
Creating a copy of you harddrives for a virtual machine copy
#!/bin/bash
## VM Clone ##
VM="$1" # "MeinRechner"
System="Debian_64"
isoFolder="$2" #"/root/VirtualBox VMs/MeinRechner"
strgCtl="sata"
VBM="/usr/bin/VBoxManage"
$VBM createvm --name $VM --ostype $System --register
$VBM storagectl $VM --name $strgCtl --add sata
@HoffmannP
HoffmannP / gist:7405635
Created November 11, 2013 00:02
My .zshrc
# history
HISTFILE=~/.zsh/histfile
HISTSIZE=1000
SAVEHIST=1000
setopt appendhistory
setopt hist_expire_dups_first hist_ignore_space share_history
setopt autocd beep extendedglob nomatch notify
autoload -Uz up-line-or-beginning-search
SELECT
IF(a <=> NULL, 1, a),
IF( a IS NULL, 1, a ),
IF( a IS NOT NULL, a, 1 ),
IF( ISNULL(a), 1, a ),
IF( !ISNULL(a), a, 1 ),
IF( !!ISNULL(a), 1, a ),
IFNULL( a, 1 )
FROM
(SELECT 1 as a) as tmp
# using the instructions from http://golang.org/doc/code.html
# either use the first command line argument or read the test directory
if [ $# -gt 0 ]; then
dir=$1;
else
read -p "test directory: " dir
fi
###############################