From 17f9da0249664429c68ec2128ccbf66577f43e53 Mon Sep 17 00:00:00 2001 From: Andrew Lorimer Date: Thu, 4 Feb 2021 22:04:21 +1100 Subject: [PATCH] add some scripts --- ib-tuning.sh | 14 ++++++++++++++ lastframe.sh | 9 +++++++++ pass-export.sh | 13 +++++++++++++ 3 files changed, 36 insertions(+) create mode 100755 ib-tuning.sh create mode 100755 lastframe.sh create mode 100755 pass-export.sh diff --git a/ib-tuning.sh b/ib-tuning.sh new file mode 100755 index 0000000..ac97bcc --- /dev/null +++ b/ib-tuning.sh @@ -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 index 0000000..45dd995 --- /dev/null +++ b/lastframe.sh @@ -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 index 0000000..3e0cad5 --- /dev/null +++ b/pass-export.sh @@ -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 -- 2.47.1