s iptables -A INPUT -s $1 -j DROP
}
-jr() { journalctl "$@"; }
-
-net-dev-info() {
- e "lspci -nnk|gr -iA2 net"
- lspci -nnk|gr -iA2 net
- hr
- e "s lshw -C network"
- hr
- s lshw -C network
-
-}
istext() {
grep -Il "" "$@" &>/dev/null
}
+jfilter() {
+ grep -Evi -e "^(\S+\s+){4}(sudo|sshd|cron)\[\S*:" \
+ -e "^(\S+\s+){4}systemd\[\S*: (starting|started) (btrfsmaintstop|dynamicipupdate|spamd dns bug fix cronjob|rss2email)\.*$"
+}
jtail() {
- journalctl -n 10000 -f "$@" | grep -Evi "^(\S+\s+){4}(sudo|sshd|cron)"
+ journalctl -n 10000 -f "$@" | jfilter
}
+jr() { journalctl "$@" | jfilter | less ; }
kff() { # keyboardio firmware flash
pushd /a/bin/distro-setup/Arduino/Model01-Firmware
mo() { xset dpms force off; } # monitor off
+net-dev-info() {
+ e "lspci -nnk|gr -iA2 net"
+ lspci -nnk|gr -iA2 net
+ hr
+ e "s lshw -C network"
+ hr
+ s lshw -C network
+
+}
nopanic() {
sudo tee -a /var/log/exim4/paniclog-archive </var/log/exim4/paniclog; sudo truncate -s0 /var/log/exim4/paniclog
/a/bin/distro-setup/mymimes
+sgo dynamicipupdate
+
+
# stop autopoping windows when i plug in an android phone.
# dbus-launch makes this work within an ssh connection, otherwise you get this message,
# with still 0 exit code.
cat >>$f <<EOF
update delete b8.nz. A
update add b8.nz. 300 A $ip4
+update add wrt.b8.nz. 300 A $ip4
EOF
fi
cat <<'EOF'
Usage: mail-route up|down|show
-Marks tcp packets on port 25 and 143 to be routed through
+Marks tcp packets on port 25, 143 and 587 to be routed through
a vpn ip. If called from --up/--down in openvpn, (we have multiple args) $1 is the
tun_dev, and action is from $script_type.
modify() {
# match source or dest port. note, when we send to a port, it picks a random high port as
# the source.
- for port in 25 143; do # smtp and imap.
+ for port in 25 143 587; do # smtp and imap.
iptcommon="OUTPUT -m tcp -p tcp -m multiport --ports $port -j MARK --set-mark"
iptmod iptables -t mangle $iptables_op $iptcommon 0x1
iptmod iptables -t mangle $iptables_op $iptcommon 0x0 -d 10.0.0.0/8,172.16.0.0/12,192.168.0.0/16
postmaster=$u
mxhost=mail.iankelling.org
-mxport=25
+mxport=587
forward=$u@$mxhost
# old setup. left as comment for example
# would be unused in that config type.
rm -f /etc/exim4/conf.d/main/000_localmacros # old filename
cat >/etc/exim4/conf.d/main/000_local <<EOF
+# enable 587 in addition to the default 25, so that
+# i can send mail where port 25 is firewalled by isp
+daemon_smtp_ports = 25 : 587
# i don't have ipv6 setup for my vpn tunnel yet.
disable_ipv6 = true
exit 1
fi
-# TODO: turn this home dns update into a separate script that also runs
-# as a cronjob for the MAIL_HOST, so it can update dns for a laptop that
-# moves to a different network.
+# TODO: make home dns use ipv6. for work, make a cronjob that updates
+# the dns there.
#
# This exists because if mail_host is on the home network with a vpn
# tunnel, and another host on the home network tries to connect to the
done
}
-ports=(25 143)
+ports=(25 143 587)
case $1 in
start)
do-forward -A ${ports[@]}