add some scripts
authorAndrew Lorimer <andrew@lorimer.id.au>
Thu, 4 Feb 2021 11:04:21 +0000 (22:04 +1100)
committerAndrew Lorimer <andrew@lorimer.id.au>
Thu, 4 Feb 2021 11:04:21 +0000 (22:04 +1100)
ib-tuning.sh [new file with mode: 0755]
lastframe.sh [new file with mode: 0755]
pass-export.sh [new file with mode: 0755]
diff --git a/ib-tuning.sh b/ib-tuning.sh
new file mode 100755 (executable)
index 0000000..ac97bcc
--- /dev/null
@@ -0,0 +1,14 @@
+#!/bin/sh
+
+sysctl -w net.ipv4.tcp_timestamps=0
+sysctl -w net.ipv4.tcp_sack=1
+sysctl -w net.core.netdev_max_backlog=250000
+sysctl -w net.core.rmem_max=4194304
+sysctl -w net.core.wmem_max=4194304
+sysctl -w net.core.rmem_default=4194304
+sysctl -w net.core.wmem_default=4194304
+sysctl -w net.core.optmem_max=4194304
+sysctl -w net.ipv4.tcp_rmem="4096 87380 4194304"
+sysctl -w net.ipv4.tcp_wmem="4096 65536 4194304"
+sysctl -w net.ipv4.tcp_low_latency=1
+sysctl -w net.ipv4.tcp_adv_win_scale=1
diff --git a/lastframe.sh b/lastframe.sh
new file mode 100755 (executable)
index 0000000..45dd995
--- /dev/null
@@ -0,0 +1,9 @@
+#!/bin/bash
+
+input_fn='input.mov'
+
+image_fn='output.png'
+
+frame_count=`ffprobe -v error -count_frames -select_streams v:0 -show_entries stream=nb_read_frames -of default=nokey=1:noprint_wrappers=1 $input_fn`
+
+ffmpeg -i $input_fn -vf "select='eq(n,$frame_count-1)'" -vframes 1 "$image_fn" 2> /dev/null
diff --git a/pass-export.sh b/pass-export.sh
new file mode 100755 (executable)
index 0000000..3e0cad5
--- /dev/null
@@ -0,0 +1,13 @@
+#!/usr/bin/env bash
+# taken from https://unix.stackexchange.com/a/170546
+# export passwords to external file
+
+shopt -s nullglob globstar
+prefix=${PASSWORD_STORE_DIR:-$HOME/.password-store}
+
+for file in "$prefix"/**/*.gpg; do                           
+    file="${file/$prefix//}"
+    printf "%s\n" "Name: ${file%.*}" >> exported_passes
+    pass "${file%.*}" >> exported_passes || "Failed to export $file"
+    printf "\n\n" >> exported_passes
+done