summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: d1699bf)
raw | patch | inline | side by side (parent: d1699bf)
author | Ian Kelling <ian@iankelling.org> | |
Tue, 16 May 2023 01:27:47 +0000 (21:27 -0400) | ||
committer | Ian Kelling <ian@iankelling.org> | |
Tue, 16 May 2023 01:28:23 +0000 (21:28 -0400) |
brc | patch | blob | history | |
brc2 | patch | blob | history | |
filesystem/etc/profile.d/environment.sh | patch | blob | history | |
mail-setup | patch | blob | history |
index d17c1a132e70ee4b7bc0f3f01bc39210ccf7f6bb..85583fe0901ebf47334755be6ef47b9476589efb 100644 (file)
--- a/brc
+++ b/brc
update-exim4.conf -d /tmp/edev/etc/exim4 -o /tmp/edev/e.conf
}
+# exim grep in
+# show important information about incoming mail in the exim log
+egrin() {
+ sed -rn '/testignore|jtuttle|eximbackup/!s/^[^ ]+ ([^ ]+) [^ ]+ [^ ]+ <= ([^ ]+).*T="(.*)" from (<[^ ]+> .*$)/\1 \4\n \3/p' <${1:-/var/log/exim4/mainlog}
+}
+
+# 2nd line is message-id:
+egrinid() {
+ sed -rn '/testignore|jtuttle|eximbackup/!s/^[^ ]+ ([^ ]+) [^ ]+ [^ ]+ <= ([^ ]+).* id=([^ ]+) T="(.*)" from (<[^ ]+> .*$)/\1 \5\n \3\n \4/p' <${1:-/var/log/exim4/mainlog}
+}
+
index 7f6011f43dd05b4cf61d19d7658449a3a5c4053d..1add8230a8766562b053460b415ce2915afd5018 100644 (file)
--- a/brc2
+++ b/brc2
*)
url=$(readlink -f "$input")
url="https://brains.fsf.org/wiki/${url#*brains/}"
- url="${url%.mdwn}"
+ url="${url%.mdwn}/"
j echo "$url"
;;
esac
# pull in beets library locally
beetpull() {
+ local sshfs_host
+ sshfs_host=b8.nz
if [[ $HOSTNAME == kd ]]; then
return 0
fi
s chown iank:iank /i
fi
if ! mountpoint /i &>/dev/null; then
- m sshfs b8.nz:/i /i
+ m sshfs $sshfs_host:/i /i
fi
}
c /
# run latest
keyhash=$(s ssh-keygen -lf /root/.ssh/home | awk '{print $2}')
- tmp=$(s ssh-add -l | awk '$2 == "'$keyhash'"')
+ tmp=$(s ssh-add -l | awk '$2 == "'$keyhash'"' ||:)
if [[ ! $tmp ]]; then
s ssh-add /root/.ssh/home
fi
index 42513fa5753968109e65e8406da2ce9d1ee24509..6191cb7eaf3c1958c9d832668f6cbc60a583f530 100644 (file)
# if systemctl --user show-environment >$_sysenv 2>/dev/null; then
# grep -o '^[^=]*' $_sysenv | sort > $_sysenvnames
# env -0 | grep -zo '^[^=]*' | xargs -0 printf "%s\n" | sort | \
-# comm --nocheck-order -13 - $_sysenvnames >$_unsetnames
+ # comm --nocheck-order -13 - $_sysenvnames >$_unsetnames
# while read -r unsetname; do
# while read -r sysenv; do
# case "$sysenv" in
# fi
# fi
-# and it seems that if we log into mate, it screws up the systemd env var anyways.
-for _file in $(pgrep -a '^ssh-agent$' | sed -r 's/.*-a *([^ ]+).*/\1/'); do
- if test -O "$_file"; then
- export SSH_AUTH_SOCK="$_file"
- break
- fi
-done
-
-# in t11, user ssh-agent once again stopped working, it isn't started anymore
-# by i3. So, enough is enough, I just made a service that will try to
-# start it all the time for the user. If the var isn't set by the above,
-# just set them to the values I know are in the service.
-if ! test "$SSH_AUTH_SOCK"; then
- if [ "$EUID" = 0 ]; then
- export SSH_AUTH_SOCK=/run/openssh_agent
- elif [ "$EUID" = 1000 ]; then
- export SSH_AUTH_SOCK=$HOME/openssh_agent
+
+# i use the x11 prompt for ssh key use which doesnt work
+# within an ssh session (perhaps there is some way).
+# Anyways, there is usually no need for an agent to
+# do a 1-off ssh from a remote machine.
+if ! test "$SSH_CLIENT"; then
+ # and it seems that if we log into mate, it screws up the systemd env var anyways.
+ for _file in $(pgrep -a '^ssh-agent$' | sed -r 's/.*-a *([^ ]+).*/\1/'); do
+ if test -O "$_file"; then
+ export SSH_AUTH_SOCK="$_file"
+ break
+ fi
+ done
+
+ # in t11, user ssh-agent once again stopped working, it isn't started anymore
+ # by i3. So, enough is enough, I just made a service that will try to
+ # start it all the time for the user. If the var isn't set by the above,
+ # just set them to the values I know are in the service.
+ if ! test "$SSH_AUTH_SOCK"; then
+ if [ "$EUID" = 0 ]; then
+ export SSH_AUTH_SOCK=/run/openssh_agent
+ elif [ "$EUID" = 1000 ]; then
+ export SSH_AUTH_SOCK=$HOME/openssh_agent
+ fi
fi
fi
-
# background:
# ubuntu has 002 for non-system users, debian has 022. 002 makes groups
# be rw instead of r.
diff --git a/mail-setup b/mail-setup
index cfe5575d2090ebfcc120f39575c0aa40e5d8060c..e7020d74361301bf5c7b3d82f109b367014fa6cf 100755 (executable)
--- a/mail-setup
+++ b/mail-setup
# SPDX-License-Identifier: AGPL-3.0-or-later
# Things I tend to forget. on MAIL_HOST, daemon runs with /etc/exim4/my.conf,
-# which gets generated from update-exim4.conf -d /etc/myexim4
+# due to /etc/default/exim4 containing:
+# COMMONOPTIONS='-C /etc/exim4/my.conf'
+# UPEX4OPTS='-o /etc/exim4/my.conf'
+#
+# The non-daemon config
+# gets generated from this script calling update-exim4.conf -d /etc/myexim4
# which has log path
# log_file_path = /var/log/exim4/my%s
#
-# so, normal mainlog is non-daemon, which delivers to the daemon.
-
+# eximbackup folder is /bu/md
+# it is cleaned up by mail-backup-clean, which is run by btrbk-run
# shellcheck disable=SC2254 # makes for a lot of unneeded quotes
unseen
EOF
-
u /etc/myexim4/conf.d/router/160_backup_redir <<'EOF'
backup_redir:
driver = redirect
errors_to = alerts@iankelling.org
EOF
-
-
# for bk, we have a exim4in.service that will do this for us.
m update-exim4.conf -d /etc/myexim4
;;