diff --git a/.local/bin/scripts/b b/.local/bin/scripts/b index fa45a46..dc60c0d 100755 --- a/.local/bin/scripts/b +++ b/.local/bin/scripts/b @@ -32,7 +32,7 @@ shift "$(($OPTIND -1))" checkperm() { checkaccess -r "$@" || elevate=sudo - mime="$(test -n "$shifted" || $elevate file --dereference --mime -- "$@")" + mime="$(test -n "$shifted" || $elevate file --dereference --mime-type -- "$@")" } fileinfo() { tput setaf 4 @@ -79,7 +79,7 @@ for arg; do tmpfile="$prefix/$(basename -- "$arg")_$(dd "if=$arg" bs=512 count=10 2>/dev/null | md5sum | tr -d ' ' || true)" mkdir -p "$prefix" case "$mime" in - (*\ application/pdf\;*) + (*\ application/pdf) grid=$(expr $(tput cols) \* $# / $(tput lines)) grid=$(expr 3 \& $grid \< 3 \| $grid) #limit=$(expr $grid \& \( $grid \> 3 \| $# \> 1 \) \| $grid '*' 2) @@ -101,6 +101,7 @@ for arg; do timg+=("$tmpfile");; # TODO .raw .img (*/x-iso*|*/x-qemu-disk*) fdisk -l "$arg";; + (*/vnd.android.package-archive) aapt dump badging "$arg" | grep package | cut -d' ' -f2-;; (*\ video/*) suffix=_thumbs.jpg ! $inspect && @@ -113,7 +114,7 @@ for arg; do (*\ image/*) timg+=("$arg") which identify >/dev/null && continue;; - (*\ inode/directory\;*) + (*\ inode/directory) ls+=("$arg") test -L "$arg" || continue ;; diff --git a/.local/bin/scripts/bag b/.local/bin/scripts/bag index a47969a..f11ce2f 100755 --- a/.local/bin/scripts/bag +++ b/.local/bin/scripts/bag @@ -3,6 +3,7 @@ # Usage: bag [-n] [--dry-run] [--home] [--root MOUNTED_ROOT] root="/" args="--progress --stats" +case $BORG_REPO in (*:*) run=borg;; esac while test $# -gt 0; do case "$1" in (-n) run="arg-test"; shift;; diff --git a/.local/bin/scripts/clean b/.local/bin/scripts/clean index 2a06dda..4c92427 100755 --- a/.local/bin/scripts/clean +++ b/.local/bin/scripts/clean @@ -78,7 +78,7 @@ highlight "c :: clean electron caches" highlight "o :: optimize space extensively" if [[ $1 =~ "o" ]]; then - sudo find /root/.cache $XDG_CACHE_HOME /var/cache /var/log /var/tmp -mindepth 1 -maxdepth 2 -atime +2 -exec rm -r {} + -prune + sudo find /root/.cache $XDG_CACHE_HOME /var/cache /var/log /var/tmp -not -name CACHEDIR.TAG -mindepth 1 -maxdepth 2 -atime +2 -exec rm -r {} + -prune if test -f "/var/log/apt/history.log"; then aptclean_cur=$(cat "/var/log/apt/history.log" | wc -l) diff --git a/.local/bin/scripts/dif b/.local/bin/scripts/dif index 0c54081..788cf4d 100755 --- a/.local/bin/scripts/dif +++ b/.local/bin/scripts/dif @@ -26,6 +26,6 @@ fi if test "$command"; then echo "Generated through $command" $(test $(tput cols) -gt 120 && echo "diff --color=always --side-by-side" || echo "diff-color") \ - --report-identical-files --label="${files[0]}" --label="${files[1]}" <($command "${files[0]}") <($command "${files[1]}") + --ignore-case --report-identical-files --label="${files[0]}" --label="${files[1]}" <($command "${files[0]}") <($command "${files[1]}") fi } | less --RAW-CONTROL-CHARS --quit-on-intr --quit-if-one-screen diff --git a/.local/bin/scripts/git-repo b/.local/bin/scripts/git-repo index b88ef1a..70faec5 100755 --- a/.local/bin/scripts/git-repo +++ b/.local/bin/scripts/git-repo @@ -20,7 +20,7 @@ case $host in (hub|github) host=git@github.com;; (lab) host=git@gitlab.com;; (jf) host=gitea@git.jfischer.org;; - (ftt|"") host=git@code.ftt.gmbh; user=janek;; + (ftt|"") host=git@forge.ftt.gmbh; user=janek;; esac user=${3:-${user:-$(git config user.name)}} repo=${2:-$(basename $(git root))} diff --git a/.local/bin/scripts/jrnl-tag b/.local/bin/scripts/jrnl-tag index b48730b..30b601f 100755 --- a/.local/bin/scripts/jrnl-tag +++ b/.local/bin/scripts/jrnl-tag @@ -2,7 +2,7 @@ # Find terms in jrnl files and turn them into tags # Check with jrnl --tags if test $# -eq 0 -then $0 sleep nap health tech read dev phone Zinc run bike tour laptop computer PC CB piano faith journal +then $0 sleep uni work nap health tech read girl dev phone Zinc run bike tour laptop computer PC CB piano faith journal Catherine Franklin Kerstin Henri Katja else for arg do rpl "\(^\|[^@]\)\b$arg\b" "\1@$arg" $JOURNAL/*.txt 2>/dev/null diff --git a/.local/bin/scripts/moul b/.local/bin/scripts/moul index b4acbeb..538d16c 100755 --- a/.local/bin/scripts/moul +++ b/.local/bin/scripts/moul @@ -72,4 +72,5 @@ then mp="/run/media/$USER/$arg" && test -e "$mp" && mountpoint="$mp" sudo mount -vo users,X-mount.mkdir,noatime $params "$partition" "$mountpoint" "$@" fi cd $mountpoint +df -x tmpfs -x devtmpfs -x squashfs --human-readable exec $SHELL diff --git a/.local/bin/scripts/mpq b/.local/bin/scripts/mpq new file mode 100755 index 0000000..58f87b3 --- /dev/null +++ b/.local/bin/scripts/mpq @@ -0,0 +1,6 @@ +#!/bin/sh -e +# MPC add file to queue +for arg +do fullpath=$(realpath "$arg") + mpc insert "${fullpath/$MUSIC\//}" +done diff --git a/.local/bin/scripts/stack-invite b/.local/bin/scripts/stack-invite index e37ef37..d597a3a 100755 --- a/.local/bin/scripts/stack-invite +++ b/.local/bin/scripts/stack-invite @@ -2,4 +2,4 @@ #for app in wordpress nextcloud velero vikunja ninja #do stack user setrole #done -pass business/ftt/invite | envsubst | ssh nc-iridion sudo sendmail -v "$mail" +pass business/ftt/invite"$1" | envsubst | ssh nc-iridion sudo sendmail -v "$mail" diff --git a/.local/bin/scripts/stack-template b/.local/bin/scripts/stack-template index 2f57894..caf857b 100755 --- a/.local/bin/scripts/stack-template +++ b/.local/bin/scripts/stack-template @@ -243,7 +243,7 @@ metadata: namespace: flux-system spec: fields: - - fieldname: password + - fieldName: password EOF cat <"$app-secrets/$app-oauth-secret.yaml" ---