From fa264ab2ec907b4ebc8d7dd0f8b239b0d0202362 Mon Sep 17 00:00:00 2001 From: Ian Kelling Date: Fri, 11 Nov 2022 17:37:25 -0500 Subject: [PATCH] various improvements --- brc | 5 +- brc2 | 35 +++++-- conflink | 10 +- distro-end | 92 +++++++++++++++++++ filesystem/etc/profile.d/environment.sh | 4 +- .../etc/systemd/system/ssh-agent-iank.service | 3 +- input-setup | 3 + pkgs | 1 + 8 files changed, 140 insertions(+), 13 deletions(-) diff --git a/brc b/brc index ff3b91f..3c54796 100644 --- a/brc +++ b/brc @@ -879,7 +879,7 @@ ediff() { # mail related etail() { ngset - tail -F /var/log/exim4/mainlog /var/log/exim4/*main -n 200 "$@" + tail -F /var/log/exim4/mainlog /var/log/exim4/*main /var/log/exim4/paniclog /var/log/exim4/*panic -n 200 "$@" ngreset } etailm() { @@ -888,10 +888,11 @@ etailm() { etail2() { tail -F /var/log/exim4/mymain -n 200 "$@" } - ccomp tail etail etail2 + + # print exim old pids eoldpids() { local configtime pid piduptime now daemonpid diff --git a/brc2 b/brc2 index 754f9a0..ea1faaf 100644 --- a/brc2 +++ b/brc2 @@ -115,9 +115,9 @@ rootrsync() { } zcheck() { - s ssh bow DISPLAY=:0 scrot /tmp/oegu.jpg - s scp bow:/tmp/oegu.jpg /t - s ssh bow rm /tmp/oegu.jpg + ssh bow DISPLAY=:0 scrot /tmp/oegu.jpg + scp bow:/tmp/oegu.jpg /t + ssh bow rm /tmp/oegu.jpg feh /t/oegu.jpg } @@ -1045,8 +1045,9 @@ hstatus() { # work log wlog() { - local day now i - for (( i=0; i<60; i++ )); do + local day now i days_back + days_back=${1:-16} + for (( i=0; i' $to < +To: $to +Subject: Mail delivery failed: returning message to sender + +This message was created automatically by mail delivery software. +EOF + +} + + # toggle keyboard tk() { # based on diff --git a/conflink b/conflink index 1cefd0b..f798204 100755 --- a/conflink +++ b/conflink @@ -237,11 +237,19 @@ case $user in f=/etc/prometheus-pass if [[ -e $f ]]; then # note: this is duplicative of the file's own permissions - s chmod 640 $f /etc/prometheus-pass + s chmod 640 $f if getent passwd prometheus &>/dev/null; then s chown root:prometheus $f fi fi + f=/etc/nagios4/htdigest.users + if [[ -e $f ]]; then + # note: this is duplicative of the file's own permissions + s chmod 640 $f /etc/prometheus-pass + if getent passwd nagios &>/dev/null; then + s chown nagios:www-data $f + fi + fi ##### end special extra stuff ##### if ! $fast; then diff --git a/distro-end b/distro-end index 98a28bd..e07ab78 100755 --- a/distro-end +++ b/distro-end @@ -2029,6 +2029,98 @@ esac ### end prometheus ### +### begin nagios ### + +pi nagios4 +s rm /etc/apache2/conf-enabled/nagios4-cgi.conf + +# to add a password for admin: +# htdigest /etc/nagios4/htdigest.users Nagios4 iank +# now using the same pass as prometheus + +# nagstamon auth settings, set to digest instead of basic. + +web-conf -p 3005 - apache2 i.b8.nz <<'EOF' +# adapted from /etc/apache2/conf-enabled/nagios4-cgi.conf + +ScriptAlias /cgi-bin/nagios4 /usr/lib/cgi-bin/nagios4 +ScriptAlias /nagios4/cgi-bin /usr/lib/cgi-bin/nagios4 + +# Where the stylesheets (config files) reside +Alias /nagios4/stylesheets /etc/nagios4/stylesheets + +# Where the HTML pages live +Alias /nagios4 /usr/share/nagios4/htdocs + + + Options FollowSymLinks + DirectoryIndex index.php index.html + AllowOverride AuthConfig + # + # The default Debian nagios4 install sets use_authentication=0 in + # /etc/nagios4/cgi.cfg, which turns off nagos's internal authentication. + # This is insecure. As a compromise this default apache2 configuration + # only allows private IP addresses access. + # + # The ... below shows how you can secure the nagios4 + # web site so anybody can view it, but only authenticated users can issue + # commands (such as silence notifications). To do that replace the + # "Require all granted" with "Require valid-user", and use htdigest + # program from the apache2-utils package to add users to + # /etc/nagios4/htdigest.users. + # + # A step up is to insist all users validate themselves by moving + # the stanza's in the .. into the . + # Then by setting use_authentication=1 in /etc/nagios4/cgi.cfg you + # can configure which people get to see a particular service from + # within the nagios configuration. + # + AuthDigestDomain "Nagios4" + AuthDigestProvider file + AuthUserFile "/etc/nagios4/htdigest.users" + AuthGroupFile "/etc/group" + AuthName "Nagios4" + AuthType Digest + Require valid-user + + + + Options +ExecCGI + +EOF + + +# when you alter a service through the web, it changes vars in /var/lib/nagios4/status.dat. for example: +# notifications_enabled=1 +# note, the same variable exists in the correspdonding "define service {" + +# in the default config, we have these definitions + + # 11 define command { + # 2 define contact { + # 1 define contactgroup { + # 9 define host { + # 4 define hostgroup { + # 23 define service { + # 5 define timeperiod { + + +# on klaxon + +# klaxon:/etc/nagios3 # grep -rho '^ *define [^{ ]*' | sort | uniq -c +# 76 define command +# 11 define contact +# 6 define contactgroup +# 162 define host +# 1 define hostextinfo +# 16 define hostgroup +# 3040 define service +# 2 define servicedependency +# 6 define timeperiod + + +### end nagios ### + end_msg <<'EOF' In mate settings settings, change scrolling to two-finger, diff --git a/filesystem/etc/profile.d/environment.sh b/filesystem/etc/profile.d/environment.sh index f441752..f059e4d 100644 --- a/filesystem/etc/profile.d/environment.sh +++ b/filesystem/etc/profile.d/environment.sh @@ -125,8 +125,8 @@ done if ! test "$SSH_AUTH_SOCK"; then if [ "$EUID" = 0 ]; then export SSH_AUTH_SOCK=/run/openssh_agent - else - export SSH_AUTH_SOCK=/run/user/1000/openssh_agent + elif [ "$EUID" = 1000 ]; then + export SSH_AUTH_SOCK=$HOME/openssh_agent fi fi diff --git a/filesystem/etc/systemd/system/ssh-agent-iank.service b/filesystem/etc/systemd/system/ssh-agent-iank.service index 8702043..fc6ced6 100644 --- a/filesystem/etc/systemd/system/ssh-agent-iank.service +++ b/filesystem/etc/systemd/system/ssh-agent-iank.service @@ -6,7 +6,8 @@ StartLimitIntervalSec=0 [Service] User=iank Environment=DISPLAY=:0 -ExecStart=/usr/bin/ssh-agent -D -a /run/user/1000/openssh_agent +ExecStartPre=/usr/bin/rm -f /home/iank/openssh_agent +ExecStart=/usr/bin/ssh-agent -D -a /home/iank/openssh_agent Restart=always RestartSec=30 diff --git a/input-setup b/input-setup index f3678b0..9f6734c 100755 --- a/input-setup +++ b/input-setup @@ -93,3 +93,6 @@ fi set +x exit 0 + +# ploopy setup until i recompile firmware +# xinput --set-prop $(xinput list | grep -F 'Ploopy Corporation Trackball Mouse' | sed -rn 's/.*[[:space:]]id=([^[:space:]]*).*/\1/p') 'libinput Accel Speed' -0.9 diff --git a/pkgs b/pkgs index f38a772..c6eea76 100644 --- a/pkgs +++ b/pkgs @@ -99,6 +99,7 @@ p3=( devscripts dillo dirmngr + dos2unix dnsutils python3-dnspython duplicity -- 2.30.2