X-Git-Url: https://iankelling.org/git/?p=distro-setup;a=blobdiff_plain;f=brc2;h=0211a643258562b3dbd5f52284826a0a5c676cb1;hp=6497accdce4f78007036d34acf10c63dc29873de;hb=dc34d23c63cd83a7cc7a79525445aad3293c7241;hpb=ac3e00755e07d2e298769000f7ea50bc0854b510 diff --git a/brc2 b/brc2 index 6497acc..0211a64 100644 --- a/brc2 +++ b/brc2 @@ -417,7 +417,7 @@ _iki-convert() { fi case $input in http*) - path="$repo_dir/${input##https://$domain/wiki/}" + path="$repo_dir/${input##http*://$domain/wiki/}" if [[ $path == */ ]]; then path=${path%/}.mdwn fi @@ -425,52 +425,13 @@ _iki-convert() { ;; *) path=$(fp "$input") - url="https://$domain/wiki/${path#$repo_dir/}" + url="http*://$domain/wiki/${path#$repo_dir/}" url="${url%.mdwn}/" j echo "$url" ;; esac } -# Convert brains file path to url and vice versa. It copies the result to clipboard -# usage: brains [URL_OR_PATH] -brains() { - local url path input repo_dir err path - repo_dir=/a/f/brains - err=false - if ! type -p xclip &>/dev/null; then - echo "missing dependency for brains, please do: sudo apt install xclip" >&2 - err=true - fi - if ! type -p pee &>/dev/null; then - echo "missing dependency for brains, please do: sudo apt install moreutils" >&2 - err=true - fi - if $err; then - return 1 - fi - if [[ $1 ]]; then - input="$*" - else - read -r -p "enter path or url"$'\n' input - fi - case $input in - http*) - path="$repo_dir/${input##https://brains.fsf.org/wiki/}" - if [[ $path == */ ]]; then - path=${path%/}.mdwn - fi - printf "%s\n" "$path" |& pee "xclip -r -selection clipboard" cat - ;; - *) - path=$(realpath -s "$input") - url="https://brains.fsf.org/wiki/${path#$repo_dir/}" - url="${url%.mdwn}/" - echo "$url" |& pee "xclip -r -selection clipboard" cat - ;; - esac -} - # Generate beet smartplaylists for navidrome. # for going in the reverse direction, run @@ -1333,13 +1294,15 @@ btrbk-host-debug() { mkdir -p /tmp/b/s for host in $remote $alt; do - # 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 + h=$(ssh $host hostname) + rsync -a /var/log/btrbk $host:/var/log/btrbk /var/log/btrbk/$h + grr '\bsnapshot success' /var/log/btrbk/$h >/tmp/b/$h.log + + ## 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 done - if [[ ! -s /tmp/b/local.log ]]; then - jrbtrbk >/tmp/b/local.log - fi + gr '\bsnapshot success' /var/log/btrbk/*.log >/tmp/b/local.log cd /tmp/b for f in *.log; do gr '\bsnapshot success' $f >s/$f @@ -3509,7 +3472,7 @@ monero() { # rg my main files rgm() { - rg "$@" /p/pd.org /p/w.org /a/t.org /a/work.org /b + rg "$@" /p/w.org /a/t.org /a/work.org /b } reset-konsole() {