X-Git-Url: https://iankelling.org/git/?a=blobdiff_plain;ds=inline;f=distro-end;h=16fc7a5b0afbcfe6e46291c24ce4edbf3a1e744d;hb=89a1a98bb918fdf856d34900610413c79e32897e;hp=6b49f9b3fb3c0f9a4965b2d0ad0c994cb44e214c;hpb=63e3670ab59869f5f74904edbe64daa943fad15f;p=distro-setup
diff --git a/distro-end b/distro-end
index 6b49f9b..16fc7a5 100755
--- a/distro-end
+++ b/distro-end
@@ -6,7 +6,7 @@
export LC_USEBASHRC=t; if [[ -s ~/.bashrc ]]; then . ~/.bashrc; fi
### setup
-source /a/bin/errhandle/err
+source /a/bin/bash-bear-trap/bash-bear
src="$(readlink -f -- "${BASH_SOURCE[0]}")"; src=${src%/*} # directory of this file
if [[ $EUID == 0 ]]; then
@@ -90,7 +90,6 @@ EOF
########### begin section including vps ################
pi ${p2[@]}
-
conflink
sudo rm -fv
@@ -124,39 +123,6 @@ esac
-
-# dogcam setup. not using atm
-# case $HOSTNAME in
-# lj|li)
-# /a/bin/webcam/install-server
-# ;;
-# kw)
-# /a/bin/webcam/install-client
-# ;;
-# esac
-
-
-## not actually using prometheus just yet
-# # office is not exposed to internet yet
-# if [[ $HOSTNAME != kw ]]; then
-# ## prometheus node exporter setup
-# web-conf -f 9100 -p 9101 apache2 $(hostname -f) <<'EOF'
-# #https://httpd.apache.org/docs/2.4/mod/mod_authn_core.html#authtype
-# # https://stackoverflow.com/questions/5011102/apache-reverse-proxy-with-basic-authentication
-#
-# AllowOverride None
-# AuthType basic
-# AuthName "Authentication Required"
-# # setup one time, with root:www-data, 640
-# AuthUserFile "/etc/prometheus-htpasswd"
-# Require valid-user
-#
-# EOF
-# fi
-
-
-
-
pi debootstrap
######### begin universal pinned packages ######
case $(debian-codename) in
@@ -167,205 +133,38 @@ Explanation: Debian* includes Debian + Debian Backports
Package: *
Pin: release o=Debian*
Pin-Priority: -100
-EOF
- ;;&
- # needed for debootstrap scripts for fai since fai requires debian
- flidas)
- # moved to fai
- #curl http://archive.ubuntu.com/ubuntu/project/ubuntu-archive-keyring.gpg | s apt-key add -
- sd /etc/apt/preferences.d/flidas-xenial </dev/null </dev/null; then
- # moved to fai
- #sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 3B4FE6ACC0B21F32
- sd /etc/apt/preferences.d/flidas-bionic <$t <$t <$t <<'EOF'
EOF
cat >$t <= 1 )); then
+ rm -f ${files[@]}
+ fi
+ ngreset
+ for host in ${!vpn_ips[@]}; do
+ sd /etc/openvpn/client-config-hole/$host </dev/null && \
! systemctl is-active transmission-daemon; then
tmp=$(mktemp)
@@ -1595,6 +1417,9 @@ esac
######### begin transmission client setup ######
+# to connect from a remote client, trans-remote-route in brc2
+
+
if [[ -e /p/transmission-rpc-pass ]]; then
# arch had a default config,
# debian had nothing until you start it.
@@ -1636,7 +1461,7 @@ EOF
"profiles" : [
{
"profile-name" : "Default",
- "hostname" : "10.173.0.2",
+ "hostname" : "10.174.2.2",
"rpc-url-path" : "/transmission/rpc",
"username" : "",
"password" : "$rpc_pass",
@@ -1687,6 +1512,7 @@ sudo gpasswd -a $USER lpadmin # based on ubuntu wiki
# general known for debian/ubuntu, not for fedora
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/misc
m /a/bin/buildscripts/pithosfly
@@ -1785,6 +1611,11 @@ DEVICESCAN -a -o on -S on -n standby,q $sched \
########### misc stuff
+
+xdg-settings set default-web-browser abrowser.desktop
+# see current with:
+# xdg-settings get default-web-browser
+
# pressing tab after sdf here:
# scp sdfbash: set +o noglob: command not found
# in t11, bash 5.1.16. this fixes it.
@@ -1948,25 +1779,20 @@ sgo dynamicipupdate
if grep -xFq $HOSTNAME /a/bin/ds/machine_specific/btrbk.hosts; then
sgo btrbk.timer
fi
-# note: to see when it was last run,
+
+# note: to see when a timer was last run,
# ser list-timers
-case $HOSTNAME in
- kd)
- sgo btrbkrust.timer
- ;;
-esac
### begin prometheus ###
-
-
-pi prometheus-node-exporter-collectors
case $HOSTNAME in
kd)
# Font awesome is needed for the alertmanager ui.
pi prometheus-alertmanager prometheus fonts-font-awesome
- /a/bin/buildscripts/prometheus
+ /c/roles/prom/files/simple/usr/local/bin/fsf-install-prometheus
+ # make it available for other machines
+ rsync -a /usr/local/bin/amtool /a/opt/bin
web-conf -p 9091 -f 9090 - apache2 i.b8.nz <<'EOF'
AuthType Basic
@@ -2002,7 +1828,7 @@ EOF
ser restart prometheus-alertmanager
fi
- /a/bin/buildscripts/prom-node-exporter -l
+ s /c/roles/prom_export/files/simple/usr/local/bin/fsf-install-node-exporter -l 127.0.0.1
for ser in prometheus-node-exporter prometheus-alertmanager prometheus; do
sysd-prom-fail-install $ser
@@ -2010,7 +1836,7 @@ EOF
;;
*)
- /a/bin/buildscripts/prom-node-exporter
+ s /c/roles/prom_export/files/simple/usr/local/bin/fsf-install-node-exporter
;;
esac
@@ -2065,9 +1891,12 @@ esac
### begin nagios ###
+pi nagios-nrpe-server
+
case $HOSTNAME in
kd)
- pi nagios4
+ # the backport is for this bug: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=800345
+ pi nagios4 nagios-nrpe-plugin monitoring-plugins-basic/bullseye-backports
s rm -fv /etc/apache2/conf-enabled/nagios4-cgi.conf
# to add a password for admin:
@@ -2113,7 +1942,7 @@ Alias /nagios4 /usr/share/nagios4/htdocs
#
AuthDigestDomain "Nagios4"
AuthDigestProvider file
- AuthUserFile "/etc/nagios4/htdigest.users"
+ AuthUserFile "/etc/nagios4-htdigest.users"
AuthGroupFile "/etc/group"
AuthName "Nagios4"
AuthType Digest
@@ -2156,17 +1985,23 @@ esac
# 6 define timeperiod
+
+
### end nagios ###
### begin bitcoin ###
case $HOSTNAME in
- sy)
- f=$dir/bitcoin.conf
- sudo install -m 0755 -o root -g root -t /usr/bin /a/opt/bitcoin-23.0/bin/*
- sgo bitcoind
+ sy|kd)
+ sudo install -m 0755 -o root -g root -t /usr/bin /a/opt/bitcoin-26.0/bin/*
+ # Note: i leave it to system-status to start and stop bitcoin.
+ # note: the bitcoin user & group are setup in fai
sudo usermod -a -G bitcoin iank
- sudo ln -s /q/wallets /var/lib/bitcoind
+ # todo: make bitcoin have a stable uid/gid
+ sudo mkdir -p /var/lib/bitcoind
+ sudo chown bitcoin:bitcoin /var/lib/bitcoind
+ # 710 comes from the upstream bitcoin unit file
+ sudo chmod 710 /var/lib/bitcoind
# note, there exists
# /a/bin/ds/disabled/bitcoin
;;
@@ -2174,6 +2009,50 @@ esac
### end bitcoin
+### begin live streaming ###
+
+# comparing nginx rtmp to icecast
+# `mpv --cache=no` had about 2.5 sec latency vs 4 seconds.
+# Then I discovered this command which had about .5 sec latency:
+#ffplay -f live_flv -fast -x 1280 -y 720 -fflags nobuffer -flags low_delay -strict experimental -vf "setpts=N/60/TB" -af "asetpts=N/60/TB" -noframedrop -i rtmp://url_here
+#
+pi nginx libnginx-mod-rtmp
+
+
+### end live streaming ###
+
+### begin gh ####
+
+# from https://raw.githubusercontent.com/cli/cli/trunk/docs/install_linux.md
+# One time setup afterwards:
+# gh auth login
+#
+# When it gets to the page where it asks to authorize github, the button
+# is grayed out. You can just open browser dev tools, inspect the
+# button, remove disabled="", then click it and it works.
+#
+# Auth token gets saved into /p/c/subdir_files/.local/share/keyrings/
+#
+# initial config goes to /home/iank/.config/gh
+curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg \
+ && sudo chmod go+r /usr/share/keyrings/githubcli-archive-keyring.gpg \
+ && echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null \
+ && sudo apt update \
+ && sudo apt install gh -y
+
+### end gh ####
+
+# remove trisquel banner. it is cool but takes up too much space.
+sudo rm -f /etc/update-motd.d/01-banner
+
+case $HOSTNAME in
+ kw|x3)
+ sd /etc/cups/client.conf <<'EOF'
+ServerName printserver1.office.fsf.org
+EOF
+ ;;
+esac
+
end_msg <<'EOF'
In mate settings settings, change scrolling to two-finger,