fixes, improvements
authorIan Kelling <ian@iankelling.org>
Wed, 29 Sep 2021 21:45:29 +0000 (17:45 -0400)
committerIan Kelling <ian@iankelling.org>
Wed, 29 Sep 2021 21:45:29 +0000 (17:45 -0400)
12 files changed:
brc
brc2
check-stale-alerts
distro-end
i3-sway/common.conf
i3-sway/i3.conf
mail-setup
mailtest-check
pkgs
subdir_files/.config/i3/config
subdir_files/.config/mpv/mpv.conf
subdir_files/.config/sway/config

diff --git a/brc b/brc
index 1531e632ce2342c1937021e1414c1055f3eb8242..128b6f3955e581449280d8b3e4b729e42ca357da 100644 (file)
--- a/brc
+++ b/brc
@@ -1117,17 +1117,14 @@ pk1() {
 }
 
 psg () {
-  local x y help s
+  local x y help
   help="Usage: psg [--help] GREP_ARGS
 grep ps and output in a nice format"
   if [[ $1 == --help ]]; then
     echo "$help"
     return
   fi
-  if [[ $EUID != 0 ]]; then
-    s=sudo
-  fi
-  x=$($s ps -eF)
+  x=$(s ps -eF)
   # final grep is because some commands tend to have a lot of trailing spaces
   y=$(echo "$x" | grep -iP "$@" | grep -o '.*[^ ]') ||:
   if [[ $y ]]; then
@@ -1302,11 +1299,10 @@ sd() {
 }
 
 ser() {
-  local s; [[ $EUID != 0 ]] && s=sudo
   if type -p systemctl &>/dev/null; then
-    $s systemctl $1 $2
+    s systemctl $1 $2
   else
-    $s service $2 $1
+    s service $2 $1
   fi
 }
 seru() { systemctl --user "$@"; }
diff --git a/brc2 b/brc2
index a17779e4677ad11d4cf6250fb0ec8d2d4db90b86..070fb402f538096f689a7e736574a7a5a82127b1 100644 (file)
--- a/brc2
+++ b/brc2
@@ -1665,7 +1665,8 @@ path-add --end ~/.npm-global
 path-add --end $HOME/.cargo/bin
 
 if type -P rg &>/dev/null; then
-  rg() { command rg -L -i -M 300 --no-ignore "$@"; }
+  # --no-messages because of annoying errors on broken symlinks
+  rg() { command rg --no-messages -L -i -M 300 --no-ignore "$@" || return $?; }
 #fails if not exist. ignore
   complete -r rg 2>/dev/null ||:
 else
index 4dbdcc5b954c666173c88e33f0aee8f680b8e8b1..1d8f70fd9383a00be83d75839c1980c99d9d27e5 100755 (executable)
@@ -7,12 +7,12 @@ eval $(< /dev/shm/iank-status)
 if [[ $HOSTNAME != "$MAIL_HOST" ]]; then
   exit 0
 fi
-out=$(find /var/local/cron-errors /home/iank/cron-errors /sysd-mail-once-state -type f -mtime +4)
+out=$(find /var/local/cron-errors /home/iank/cron-errors /sysd-mail-once-state -type f -ctime +4)
 if [[ $out ]]; then
   echo HOSTNAME: $HOSTNAME
   printf "%s\n" "$out"
 fi
-out=$(ssh bk.b8.nz find /m/md/bounces/new /var/local/cron-errors /home/iank/cron-errors /sysd-mail-once-state -type f -mtime +1)
+out=$(ssh bk.b8.nz find /m/md/bounces/new /var/local/cron-errors /home/iank/cron-errors /sysd-mail-once-state -type f -ctime +1v )
 if [[ $out ]]; then
   echo bk.b8.nz:
   printf "%s\n" "$out"
index aff5b49ae6a4b1c3433955dac51a3409bd625f3e..db84160b16b345ff40717008c079c41064e087f1 100755 (executable)
@@ -749,6 +749,7 @@ EOF
     # to get into the web interface,
     # then use non-main browser or else it doebsn't allow it based on ocsp stapling from my main site.
     # https://iankelling.org:12533/
+    # login as ian, pass is in pass store, the part after :
 
     # znc config generated by doing
     # znc --makeconf
@@ -870,17 +871,13 @@ fi
 case $distro in
   trisquel)
     case $codename in
