X-Git-Url: https://iankelling.org/git/?a=blobdiff_plain;f=brc;h=a3724fa444bb91e6acafe90db06b6f143b4342c6;hb=fde3746c622eb042ce1fd051cdfea2f9a247cd53;hp=6322eb97c22063be93d93b6feb0f0969ef24e668;hpb=ad09c51104f62d1da1782387025b44327a081872;p=distro-setup diff --git a/brc b/brc index 6322eb9..a3724fa 100644 --- a/brc +++ b/brc @@ -466,6 +466,10 @@ c() { } ccomp cd c +bwm() { + s bwm-ng -T avg -d +} + b() { local topb if (( ${#_iankdirb[@]} == 0 )); then @@ -940,14 +944,18 @@ eless() { } ccomp less eless eqcat() { - exiqgrep -i -o 60 | while read -r i; do + exiqgrep -ir.\* -o 60 | while read -r i; do hlm exim -Mvc $i echo hlm exigrep $i /var/log/exim4/mainlog | cat ||: done } eqrmf() { - exiqgrep -i | xargs exim -Mrm + # other ways to get the list of message ids: + # exim -bp | awk 'NF == 4 {print $3}' + # # this is slower 160ms, vs 60. + # exipick -i + exiqgrep -ir.\* | xargs exim -Mrm } econfdevnew() { @@ -1228,6 +1236,7 @@ ipp() { ifn() { # insensitive find + # -L = follow symlinks find -L . -not \( -name .svn -prune -o -name .git -prune \ -o -name .hg -prune -o -name .editor-backups -prune \ -o -name .undo-tree-history -prune \) -iname "*$**" 2>/dev/null @@ -1399,7 +1408,15 @@ nags() { } nmt() { - s nmtui-connect "$@" + # cant use s because sudo -i doesnt work for passwordless sudo command + case $EUID in + 0) + sudo nmtui-connect "$@" + ;; + *) + nmtui-connect "$@" + ;; + esac } nopanic() { @@ -1567,7 +1584,7 @@ resolvcat() { grep '^ *hosts:' /etc/nsswitch.conf if systemctl is-enabled systemd-resolved &>/dev/null || [[ $(systemctl is-active systemd-resolved ||:) != inactive ]]; then hr; m ser status systemd-resolved | cat || : - hr; m systemd-resolve --status | cat + hr; m resolvectl status | cat fi } @@ -1724,7 +1741,7 @@ sk() { local quotes others quotes=2048,2068,2086,2206 - others=2029,2033,2164 + others=2029,2033,2054,2164 shellcheck -W 999 -x -e $quotes,$others "$@" || return $? } @@ -2167,6 +2184,23 @@ s/^\Wcapability: (.*)/\1/;Ta;h;b "|sort -r } +# Run script by copying it to a temporary location first, +# and changing directory, so we don't have any open +# directories or files that could cause problems when +# remounting. +z() { + local tmp + tmp=$(type -p "$1") + if [[ $tmp ]]; then + cd $(mktemp -d) + cp -a "$tmp" . + shift + ./"${tmp##*/}" "$@" + else + "$@" + fi +} + # * misc stuff