X-Git-Url: https://iankelling.org/git/?a=blobdiff_plain;f=brc;h=84386907d92e1f4f53683068ac70ec77d73d48c5;hb=77f3e699ab79d597d22fc052ed03d25cf0ad02da;hp=c243706a73660932f6994e4e84214cdf5c7d282f;hpb=88d40e435fe7d525e033558101f0c0a8101c27b2;p=distro-setup diff --git a/brc b/brc index c243706..8438690 100644 --- a/brc +++ b/brc @@ -188,8 +188,9 @@ if [[ $SOE ]]; then fi path_add /a/exe -# end just because it seems safer -path_add --end node_modules/.bin +# add this with absolute paths as needed for better security +#path_add --end /path/to/node_modules/.bin + # pip3 --user things go here: path_add --end ~/.local/bin path_add --ifexists --end /a/work/libremanage @@ -328,6 +329,18 @@ anki() { fi } +ap() { + # pushd in case current directory has an ansible.cfg file + pushd /a/xans + ansible-playbook -v -l ${1:- $(hostname -f)} site.yml + popd +} +aw() { + pushd /a/work/ansible-configs + time ansible-playbook -v -i inventory adhoc.yml "$@" + popd +} + astudio() { # googling android emulator libGL error: failed to load driver: r600 # lead to http://stackoverflow.com/a/36625175/14456 @@ -342,9 +355,20 @@ b() { bbk() { c / + local active=true + if systemctl is-active btrbk.service; then + echo "cron btrbk is already running" + return 1 + fi + systemctl is-active btrbk.timer || active=false + if $active; then + ser disable btrbk.timer + fi # run latest install-my-scripts - btrbk-run "$@" + if ! btrbk-run "$@" && $active; then + ser enable btrbk.timer + fi } bfg() { java -jar /a/opt/bfg-1.12.14.jar "$@"; } @@ -353,19 +377,11 @@ bigclock() { xclock -digital -update 1 -face 'arial black-80:bold' } -bpush() { - case $HOSTNAME in - tp) target=x2 ;; - x2) target=tp ;; - esac - btrbk-run -t $target && switch-mail-host $HOSTNAME $target -} bpull() { - case $HOSTNAME in - tp) source=x2 ;; - x2) source=tp ;; - esac - btrbk-run -s $source && switch-mail-host $source $HOSTNAME + c / + # run latest + install-my-scripts + switch-mail-host $1 $HOSTNAMEs } btc() { @@ -932,7 +948,11 @@ gpg() { } gse() { - git send-email --notes '--envelope-sender=' \ + local email=ian@iankelling.org + if readlink ~/.mu | grep fsf &>/dev/null; then + email=iank@fsf.org + fi + git send-email --notes "--envelope-sender=<$email>" \ --suppress-cc=self "$@" } @@ -1087,25 +1107,20 @@ ipdrop() { s iptables -A INPUT -s $1 -j DROP } -jr() { journalctl "$@"; } - -net-dev-info() { - e "lspci -nnk|gr -iA2 net" - lspci -nnk|gr -iA2 net - hr - e "s lshw -C network" - hr - s lshw -C network - -} istext() { grep -Il "" "$@" &>/dev/null } +jfilter() { + grep -Evi -e "^(\S+\s+){4}(sudo|sshd|cron)\[\S*:" \ + -e "^(\S+\s+){4}systemd\[\S*: (starting|started) (btrfsmaintstop|dynamicipupdate|spamd dns bug fix cronjob|rss2email)\.*$" +} jtail() { - journalctl -n 10000 -f "$@" | grep -Evi "^(\S+\s+){4}(sudo|sshd|cron)" + journalctl -n 10000 -f "$@" | jfilter } +jr() { journalctl "$@" | jfilter | less ; } +jrf() { journalctl -f "$@" | jfilter; } kff() { # keyboardio firmware flash pushd /a/bin/distro-setup/Arduino/Model01-Firmware @@ -1243,6 +1258,15 @@ mkdir() { command mkdir -p "$@"; } mo() { xset dpms force off; } # monitor off +net-dev-info() { + e "lspci -nnk|gr -iA2 net" + lspci -nnk|gr -iA2 net + hr + e "s lshw -C network" + hr + s lshw -C network + +} nopanic() { sudo tee -a /var/log/exim4/paniclog-archive