emacs --eval "(ediff-files \"$1\" \"$2\")"
}
+rspamta() {
+ ta "$@" /var/log/rspamd/rspamd.log
+ }
+
+
+_rspamtag() {
+ tailf /var/log/rspamd/rspamd.log | grp "$@"
+ }
+rspamtag() {
+ bn _rspamtag "$@"
+}
+
+
# etail + grep.
-etailg() {
- _bntmp() {
+_etailg() {
ngset
tailf /var/log/exim4/mainlog /var/log/exim4/*main /var/log/exim4/paniclog /var/log/exim4/*panic -n 200 | grp "$@"
ngreset
}
- bn _bntmp "$@"
+etailg() {
+ bn _etailg "$@"
}
# mail related
# shellcheck disable=SC2120 # we expect to pass arguments in use outside this file
ta() {
bn tailf "$@"
}
+_tag() {
+ local file
+ file="$1"
+ tailf "$file" | gr --line-buffered "$@"
+}
tag() {
- _bntmp() {
- local file
- file="$1"
- tailf "$file" | gr --line-buffered "$@"
- }
- bn _bntmp "$@"
+ bn _tag "$@"
}
ccomp tail etail etail2 ta
jr() { journalctl -e -n100000 "$@" ; }
jrf() { SYSTEMD_COLORS=true bn journalctl -n1000 -f "$@" ; }
jrfg() {
- _bntmp() { SYSTEMD_COLORS=true journalctl -n1000 -f | grp "$@"; }
- bn _bntmp "$@"
+ _jrfg() { SYSTEMD_COLORS=true journalctl -n1000 -f | grp "$@"; }
+ bn _jrfg "$@"
}
jru() {
SYSTEMD_COLORS=true bn journalctl -n1000 -f -u "$@" ;
}
jrug() {
- _bntmp() {
+ _jrug() {
local unit
unit="$1"
shift
SYSTEMD_COLORS=true journalctl -n1000 -f -u "$unit" | grp "$@"
}
- bn _bntmp "$@"
+ bn _jrug "$@"
}
ccomp journalctl jr jrf jru
export -p >$tmpf
printf "%s " "${@@Q}" >>$tmpf
echo >>$tmpf
-
- m sudo nsenter -t $pid -n --mount=/root/mount_namespaces/$ns sudo -u $USER -i bash -c ". $tmpf & sleep 1; rm $tmpf"
+ echo "rm -f $tmpf" >>$tmpf
+ m sudo nsenter -t $pid -n --mount=/root/mount_namespaces/$ns sudo -u $USER -i bash -c ". $tmpf"
}
spamd_ser=spamassassin
fi
sdncmdroot $spamd_ser sudo -u Debian-exim spamassassin -t --cf='score PYZOR_CHECK 0' <"$1"
-}
+ # rspamc. This has a bit of a problem where it always says hostname not recognized.
+ # I haven't figured out how to fix it, but I know that it expects to get that hostname
+ # from exim, and maybe the only way to do it properly is to actually pass the email
+ # through exim and tell exim the host.
+ #sdncmd rspamd rspamc "$1"
+
+ # if we made rspamc listen on other addresses, we could do
+ #rspamc -h 10.173.8.2:11334 "$1"
+}
+
# mail related
testmail() {
declare -gi _seq; _seq+=1
export -p >$tmpf
printf "%s " "${@@Q}" >>$tmpf
echo >>$tmpf
- m sudo nsenter -t $pid -n -m sudo -u $USER -i bash -c ". $tmpf & rm $tmpf"
+ echo "rm -f $tmpf" >>$tmpf
+ m sudo nsenter -t $pid -n -m sudo -u $USER -i bash -c ". $tmpf"
}
sdncmdroot() { # systemd namespace root command
export -p >$tmpf
printf "%s " "${@@Q}" >>$tmpf
echo >>$tmpf
- m sudo nsenter -t $pid -n sudo -u $USER -i bash -c ". $tmpf & rm $tmpf"
+ echo "rm -f $tmpf" >>$tmpf
+ m sudo nsenter -t $pid -n sudo -u $USER -i bash -c ". $tmpf"
}
mailnnbash() {
- sdnbash mailnn
+ sdnbashroot mailnn
}
# we use wireguard now, use mailnnbash.
rem() {
local paths
local -a opts
+ if [[ ! $1 ]]; then
+ echo rem: missing argument >&2
+ return 1
+ fi
for arg; do
if [[ $arg == -* ]]; then
opts+=("$1")
# see current with:
# xdg-settings get default-web-browser
-# not sure this is needed. will add other distros if necessary
+# not sure this is needed.
+#
+# These are some old files that made xdg-open open firefox from a chroot.
+rm -f ~/.local/share/applications/{firefox,chromium}*
case $distro in
trisquel)
xdg-settings set default-web-browser abrowser.desktop
;;
+ ubuntu)
+ xdg-settings set default-web-browser firefox.desktop
+ ;;
esac
# forgetting to use confighome, and then after specifying it,
# it uses the multiplex socket, which means that the different
# key in confighome is not actually used unless we do ssh -O exit HOST.
- sed 's,^IdentityFile ~/\.ssh/home$,IdentityFile ~/\.ssh/h\nControlPath ${HOME}/.chssh_%u_%h_%p_%r,' /root/.ssh/confighome >/root/.ssh/config
+ sed 's,^IdentityFile ~/\.ssh/home$,IdentityFile ~/\.ssh/h\nControlPath /root/.chssh_%u_%h_%p_%r,;s/ControlMaster autoask/ControlMaster auto/' /root/.ssh/confighome >/root/.ssh/config
fi
chown -R root:root /root/.ssh
+++ /dev/null
-#!/usr/bin/env xdg-open
-# ian: note, this is linked to from ~/.config/menus/mate-applications.menu
-[Desktop Entry]
-Version=1.0
-Type=Application
-Terminal=false
-Icon[en]=mate-panel-launcher
-Name[en]=chromium
-Exec=schroot -c stretch -- chromium --enable-remote-extensions
-Comment[en]=chromium
-Name=chromium
-Comment=chromium
-Icon=mate-panel-launcher
+++ /dev/null
-#!/usr/bin/env xdg-open
-# ian: note, this is linked to from ~/.config/menus/mate-applications.menu
-[Desktop Entry]
-Version=1.0
-Type=Application
-Terminal=false
-Icon[en]=mate-panel-launcher
-Name[en]=firefox
-Exec=schroot -c stretch firefox
-Comment[en]=firefox
-Name=firefox
-Comment=firefox
-Icon=mate-panel-launcher