-      nabia)
-        # abrowser not available yet
-        pi firefox
-        ;;
       *)
         # firefox would work here too, apt would select abrowser.
         # and the update-alternatives thing i think is becuz firefox is
         # generally available before abrowser and this helps fix things
         # up when we have both.
         pi abrowser
-        sudo update-alternatives --set x-www-browser /usr/bin/abrowser
+        s update-alternatives --set x-www-browser /usr/bin/abrowser
         ;;
     esac
     ;;
index 4a42fcfbb2763b1838fc4dab0dbe4b49be6c5729..b39cb7478b9e16fb3e0f6a3a3f392e73a9166173 100644 (file)
@@ -65,10 +65,16 @@ bindsym $mod+b split horizontal
 bindsym $mod+c kill
 
 
-bindsym $mod+Shift+8 move container to workspace 7
-bindsym $mod+8 workspace 7
-bindsym $mod+Shift+9 move container to workspace 8
-bindsym $mod+9 workspace 8
+bindsym $mod+Shift+Home move container to workspace 7
+bindsym $mod+Home workspace 7
+bindsym $mod+Shift+q move container to workspace 8
+bindsym $mod+q workspace 8
+
+bindsym $mod+Shift+8 move container to workspace 9
+bindsym $mod+8 workspace 9
+bindsym $mod+Shift+9 move container to workspace 10
+bindsym $mod+9 workspace 10
+
 
 # random keybind, feel free to change
 bindsym $mod+Shift+m border toggle
index 222897d9fc9792d651a6e410020ef935caa11f34..45a7c92dc00afd86655fc309906b1d49fb432174 100644 (file)
@@ -1,5 +1,5 @@
 # exit i3 (logs you out of your X session)
-bindsym $mod+Shift+q exec "i3-nagbar -t warning -m 'You pressed the exit shortcut. Do you really want to exit i3? This will end your X session.' -b 'Yes, exit i3' 'i3-msg exit'"
+bindsym $mod+Shift+Tilde exec "i3-nagbar -t warning -m 'You pressed the exit shortcut. Do you really want to exit i3? This will end your X session.' -b 'Yes, exit i3' 'i3-msg exit'"
 
 bindsym $mod+Shift+p restart
 
index 5c7dac3b385d2357512c7e1156196b36a6a39c99..7aa74e79549c788be4c3cc454e5bf36e479a54e9 100755 (executable)
@@ -793,33 +793,6 @@ sed -r s/^\\S+:/$b:/ 600_exim4-config_userforward >175_$b
 
 # todo, consider 'separate' in etc/exim4.conf, could it help on busy systems?
 
-#### begin setup alternate config for main daemon
-case $HOSTNAME in
-  bk|$MAIL_HOST)
-    # to see the default comments in /etc/default/exim4:
-    # s update-exim4defaults --force --init
-    # which will overwrite any existing file
-    i /etc/default/exim4 <<'EOF'
-QUEUERUNNER='combined'
-QUEUEINTERVAL='30m'
-COMMONOPTIONS='-C /etc/exim4/my.conf'
-UPEX4OPTS='-o /etc/exim4/my.conf'
-#E4BCD_PANICLOG_NOISE='malware acl condition: clamd /var/run/clamav/clamd\.ctl : unable to connect to UNIX socket'
-EOF
-    i /etc/exim4/trusted_configs <<'EOF'
-/etc/exim4/my.conf
-EOF
-    ;;
-  *)
-    # default file
-    i /etc/default/exim4 <<'EOF'
-QUEUERUNNER='combined'
-QUEUEINTERVAL='30m'
-EOF
-    ;;
-esac
-#### end setup alternate config for main daemon
-
 # alerts is basically the postmaster address
 m sed -i --follow-symlinks -f - /etc/aliases <<EOF
 \$a root: alerts@iankelling.org
