X-Git-Url: https://iankelling.org/git/?a=blobdiff_plain;f=brc2;h=8406dab33a401d26c380d39051b2a2c492b8e4a8;hb=7ed3b98c4d3678d982c33741f1f42727144e66ce;hp=6ac51839640d6b111de332c2196a89468ff154f4;hpb=3ba18a2c386a5a9962cf7b47f490a17f244a0774;p=distro-setup diff --git a/brc2 b/brc2 index 6ac5183..8406dab 100644 --- a/brc2 +++ b/brc2 @@ -1682,11 +1682,9 @@ jdo() { if [[ $cmd != /* ]]; then cmd=$(type -P "$cmd") fi + #note date format for since is date '+%F %T' # -q = quiet - journalctl -qn2 -f -u "$cmd_name" & - # Trial and error of time needed to avoid missing initial lines. - # .5 was not reliable. 1 was not reliable. 2 was not reliable - sleep 4 + journalctl --since=now -qn2 -f -u "$cmd_name" & jr_pid=$! # note, we could have a version that does system --user, but if for example # it does sudo ssh, that will leave a process around that we can't kill @@ -2038,7 +2036,7 @@ apache-apply-repo() { apache-apply() { for file; do - if head -n1 "$file"| grep -E '^#!/bin/bash\b' &>/dev/null; then + if head -n1 "$file"| grep -E '^#!/' &>/dev/null; then { head -n1 "$file" apache-header @@ -4177,10 +4175,7 @@ vpn() { fi [[ $1 ]] || { echo need arg; return 1; } - journalctl --unit=$vpn_service@$1 -f -n0 & - # sometimes the journal doesnt open until after the vpn output - # has happened. hoping this fixes that. - sleep 1 + journalctl --since=now --unit=$vpn_service@$1 -f -n0 & sudo systemctl start $vpn_service@$1 # sometimes the ask-password agent does not work and needs a delay. sleep .5 @@ -4199,15 +4194,17 @@ fixu() { fi } -# unmute +# unmute desktop output um() { - local sink card + local sink card sedcmd sink=$(pactl get-default-sink) if [[ $sink == auto_null ]]; then # guessing there is just one with an off profile. otherwise we will # need some other solution, like storing the card identifier that we - # muted with nap. - card=$(pacmd list-cards | sed -n '/^[[:space:]]*index:/{s/^[[:space:]]*index://;h};/^[[:space:]]*active profile: $/{g;p;q}') + # muted with nap. Or, we could so some hakery with + # pactl -f json. + sedcmd='/^[[:space:]]*index:/{s/^[[:space:]]*index://;h};/^[[:space:]]*active profile: $/{g;p;q}' + card=$(pacmd list-cards | sed -n "$sedcmd") m pacmd set-card-profile "$card" output:analog-stereo fi @@ -4725,7 +4722,8 @@ ftoc() { units "tempF($1)" tempC } -# requires dns/firewall setup first +# note: requires dns setup of live.iankelling.org, & if i'm home, port +# forwarding in wrt-setup-local. todo: automate that. local-icecast() { web-conf -e ian@iankelling.org -f 8000 - apache2 live.iankelling.org <<'EOF' @@ -4778,17 +4776,24 @@ opensslcertinfo() { # dsh on btrbk hosts dsb() { -: - } + : +} # dsh a file and run it dsa() { local ret file if ! parallel -j 10 scp x {}:/tmp <~/.dsh/group/btrbk; then echo parallel scp failed. dsa returning $ret - fi + fi dsh -g btrbk - } +} + +# temporary +zmqsend() { + /nocow/t/ffmpeg-release/ffmpeg-7.0.1/tools/zmqsend "$@" +} + +ffg() { /nocow/t/ffmpeg-release/ffmpeg-7.0.1/tools/graph2dot -o /tmp/g.tmp && dot -Tpng /tmp/g.tmp -o /tmp/g.png && feh /tmp/g.png; } export BASEFILE_DIR=/a/bin/fai-basefiles