From: Ian Kelling Date: Wed, 29 Sep 2021 21:45:29 +0000 (-0400) Subject: fixes, improvements X-Git-Url: https://iankelling.org/git/?a=commitdiff_plain;h=dd3bc1f4db262fb540599b38c07a8298a98a8911;p=distro-setup fixes, improvements --- diff --git a/brc b/brc index 1531e63..128b6f3 100644 --- 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 a17779e..070fb40 100644 --- 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 diff --git a/check-stale-alerts b/check-stale-alerts index 4dbdcc5..1d8f70f 100755 --- a/check-stale-alerts +++ b/check-stale-alerts @@ -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" diff --git a/distro-end b/distro-end index aff5b49..db84160 100755 --- a/distro-end +++ b/distro-end @@ -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 ;; diff --git a/i3-sway/common.conf b/i3-sway/common.conf index 4a42fcf..b39cb74 100644 --- a/i3-sway/common.conf +++ b/i3-sway/common.conf @@ -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 diff --git a/i3-sway/i3.conf b/i3-sway/i3.conf index 222897d..45a7c92 100644 --- a/i3-sway/i3.conf +++ b/i3-sway/i3.conf @@ -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 diff --git a/mail-setup b/mail-setup index 5c7dac3..7aa74e7 100755 --- a/mail-setup +++ b/mail-setup @@ -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 </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 <