@@ -830,6 +803,17 @@ cat >/etc/exim4/conf.d/rewrite/34_iank_rewriting <<'EOF'
 ncsoft@zroe.org graceq2323@gmail.com hE
 EOF
 
+
+# Retry faster than usual for domains that I send with send-test-forward.
+cat >/etc/exim4/conf.d/retry/37_retry <<'EOF'
+iankelling.org * F,2d,15m;F,14d,2h
+amnimal.ninja * F,2d,15m;F,14d,2h
+expertpathologyreview.com * F,2d,15m;F,14d,2h
+je.b8.nz * F,2d,15m;F,14d,2h
+zroe.org * F,2d,15m;F,14d,2h
+EOF
+
+
 rm -vf /etc/exim4/conf.d/main/000_localmacros # old filename
 cat >/etc/exim4/conf.d/main/000_local <<EOF
 MAIN_TLS_ENABLE = true
@@ -1890,9 +1874,10 @@ fi
 EOFOUTER
 
     i /etc/cron.d/$ncbase <<EOF
+PATH=/sbin:/usr/sbin:/usr/bin:/bin:/usr/local/bin
 SHELL=/bin/bash
 # https://docs.nextcloud.com/server/20/admin_manual/configuration_server/background_jobs_configuration.html
-*/5  *  *  *  * php -f $ncdir/cron.php --define apc.enable_cli=1 |& log-once nccron
+*/5  *  *  *  * www-data php -f $ncdir/cron.php --define apc.enable_cli=1 |& log-once nccron
 EOF
 
   done
@@ -1960,6 +1945,32 @@ EOF
 esac
 
 
+# ** main daemon use non-default config file
+case $HOSTNAME in
+  bk|$MAIL_HOST)
+    # to see the default comments in /etc/default/exim4:
+    # s update-exim4defaults --force --init
+    # which will overwrite any existing file
+    i /etc/default/exim4 <<'EOF'
+QUEUERUNNER='combined'
+QUEUEINTERVAL='30m'
+COMMONOPTIONS='-C /etc/exim4/my.conf'
+UPEX4OPTS='-o /etc/exim4/my.conf'
+#E4BCD_PANICLOG_NOISE='malware acl condition: clamd /var/run/clamav/clamd\.ctl : unable to connect to UNIX socket'
+EOF
+    i /etc/exim4/trusted_configs <<'EOF'
+/etc/exim4/my.conf
+EOF
+    ;;
+  *)
+    # default file
+    i /etc/default/exim4 <<'EOF'
+QUEUERUNNER='combined'
+QUEUEINTERVAL='30m'
+EOF
+    ;;
+esac
+
 case $HOSTNAME in
   # ** $MAIL_HOST|bk|je)
   $MAIL_HOST|bk|je)
index 404fb65679a555837d77d65218e5ccc073916dd2..69e699797f7abac444b2d3586d30b484eef199b9 100755 (executable)
@@ -1,5 +1,13 @@
 #!/bin/bash
 
+# Usage: mail-test-check [slow] [anything]
+#
+# slow: do slow checks, like spamassassin
+#
+# anything: consider non-interactive, dont print unless something went
+# wrong
+
+
 source /b/errhandle/err
 
 [[ $EUID == 0 ]] || exec sudo -E "${BASH_SOURCE[0]}" "$@"
@@ -9,6 +17,7 @@ shopt -s nullglob
 e() { $int || return 0; printf "mailtest-check: %s\n" "$*"; }
 
 
+## Minutes before we give error.
 # We run this cronjob along with sending the test email every 5 minutes,
 # so give it 1 minute to arrive, then if the latest email is older than
 # 7 minutes, the last 2 haven't arrived in a reasonable amount of time.
