diff --git a/.config/bash/aliases.bash b/.config/bash/aliases.bash index 5d8424a..edd0f60 100644 --- a/.config/bash/aliases.bash +++ b/.config/bash/aliases.bash @@ -14,6 +14,14 @@ alias scr="$sudo systemctl daemon-reload && $sudo systemctl reload-or-restart" alias hist='history | less' alias m='mv -vi' +# Fast Find +ff() { + name=$1 + shift + $(command -v fd || echo fdfind) --hidden "$name" || + find "$@" -name "*$name*" +} + highlight() { echo "$1"; } status() { highlight 'System' diff --git a/.config/bash/pve.bash b/.config/bash/pve.bash new file mode 100644 index 0000000..08ffa71 --- /dev/null +++ b/.config/bash/pve.bash @@ -0,0 +1,14 @@ + +[[ $- == *i* ]] && zfs list -d 0 + +alias cluster='scr corosync && scr pvesr' +qcow() { qemu-img convert $1 -O qcow2 ${2:-$1}.qcow2; } +extrac() { + for var; do + arg=${var%.lzo} + out=$(basename ${arg%.vma}) + lzop -x $arg.lzo + vma extract $arg $out && + ( cd $out && find *.raw -exec qemu-img convert {} -O qcow2 $arg-{}.qcow2 \; ) + done +}