fixes and qd for better source subvol error repo
[distro-setup] / brc2
diff --git a/brc2 b/brc2
index 86512ded8458f407d748f7086795545f209a0d39..0432e3ad419ff0c07a1f20a5087a125e45bc5aee 100644 (file)
--- a/brc2
+++ b/brc2
@@ -2534,6 +2534,10 @@ mnsnonet() {
 lom() {
   # l = the loopback device
   local l base
+  # get sudo pass cached right away
+  if ! sudo -nv 2>/dev/null; then
+    sudo -v
+  fi
   if [[ $1 == /* ]]; then
     base=${1##*/}
     fs_file=$1
@@ -3635,7 +3639,7 @@ rem() {
   find $paths -not \( -name .svn -prune -o -name .git -prune \
        -o -name .hg -prune -o -name .editor-backups -prune \
        -o -name .undo-tree-history -prune \) 2>/dev/null | grep -iP --color=auto "$*" ||:
-  rgv -m 5 "$*" $paths ||:
+  rgv -m 5 "$*" $paths /a/t.org /p/w.org /a/work.org ||:
 }
 
 # setup:
@@ -3801,10 +3805,40 @@ fi
 # rg with respecting vcs ignore files
 rgv() {
   ret=0
-  command rg -. -z --no-messages -L -i -M 900 -g '!auto-save-list' -g '!.savehist' "$@" || ret=$?
+  # -. = search dotfiles
+  # -z = search zipped files
+  # -i = case insensitive
+  # -M = max columns
+  # --no-messages because of annoying errors on broken symlinks
+  command rg -. -z --no-messages -i -M 900 -g '!.git' -g '!auto-save-list' -g '!.savehist' "$@" || ret=$?
   return $ret
 }
 
+amall() {
+  printf "$(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||:)"
+  amoffice "$@"
+}
+amallq() { # amall quiet
+  amfsf "$@"
+  amoffice "$@"
+}
+amfsf() {
+  sedi -r '/alertmanager.url/s/@office//' ~/.config/amtool/config.yml
+  amtool "$@"
+}
+amoffice() {
+  sedi -r '/alertmanager.url/s/@fsf/@office.fsf/' ~/.config/amtool/config.yml
+  amtool "$@"
+}
+amls() {
+  amall silence query "$@"
+}
+amrmall() {
+  amfsf silence expire $(amfsf silence query -q)
+  amoffice silence expire $(amoffice silence query -q)
+}
 
 # taken from default changes to bashrc and bash_profile
 path-add --end --ifexists $HOME/.rvm/bin