config/bash: pve tools

This commit is contained in:
xeruf 2023-11-15 20:49:25 +01:00
parent eda4de9d2c
commit d79346de86
2 changed files with 22 additions and 0 deletions

View File

@ -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'

14
.config/bash/pve.bash Normal file
View File

@ -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
}