summaryrefslogtreecommitdiff
path: root/config/essentials/shell/functions.sh
diff options
context:
space:
mode:
authorRaymaekers Luca <raymaekers.luca@gmail.com>2024-06-22 02:05:44 +0200
committerRaymaekers Luca <raymaekers.luca@gmail.com>2024-06-22 02:05:44 +0200
commit36d2972c60ec86b873fa496d1f5ea95cf748cf49 (patch)
treea6d6750fa17c2964cd241afa8e963cac6106b390 /config/essentials/shell/functions.sh
parent4914b43f642e2772a140a8f9b1f26b4e555ed88b (diff)
parent32256e087aaf7744348a5ba33e802d5c8d9d97dd (diff)
Merge branch 'main' of db:dotfiles
Diffstat (limited to 'config/essentials/shell/functions.sh')
-rw-r--r--config/essentials/shell/functions.sh20
1 files changed, 10 insertions, 10 deletions
diff --git a/config/essentials/shell/functions.sh b/config/essentials/shell/functions.sh
index b69b775..27eb33e 100644
--- a/config/essentials/shell/functions.sh
+++ b/config/essentials/shell/functions.sh
@@ -241,6 +241,7 @@ pacsize()
mime-default ()
{
+ mime=
[ "${mime:=$1}" ] ||
mime="$(find /usr/share/applications/ -iname '*.desktop' -printf '%f\n' |
sed 's/\.desktop$//' |
@@ -305,7 +306,7 @@ gdown () {
}
# toggle wireguard vpn on $1 -> interface
-wgtoggle() {
+wgt() {
d="${1:-wg0}"
ip -br a | awk '{print $1}' | grep "$d" > /dev/null &&
doas wg-quick down "$d" ||
@@ -317,17 +318,10 @@ serve() {
if [ "$1" ]
then
logn "Serving $1"
- docker container run \
- --rm \
- --volume "$(readlink -f "$1")":/data \
- --publish 80:5000 sigoden/dufs /data
+ dufs "$1"
else
-
logn "Receiving files.."
- docker container run \
- --rm \
- --volume /tmp/data:/data \
- --publish 80:5000 sigoden/dufs /data --allow-upload
+ dufs /tmp/data --alow-upload
fi
}
@@ -364,3 +358,9 @@ ssh_port()
ssh -f -N -L 0.0.0.0:"$3":localhost:"$1" "$2"
>&2 printf "Forwarded port '%s' on '%s' to '%s'.\n" "$1" "$2" "$3"
}
+ffconcat () {
+ tmp=$(mktemp -p . ffconcat.XXXXX)
+ sed 's/.*/file &/' > "$tmp"
+ ffmpeg -y -f concat -safe 0 -i $tmp -c copy "$1"
+ rm $tmp
+}