}
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
}
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 "$@"; }
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
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"
# 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
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
;;
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
# 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
# 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
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
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
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)
#!/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]}" "$@"
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.
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')
socat
# add-apt-repository
software-properties-common
+ speex
+ sox
sqlite3-doc
squashfs-tools
strace
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
# 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
#loop-file=inf
loop-file=no
volume=50
+player-operation-mode=pseudo-gui
# use --profile d
[d]
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