From 197a1a74f468d9d69d624b19f90280a3946455e5 Mon Sep 17 00:00:00 2001 From: Raymaekers Luca Date: Tue, 16 Apr 2024 10:04:31 +0200 Subject: update --- config/essentials/shell/functions.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'config/essentials/shell') diff --git a/config/essentials/shell/functions.sh b/config/essentials/shell/functions.sh index ce02490..fa32446 100644 --- a/config/essentials/shell/functions.sh +++ b/config/essentials/shell/functions.sh @@ -68,7 +68,10 @@ sms() { ssh -t phone sendmsg "$1" "'$2'"; } trcp() { scp "$1" db:/media/basilisk/downloads/transmission/torrents/; } rln() { ln -s "$(readlink -f "$1")" "$2"; } getgit() { git clone git@db:"$1"; } + esc() { eval "$EDITOR '$(which $1)'"; } +compdef esc="which" + delfile() { curl "${2:-https://upfast.cronyakatsuki.xyz/delete/$1}"; } upfile() { curl -F "file=@\"$1\"" "${2:-https://0x0.st}"; } to_webm() { ffmpeg -y -i "$1" -vcodec libvpx -cpu-used -12 -deadline realtime "${1%.*}".webm; } @@ -292,3 +295,10 @@ edit_in_dir() { [ -f "$file" ] || return 1 $EDITOR "$file" } + +wgtoggle() { + d="${1:-wg0}" + ip -br a | awk '{print $1}' | grep "$d" > /dev/null && + doas wg-quick down "$d" || + doas wg-quick up "$d" + } -- cgit v1.2.3 From cb06bb626545a35f56f55f2abe3942262f5ca824 Mon Sep 17 00:00:00 2001 From: Raymaekers Luca Date: Mon, 29 Apr 2024 14:02:17 +0200 Subject: add serve function --- config/essentials/shell/functions.sh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'config/essentials/shell') diff --git a/config/essentials/shell/functions.sh b/config/essentials/shell/functions.sh index f8b764a..3078f46 100644 --- a/config/essentials/shell/functions.sh +++ b/config/essentials/shell/functions.sh @@ -301,4 +301,11 @@ wgtoggle() { ip -br a | awk '{print $1}' | grep "$d" > /dev/null && doas wg-quick down "$d" || doas wg-quick up "$d" - } +} + +serve() { + docker container run \ + --rm \ + --volume "$(readlink -f "$1")":/data \ + --publish 80:5000 sigoden/dufs:latest /data --allow-all +} -- cgit v1.2.3