gateway $ip6::1
post-up echo 0 > /proc/sys/net/ipv6/conf/default/accept_ra
post-up echo 0 > /proc/sys/net/ipv6/conf/all/accept_ra
- post-up echo 0 > /proc/sys/net/ipv6/conf/$IFACE/accept_ra
+ post-up echo 0 > /proc/sys/net/ipv6/conf/\$IFACE/accept_ra
post-up echo 0 > /proc/sys/net/ipv6/conf/default/autoconf
post-up echo 0 > /proc/sys/net/ipv6/conf/all/autoconf
- post-up echo 0 > /proc/sys/net/ipv6/conf/$IFACE/autoconf
+ post-up echo 0 > /proc/sys/net/ipv6/conf/\$IFACE/autoconf
EOF
cat >/etc/fstab <<'EOF'
}
ccomp tail etail etail2
+# ran into this online, trying it out
+detach() {
+ ( "$@" &>/dev/null & disown )
+}
showkeys() {
ssh "$@" cat .ssh/authorized_keys{,2}
local p a
# excluding emacs for now
#p=(/a/opt/{emacs-debian11{,-nox},mu,emacs} /a/bin /a/exe /a/h /a/c /p/c/machine_specific/vps{,.hosts})
- p=(/a/bin /a/exe /a/h /a/c /p/c/machine_specific/vps{,.hosts})
+ p=(/a/bin /a/exe /a/h /a/c /p/c/machine_specific/vps{,.hosts} /c/roles/prom_export/files/simple/usr/local/bin/fsf-install-node-exporter)
a="-ahviSAXPH --specials --devices --delete --relative --exclude-from=/p/c/li-rsync-excludes"
ret=0
for h in li je bk; do
return $ret
}
bkpush() { # no emacs. for running faster.
- p=(/a/bin /a/exe /a/h /a/c /p/c/machine_specific/vps{,.hosts})
+ p=(/a/bin /a/exe /a/h /a/c /p/c/machine_specific/vps{,.hosts} /c/roles/prom_export/files/simple/usr/local/bin/fsf-install-node-exporter)
a="-ahviSAXPH --specials --devices --delete --relative --exclude-from=/p/c/li-rsync-excludes"
ret=0
m rsync "$@" $a ${p[@]} /p/c/machine_specific/bk root@bk.b8.nz:/ || ret=$?
return $ret
}
jepush() { # no emacs. for running faster.
- p=(/a/bin /a/exe /a/h /a/c /p/c/machine_specific/vps{,.hosts})
+ p=(/a/bin /a/exe /a/h /a/c /p/c/machine_specific/vps{,.hosts} /c/roles/prom_export/files/simple/usr/local/bin/fsf-install-node-exporter)
a="-ahviSAXPH --specials --devices --delete --relative --exclude-from=/p/c/li-rsync-excludes"
ret=0
m rsync "$@" $a ${p[@]} /p/c/machine_specific/je root@je.b8.nz:/ || ret=$?
e expected 2-3 arg of hostname, ip suffix, and extrahost >&2
return 1
fi
- local host ipsuf umask_orig
+ local host ipsuf umask_orig vpn_allowed
host=$1
ipsuf=$2
if [[ $3 ]]; then
paths="/p/c /b"
find $paths -not \( -name .svn -prune -o -name .git -prune \
-o -name .hg -prune -o -name .editor-backups -prune \
- -o -name .undo-tree-history -prune \) 2>/dev/null | grep -iP --color=auto "$*"
+ -o -name .undo-tree-history -prune \) 2>/dev/null | grep -iP --color=auto "$*" ||:
rgv -m 5 "$*" $paths ||:
}
# temp disabled: x2wg kwwg
# this list duplicated in brc2 ralerts
-for h in bk je li frodo x3wg kdwg sywg; do
+for h in bk je li x3wg kdwg sywg; do
statedir=/b/bash_unpublished/mailq-state
statefile=$statedir/$h
[[ -d $statedir ]] || continue
fi
eval $(< /dev/shm/iank-status)
-out=$(find /var/local/cron-errors /home/iank/cron-errors /sysd-mail-once-state -type f)
+dirs=()
+for d in /var/local/cron-errors /home/iank/cron-errors /sysd-mail-once-state; do
+ if [[ -e $d ]]; then
+ dirs+=($d)
+ fi
+done
+if (( ${#dirs[@]} >= 1 )); then
+ out=$(find ${dirs[@]} -type f)
+fi
if [[ $out ]]; then
echo HOSTNAME: $HOSTNAME
printf "%s\n" "$out"
# we dont want t, instead c for checksum.
# That way we dont set times on directories.
# -a = -rlptgoD
- cmd=( s rsync -rclpgoDiSAX --chmod=Dg-s --chown=root:root
+ # -A is acls, implies -p
+ cmd=( s rsync -rclgoDiSAX --chmod=Dg-s --chown=root:root
--exclude=/etc/dovecot/users
--exclude='/etc/exim4/passwd*'
--exclude='/etc/exim4/*.pem'
dnsb8
fi
- s /c/roles/prom-export/files/simple/usr/local/bin/fsf-install-node-exporter -l
+ s /c/roles/prom_export/files/simple/usr/local/bin/fsf-install-node-exporter -l 127.0.0.1:9100
# ex for exporter
web-conf -p 9101 -f 9100 - apache2 ${HOSTNAME}ex.b8.nz <<'EOF'
m /a/bin/buildscripts/go
# only needed for rg. cargo takes up 11 gigs, filled up the disk on je.
-#m /a/bin/buildscripts/rust
+m /a/bin/buildscripts/rust
m /a/bin/buildscripts/misc
m /a/bin/buildscripts/pithosfly
#m /a/bin/buildscripts/alacritty
ser restart prometheus-alertmanager
fi
- s /c/roles/prom_export/files/simple/usr/local/bin/fsf-install-node-exporter -l
+ s /c/roles/prom_export/files/simple/usr/local/bin/fsf-install-node-exporter -l 127.0.0.1:9100
for ser in prometheus-node-exporter prometheus-alertmanager prometheus; do
sysd-prom-fail-install $ser
;;
*)
- s /c/roles/prom-export/files/simple/usr/local/bin/fsf-install-node-exporter
+ s /c/roles/prom_export/files/simple/usr/local/bin/fsf-install-node-exporter
;;
esac
case $HOSTNAME in
kd)
- /a/bin/buildscripts/prometheus
+ /c/roles/prom/files/simple/usr/local/bin/fsf-install-prometheus
+ /c/roles/prom_export/files/simple/usr/local/bin/fsf-install-node-exporter -l 127.0.0.1
+ ;;
+ li|bk|je)
+ /c/roles/prom_export/files/simple/usr/local/bin/fsf-install-node-exporter -l 127.0.0.1
+ ;;
+ *)
+ /c/roles/prom_export/files/simple/usr/local/bin/fsf-install-node-exporter
;;
esac
SHELL=/bin/bash
PATH=/usr/bin:/bin:/usr/local/bin:/a/exe:/a/bin/fai
MAILTO=root
-0 6 * * 1,2,3,4,5 root failmail wrt-setup -y
-45 7 * * 1,2,3,4,5 root failmail wrt-setup -z
-0 9 * * 1,2,3,4,5 root failmail wrt-setup -y
-# old rule, 9:10
-#10 21 * * 1,2,3,4,5 root failmail wrt-setup -z
-0 17 * * 1,2,3,4,5 root failmail wrt-setup -z
+
+## weekdays
+# 0 6 * * 1,2,3,4,5 root failmail wrt-setup -y
+# 45 7 * * 1,2,3,4,5 root failmail wrt-setup -z
+# 0 9 * * 1,2,3,4,5 root failmail wrt-setup -y
# weekends
#0 6 * * 6,7 root failmail wrt-setup -y
# Aug 02 21:59:27 sy systemd[1]: wg-quick@wgmail.service: Failed with result 'exit-code'.
# Aug 02 21:59:27 sy systemd[1]: Failed to start WireGuard via wg-quick(8) for wgmail.
# Aug 02 21:59:47 sy systemd[1]: wg-quick@wgmail.service: Scheduled restart job, restart counter is at 1.
-# Aug 02 21:59:47 sy systemd[1]: Stopped WireGuard via wg-quick(8) for wgmail.
+# Aug 02 21:95:47 sy systemd[1]: Stopped WireGuard via wg-quick(8) for wgmail.
# Aug 02 21:59:47 sy systemd[1]: Starting WireGuard via wg-quick(8) for wgmail...
# Aug 02 21:59:47 sy wg-quick[3424]: wg-quick: `wgmail' already exists
# Aug 02 21:59:47 sy systemd[1]: wg-quick@wgmail.service: Main process exited, code=exited, status=1/FAILURE
rm composer-setup.php
# based on error when running composer
- mkdir /var/www/.composer
+ mkdir -p /var/www/.composer
chown www-data:www-data /var/www/.composer
### end composer install
rcdirs=(/usr/local/lib/rcexpertpath /usr/local/lib/rcninja)
- ncdirs=(/var/www/ncninja)
ncdirs=(/var/www/ncexpertpath /var/www/ncninja)
# point debian cronjob to our local install, preventing daily cron error
rcdir=${rcdirs[i]}
rcbase=${rcdir##*/}
ncdir=${ncdirs[i]}
- myncdir=/root/${ncdir##*/}
- mkdir -p $myncdir
# copied from debians cronjob
u /etc/cron.d/$rcbase <<EOF
for ((i=0; i < ${#bkdomains[@]}; i++)); do
domain=${bkdomains[i]}
ncdir=${ncdirs[i]}
+ myncdir=/var/local/${ncdir##*/}
ncbase=${ncdir##*/}
+ mkdir -p $myncdir
m cd /var/www
if [[ ! -e $ncdir/index.php ]]; then
# if we wanted to only install a specific version, use something like
m touch $myncdir/done-install
fi
- # note, strange this happend where updater did not increment the version var,
- # mine was stuck on 20. I manually updated it.
m cd $ncdir/config
- if [[ ! -e $myncdir/config.php-orig ]]; then
- m cp -a config.php $myncdir/config.php-orig
- fi
- cat $myncdir/config.php-orig - >$myncdir/tmp.php <<EOF
+ # if we did this more than once, it would revert the
+ # version number to the original.
+ if [[ ! -e $myncdir/config.php-orig || ! -s config.php ]]; then
+ if [[ -s config.php ]]; then
+ m cp -a config.php $myncdir/config.php-orig
+ # keep the file so it keeps the same permissions.
+ truncate -s0 config.php
+ fi
+ cat $myncdir/config.php-orig - >$myncdir/tmp.php <<EOF
# https://docs.nextcloud.com/server/19/admin_manual/configuration_server/email_configuration.html
\$CONFIG["mail_smtpmode"] = "sendmail";
\$CONFIG["mail_smtphost"] = "127.0.0.1";
var_export(\$CONFIG);
fwrite(STDOUT, ";\n");
EOF
- e running php $myncdir/tmp.php
- # note: we leave it around place for debugging
- php $myncdir/tmp.php >config.php
+ e running php $myncdir/tmp.php
+ # note: we leave it around place for debugging
+ # shellcheck disable=SC2024 # intended
+ sudo -u www-data php $myncdir/tmp.php >config.php
+ fi
cd $ncdir
m sudo -u www-data php occ maintenance:update:htaccess
list=$(sudo -u www-data php $ncdir/occ --output=json_pretty app:list)
m php /var/www/$ncbase/updater/updater.phar -n
# throw a sleep in just because who knows what else is undocumented
sleep 5
-./occ upgrade
+m php occ upgrade
EOFOUTER
chmod +x /usr/local/bin/ncup