bin: fix various scripts

This commit is contained in:
xeruf 2023-09-27 15:38:23 +02:00
parent 01585d4e14
commit da7d70ebd0
6 changed files with 10 additions and 7 deletions

View File

@ -1,3 +1,3 @@
#!/bin/sh
# Set exec flag on all files that should be executable
find -maxdepth 4 -name "*.sh" -o -path '*/githooks/*' "$@" -exec chmod -v +x {} +
find -maxdepth 4 \( -name "*.sh" -o -path '*/githooks/*' \) "$@" -exec chmod -v +x {} +

View File

@ -4,7 +4,7 @@
set -o pipefail
# jq if file is valid json, otherwise show parseable lines with bat
{ jq --unbuffered '' "$@" ||
{ jq --unbuffered '.' "$@" ||
# add echo in case file is missing newline at the end
{ for arg; do echo "FILE: $arg ─────────────────────────────────────────────────────────────────────────────────────────"; cat "$arg"; done; echo; } |
while read -r line

View File

@ -5,9 +5,10 @@
typeset -A _clean_map
_clean_map=([h]=$XDG_CACHE_HOME [t]=/var/tmp [l]=/var/log [v]=/var/cache)
# TODO .mix - outdated version in socha
_clean_home=(.ant .autopsy .bundle .cache .cargo .cpanm .docker .electron .electron-gyp .gradle .gradle-kotlin-dsl .hex .java .kscript .konan .m2 .nix-defexpr .node-gyp .nv .openjfx .parallel .stack .surf .texlive
.yarn .node_modules .npm .pnpm-store
luametatex-cache luatex-cache
_clean_home=(.ant .autopsy .bundle .cache .cargo .cpanm .docker .stack .hex .nix-defexpr .parallel .surf
.yarn .node_modules .npm .pnpm-store .node-gyp .nv .electron .electron-gyp
.gradle .gradle-kotlin-dsl .java .kscript .konan .m2 .openjfx
.log luametatex-cache luatex-cache .texlive
.lesshst .python_history .rubberband.wisdom.d .yarnrc)
[[ $1 =~ "." ]] && local=pwd

View File

@ -22,7 +22,7 @@ case $1 in
(*|ftt) host=git@code.ftt.gmbh; user=janek;;
esac
user=${3:-${user:-$(git config user.name)}}
repo=${2:-$(basename $PWD)}
repo=${2:-$(basename $(git root))}
if test "$http"
then echo "$http://${host#git*@}/$user/$repo.git"
else echo "$host:$user/$repo.git"

View File

@ -0,0 +1,2 @@
#!/bin/sh -x
sudo systemctl restart systemd-resolved systemd-networkd NetworkManager

View File

@ -32,7 +32,7 @@ echo "Using offset ${h}x and ${v}y"
export TEXMF=""
pdfjam $quiet "$signature" --outfile "$sig" --papersize "{595pt, 842pt}" --noautoscale true \
--offset "${h}pt ${v}pt" --scale "${4:-1}"
rm "$result"
rm -f "$result"
pdfjam $quiet "$1" ${page:-last} "$sig" --outfile "$tmp_signed" --delta "0 -842pt" --nup "1x2" --fitpaper true
# TODO consider pdftk stamp