X-Git-Url: https://iankelling.org/git/?a=blobdiff_plain;f=brc2;h=108be387fd24cf1a1d9f697feaf66787a5601d81;hb=76e48ba447b07a216b6dc8786617bb0d6544858d;hp=d51add8e40365e401367a9b7b13e615c1c5fe3a7;hpb=ff877dc70b2f4f5622bf7dad3441c633b9ea1168;p=distro-setup diff --git a/brc2 b/brc2 index d51add8..108be38 100644 --- a/brc2 +++ b/brc2 @@ -289,14 +289,41 @@ tback() { # sshfs example: # s sshfs bu@$host:/bu/home/md /bu/mnt -o reconnect,ServerAliveInterval=20,ServerAliveCountMax=30 -o allow_other +edelayoff() { + echo all >/etc/exim4/no-delay-eximids +} +edelayon() { + echo >/etc/exim4/no-delay-eximids +} + eqgo() { - local -a array tmpstr + local -a array tmpstr delayon + delayon=true + if grep -qFx all /etc/exim4/no-delay-eximids; then + delayon=false + fi + if $delayon; then + echo all >/etc/exim4/no-delay-eximids + fi tmpstr=$(exiqgrep -i -r.\*) mapfile -t array <<<"$tmpstr" enn -M "${array[@]}" + if $delayon; then + echo >/etc/exim4/no-delay-eximids + fi } eqgo1() { - enn -M "$(exipick -i -r.\*|h1)" + local eid + eid="$(exipick -i -r.\*|h1)" + sed -n "/^all$/p;\$a $eid" /etc/exim4/no-delay-eximids + enn -M "$eid" +} +ennm() { + local eid + for eid; do + printf "%s\n" "$eid" >>/etc/exim4/no-delay-eximids + done + enn -M "$@" } @@ -393,7 +420,7 @@ astudio() { # Convert brains file path to url and vice versa # usage: brains [URL_OR_PATH] brains() { - _iki-convert '(/a)?/f/brains' brains.fsf.org "$@" + _iki-convert '(/a)?/f/brains' brains.fsf.org/wiki "$@" } glue() { _iki-convert '(/a)?/f/gluestick' gluestick.office.fsf.org "$@" @@ -401,9 +428,9 @@ glue() { # usage: $0 REPO_PATH [URL_OR_PATH] _iki-convert() { - local url domain path input err repo_dir dir url_dir url + local url prefix path input err repo_dir dir url_dir url repo_dir="$1" - domain="$2" + prefix="$2" shift 2 err=false if $err; then @@ -416,7 +443,7 @@ _iki-convert() { fi case $input in http*) - path="$repo_dir/${input##http*://"$domain"/wiki/}" + path="$repo_dir/${input##http*://"$prefix"/}" if [[ $path == */ ]]; then path=${path%/}.mdwn fi @@ -425,7 +452,7 @@ _iki-convert() { *) path=$(fp "$input") url_dir=$(echo "$path" | sed -r "s,^$repo_dir/,,") - url="https://$domain/wiki/$url_dir" + url="https://$prefix/$url_dir" url="${url%.mdwn}/" j echo "$url" ;; @@ -1283,7 +1310,7 @@ btrbk-date-sed() { done } jrbtrbk() { - jr -u btrbk-run -u btrbk -u switch-mail-host -u btrbk-spread "$@" + jr -u btrbk-run -u btrbk -u switch-mail-host "$@" } # internal function @@ -1327,7 +1354,7 @@ btrbk-host-debug() { ## this takes a while, we only want to do it on 1st run # if [[ -s /tmp/b/$host.log ]]; then continue; fi - # ssh $host journalctl -u btrbk-run -u btrbk -u switch-mail-host -u btrbk-spread >/tmp/b/$host.log + # ssh $host journalctl -u btrbk-run -u btrbk -u switch-mail-host >/tmp/b/$host.log done gr '\bsnapshot success' /var/log/btrbk/*.log >/tmp/b/local.log cd /tmp/b @@ -1385,8 +1412,6 @@ bbk() { # btrbk wrapper return 1 ;; esac - # run latest - install-my-scripts # todo: consider changing this to srun and having the args come # from a file like /etc/default/btrbk, like is done in exim s jdo btrbk-run "$@" @@ -1593,7 +1618,6 @@ sm() { # switch mail host if [[ ! $tmp ]]; then s ssh-add /root/.ssh/home fi - install-my-scripts s jdo switch-mail-host "$@" return $ret } @@ -2295,11 +2319,6 @@ ccomp xdg-open o # jr() { journalctl "$@" | jfilter | less ; } # jrf() { journalctl -n 200 -f "$@" | jfilter; } -jr() { journalctl "$@" ; } -jrf() { journalctl -n 200 -f "$@" ; } - - -ccomp journalctl jtail jr jrf ## old version for model01. i need to get that firmware working again. # kff() { # keyboardio firmware flash. you must hold down the tilde key @@ -2759,11 +2778,21 @@ myirc() { # use * instead of -r since that does sorted order ssh root@iankelling.org "for f in ${d[*]}; do cd \$f/#$1; grep '\/dev/null | grep -iP --color=auto "$*" ||: - rgv -m 5 "$*" $paths /a/t.org /p/w.org /a/work.org ||: + -o -name .undo-tree-history -prune \) 2>/dev/null | grep -iP --color=auto -- "$*" ||: + rgv -m 5 -- "$*" $paths /a/t.org /p/w.org /a/work.org ||: } # setup: @@ -3815,9 +3844,9 @@ rgv() { } amall() { - printf "$(tput setaf 5 2>/dev/null ||:)█ coresite █$(tput sgr0 2>/dev/null||:)" + echo "$(tput setaf 5 2>/dev/null ||:)█ coresite █$(tput sgr0 2>/dev/null||:)" amfsf "$@" - printf "$(tput setaf 5 2>/dev/null ||:)█ office █$(tput sgr0 2>/dev/null||:)" + echo "$(tput setaf 5 2>/dev/null ||:)█ office █$(tput sgr0 2>/dev/null||:)" amoffice "$@" } amallq() { # amall quiet @@ -3825,19 +3854,28 @@ amallq() { # amall quiet amoffice "$@" } amfsf() { - sedi -r '/alertmanager.url/s/@office//' ~/.config/amtool/config.yml + sedi -r '/alertmanager.url/s/@prom.office/@prom/' ~/.config/amtool/config.yml amtool "$@" } amoffice() { - sedi -r '/alertmanager.url/s/@fsf/@office.fsf/' ~/.config/amtool/config.yml + sedi -r '/alertmanager.url/s/@prom.fsf/@prom.office.fsf/' ~/.config/amtool/config.yml amtool "$@" } amls() { amall silence query "$@" } +# amtool silence add +amsa() { + amall silence add "$@" +} +# amtool silence force +amsf() { + amall silence add x!="1" +} amrmall() { - amfsf silence expire $(amfsf silence query -q) - amoffice silence expire $(amoffice silence query -q) + # note: not sure if quoting of this arg is correct + amfsf silence expire "$(amfsf silence query -q)" + amoffice silence expire "$(amoffice silence query -q)" } @@ -3849,12 +3887,12 @@ youtube-dl-update() { # https://github.com/yt-dlp/yt-dlp/wiki/Installation yt-dlp-update() { sudo curl -L https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp -o /usr/local/bin/yt-dlp -sudo chmod a+rx /usr/local/bin/yt-dlp # Make executable - } + sudo chmod a+rx /usr/local/bin/yt-dlp # Make executable +} mpvyt() { mpv --ytdl ytdl_path=/usr/local/bin/yt-dlp "$@" - } +} # taken from default changes to bashrc and bash_profile path-add --end --ifexists $HOME/.rvm/bin