@@ -138,7 +147,8 @@ for folder in ${folders[@]}; do
 
     now=$(date +%s)
     limit=$(( now - 60 * min_limit ))
-    e latest = $(( now - last_sec ))s $latest
+    age_sec=$(( now - last_sec ))
+    e latest = $((age_sec / 60)):$(( age_sec % 60 )) ago. $latest
 
     if (( last_sec <= limit )); then
       echo $HOSTNAME mailtest $folder $from $(date -d @$last_sec +'%a %m-%d %H:%M')
diff --git a/pkgs b/pkgs
index ec2e0e54996ef980ea835d810df4d46580f36657..20bc08273457588bbd19c9f0851c05109eefeb43 100644 (file)
--- a/pkgs
+++ b/pkgs
@@ -212,6 +212,8 @@ p3=(
   socat
   # add-apt-repository
   software-properties-common
+  speex
+  sox
   sqlite3-doc
   squashfs-tools
   strace
index ffbb22e71ac18ff0084f78712ecb819aebff1c57..0178368591d4c6502299798554be6ed7f5e84699 100644 (file)
@@ -65,10 +65,16 @@ bindsym $mod+b split horizontal
 bindsym $mod+c kill
 
 
-bindsym $mod+Shift+8 move container to workspace 7
-bindsym $mod+8 workspace 7
-bindsym $mod+Shift+9 move container to workspace 8
-bindsym $mod+9 workspace 8
+bindsym $mod+Shift+Home move container to workspace 7
+bindsym $mod+Home workspace 7
+bindsym $mod+Shift+q move container to workspace 8
+bindsym $mod+q workspace 8
+
+bindsym $mod+Shift+8 move container to workspace 9
+bindsym $mod+8 workspace 9
+bindsym $mod+Shift+9 move container to workspace 10
+bindsym $mod+9 workspace 10
+
 
 # random keybind, feel free to change
 bindsym $mod+Shift+m border toggle
@@ -100,7 +106,7 @@ bindsym $mod+End exec /a/opt/clipster/clipster -sp
 # file:///usr/share/doc/i3-wm/userguide.html#_border_style_for_new_windows
 new_window none
 # exit i3 (logs you out of your X session)
-bindsym $mod+Shift+q exec "i3-nagbar -t warning -m 'You pressed the exit shortcut. Do you really want to exit i3? This will end your X session.' -b 'Yes, exit i3' 'i3-msg exit'"
+bindsym $mod+Shift+Tilde exec "i3-nagbar -t warning -m 'You pressed the exit shortcut. Do you really want to exit i3? This will end your X session.' -b 'Yes, exit i3' 'i3-msg exit'"
 
 bindsym $mod+Shift+p restart
 
index 35e019e48c17b6130941e9ee9e4b64889b9bcd5e..4de0cbe538e2745c0d3201838eca2b3fa8d5e4b4 100644 (file)
@@ -4,6 +4,7 @@
 #loop-file=inf
 loop-file=no
 volume=50
+player-operation-mode=pseudo-gui
 
 # use --profile d
 [d]
index 973e3f8c8a8942729ed3feff0b1cc553616df66e..7e44092da6eaae6d683b3df4438e5c82b4f7d5bf 100644 (file)
@@ -65,10 +65,16 @@ bindsym $mod+b split horizontal
 bindsym $mod+c kill
 
 
-bindsym $mod+Shift+8 move container to workspace 7
-bindsym $mod+8 workspace 7
-bindsym $mod+Shift+9 move container to workspace 8
-bindsym $mod+9 workspace 8
+bindsym $mod+Shift+Home move container to workspace 7
+bindsym $mod+Home workspace 7
+bindsym $mod+Shift+q move container to workspace 8
+bindsym $mod+q workspace 8
+
+bindsym $mod+Shift+8 move container to workspace 9
+bindsym $mod+8 workspace 9
+bindsym $mod+Shift+9 move container to workspace 10
+bindsym $mod+9 workspace 10
+
 
 # random keybind, feel free to change
 bindsym $mod+Shift+m border toggle