From: Ian Kelling Date: Tue, 31 Mar 2026 21:04:05 +0000 (-0400) Subject: misc fixes, some new features X-Git-Url: https://iankelling.org/git/?a=commitdiff_plain;h=34789a7caf05a618c147af7edfb0e96a3eeb054e;p=distro-setup misc fixes, some new features --- diff --git a/.sqliterc b/.sqliterc new file mode 100644 index 0000000..6f7d58d --- /dev/null +++ b/.sqliterc @@ -0,0 +1 @@ +.timeout 6000 diff --git a/brc2 b/brc2 index 07a4c7f..d262054 100644 --- a/brc2 +++ b/brc2 @@ -5059,3 +5059,16 @@ mnt-df() { local mnts=$(for f in *; do if mountpoint -q $f; then e $f; fi; done) df -h $mnts | awk '{printf "%8s %12s\n", $4,$NF}' | sort -hr } + +lazywrites() { + local t=$(mktemp) + cat >$t <<'EOF' +fs.xfs.xfssyncd_centisecs=13000 +vm.dirty_background_ratio=25 +vm.dirty_ratio=50 +vm.dirty_expire_centisecs=13000 +vm.dirty_writeback_centisecs=1500 +EOF + s sysctl -p$t + + } diff --git a/distro-end b/distro-end index eb3826b..9ccc856 100755 --- a/distro-end +++ b/distro-end @@ -1588,7 +1588,7 @@ soff libvirt-guests for x in iank user2; do s usermod -aG libvirt,kvm,libvirt-qemu $x; done -pi --no-install-recommends kdeconnect +pi --no-install-recommends kdeconnect epiphany-browser ### begin model 01 arduino support ### diff --git a/filesystem/etc/btrbk/ianktemplate.conf b/filesystem/etc/btrbk/ianktemplate.conf new file mode 100644 index 0000000..3ad4b04 --- /dev/null +++ b/filesystem/etc/btrbk/ianktemplate.conf @@ -0,0 +1,28 @@ +# Note: for unrestricted root ssh, -F /root/.ssh/confighome +ssh_identity /q/root/h +lockfile /var/lock/btrbk-adhoc1.lock +timestamp_format long-iso +snapshot_create no +snapshot_preserve 36h 14d 8w 24m +snapshot_preserve_min all +snapshot_dir btrbk +target_preserve 36h 14d 8w 24m +target_preserve_min all +incremental_prefs sao:1 +rate_limit no +send_protocol 2 +send_compressed_data yes +# for 10g lan link speed boost: +# ssh_cipher_spec none +stream_buffer 500m + +volume /mnt/r4 +subvolume m6 +target send-receive /mnt/r3/btrbk +target send-receive ssh://kd.b8.nz/mnt/root/btrbk +subvolume m7 +target send-receive /mnt/r3/btrbk +target send-receive ssh://kd.b8.nz/mnt/root/btrbk + +# useful: +# printf 'subvolume di%s\ntarget send-receive /mnt/nu4/btrbk\n' {a..t} diff --git a/filesystem/etc/default/prometheus-node-exporter b/filesystem/etc/default/prometheus-node-exporter new file mode 100644 index 0000000..33e624a --- /dev/null +++ b/filesystem/etc/default/prometheus-node-exporter @@ -0,0 +1,280 @@ +# disable all optional collectors +ARGS="--collector.disable-defaults +--no-collector.interrupts.include-zeros +--collector.filesystem.mount-points-include=/ +--collector.netdev.device-include=eth0" + +# prometheus-node-exporter --help +# usage: prometheus-node-exporter [] + +# Flags: +# -h, --[no-]help Show context-sensitive help (also try --help-long and --help-man). +# --collector.arp.device-include=COLLECTOR.ARP.DEVICE-INCLUDE +# Regexp of arp devices to include (mutually exclusive to device-exclude). +# --collector.arp.device-exclude=COLLECTOR.ARP.DEVICE-EXCLUDE +# Regexp of arp devices to exclude (mutually exclusive to device-include). +# --[no-]collector.arp.netlink +# Use netlink to gather stats instead of /proc/net/arp. +# --[no-]collector.bcache.priorityStats +# Expose expensive priority stats. +# --[no-]collector.cpu.guest +# Enables metric node_cpu_guest_seconds_total +# --[no-]collector.cpu.info Enables metric cpu_info +# --collector.cpu.info.flags-include=COLLECTOR.CPU.INFO.FLAGS-INCLUDE +# Filter the `flags` field in cpuInfo with a value that must be a regular expression +# --collector.cpu.info.bugs-include=COLLECTOR.CPU.INFO.BUGS-INCLUDE +# Filter the `bugs` field in cpuInfo with a value that must be a regular expression +# --collector.diskstats.device-exclude="^(z?ram|loop|fd|(h|s|v|xv)d[a-z]|nvme\\d+n\\d+p)\\d+$" +# Regexp of diskstats devices to exclude (mutually exclusive to device-include). +# --collector.diskstats.device-include=COLLECTOR.DISKSTATS.DEVICE-INCLUDE +# Regexp of diskstats devices to include (mutually exclusive to device-exclude). +# --collector.ethtool.device-include=COLLECTOR.ETHTOOL.DEVICE-INCLUDE +# Regexp of ethtool devices to include (mutually exclusive to device-exclude). +# --collector.ethtool.device-exclude=COLLECTOR.ETHTOOL.DEVICE-EXCLUDE +# Regexp of ethtool devices to exclude (mutually exclusive to device-include). +# --collector.ethtool.metrics-include=".*" +# Regexp of ethtool stats to include. +# --collector.filesystem.mount-points-exclude="^/(dev|proc|run/credentials/.+|sys|var/lib/docker/.+|var/lib/containers/storage/.+)($|/)" +# Regexp of mount points to exclude for filesystem collector. (mutually exclusive to +# mount-points-include) +# --collector.filesystem.mount-points-include=COLLECTOR.FILESYSTEM.MOUNT-POINTS-INCLUDE +# Regexp of mount points to include for filesystem collector. (mutually exclusive to +# mount-points-exclude) +# --collector.filesystem.fs-types-exclude="^(autofs|binfmt_misc|bpf|cgroup2?|configfs|debugfs|devpts|devtmpfs|fusectl|hugetlbfs|iso9660|mqueue|nsfs|overlay|proc|procfs|pstore|rpc_pipefs|securityfs|selinuxfs|squashfs|erofs|sysfs|tracefs)$" +# Regexp of filesystem types to exclude for filesystem collector. (mutually exclusive to +# fs-types-include) +# --collector.filesystem.fs-types-include=COLLECTOR.FILESYSTEM.FS-TYPES-INCLUDE +# Regexp of filesystem types to exclude for filesystem collector. (mutually exclusive to +# fs-types-exclude) +# --collector.hwmon.chip-include=COLLECTOR.HWMON.CHIP-INCLUDE +# Regexp of hwmon chip to include (mutually exclusive to device-exclude). +# --collector.hwmon.chip-exclude=COLLECTOR.HWMON.CHIP-EXCLUDE +# Regexp of hwmon chip to exclude (mutually exclusive to device-include). +# --collector.hwmon.sensor-include=COLLECTOR.HWMON.SENSOR-INCLUDE +# Regexp of hwmon sensor to include (mutually exclusive to sensor-exclude). +# --collector.hwmon.sensor-exclude=COLLECTOR.HWMON.SENSOR-EXCLUDE +# Regexp of hwmon sensor to exclude (mutually exclusive to sensor-include). +# --collector.interrupts.name-include=COLLECTOR.INTERRUPTS.NAME-INCLUDE +# Regexp of interrupts name to include (mutually exclusive to +# --collector.interrupts.name-exclude). +# --collector.interrupts.name-exclude=COLLECTOR.INTERRUPTS.NAME-EXCLUDE +# Regexp of interrupts name to exclude (mutually exclusive to +# --collector.interrupts.name-include). +# --[no-]collector.interrupts.include-zeros +# Include interrupts that have a zero value +# --collector.ipvs.backend-labels="local_address,local_port,remote_address,remote_port,proto,local_mark" +# Comma separated list for IPVS backend stats labels. +# --collector.netclass.ignored-devices="^$" +# Regexp of net devices to ignore for netclass collector. +# --[no-]collector.netclass.ignore-invalid-speed +# Ignore devices where the speed is invalid. This will be the default behavior in 2.x. +# --[no-]collector.netclass.netlink +# Use netlink to gather stats instead of /proc/net/dev. +# --[no-]collector.netclass_rtnl.with-stats +# Expose the statistics for each network device, replacing netdev collector. +# --collector.netdev.device-include=COLLECTOR.NETDEV.DEVICE-INCLUDE +# Regexp of net devices to include (mutually exclusive to device-exclude). +# --collector.netdev.device-exclude=COLLECTOR.NETDEV.DEVICE-EXCLUDE +# Regexp of net devices to exclude (mutually exclusive to device-include). +# --[no-]collector.netdev.address-info +# Collect address-info for every device +# --[no-]collector.netdev.enable-detailed-metrics +# Use (incompatible) metric names that provide more detailed stats on Linux +# --[no-]collector.netdev.netlink +# Use netlink to gather stats instead of /proc/net/dev. +# --[no-]collector.netdev.label-ifalias +# Add ifAlias label +# --collector.netstat.fields="^(.*_(InErrors|InErrs)|Ip_Forwarding|Ip(6|Ext)_(InOctets|OutOctets)|Icmp6?_(InMsgs|OutMsgs)|TcpExt_(Listen.*|Syncookies.*|TCPSynRetrans|TCPTimeouts|TCPOFOQueue|TCPRcvQDrop)|Tcp_(ActiveOpens|InSegs|OutSegs|OutRsts|PassiveOpens|RetransSegs|CurrEstab)|Udp6?_(InDatagrams|OutDatagrams|NoPorts|RcvbufErrors|SndbufErrors))$" +# Regexp of fields to return for netstat collector. +# --collector.ntp.server="127.0.0.1" +# NTP server to use for ntp collector +# --collector.ntp.server-port=123 +# UDP port number to connect to on NTP server +# --collector.ntp.protocol-version=4 +# NTP protocol version +# --[no-]collector.ntp.server-is-local +# Certify that collector.ntp.server address is not a public ntp server +# --collector.ntp.ip-ttl=1 IP TTL to use while sending NTP query +# --collector.ntp.max-distance=3.46608s +# Max accumulated distance to the root +# --collector.ntp.local-offset-tolerance=1ms +# Offset between local clock and local ntpd time to tolerate +# --path.procfs="/proc" procfs mountpoint. +# --path.sysfs="/sys" sysfs mountpoint. +# --path.rootfs="/" rootfs mountpoint. +# --path.udev.data="/run/udev/data" +# udev data path. +# --collector.pcidevice.idsfile=COLLECTOR.PCIDEVICE.IDSFILE +# Path to pci.ids file to use for PCI device identification. +# --[no-]collector.pcidevice.names +# Enable PCI device name resolution (requires pci.ids file). +# --collector.perf.cpus="" List of CPUs from which perf metrics should be collected +# --collector.perf.tracepoint=COLLECTOR.PERF.TRACEPOINT ... +# perf tracepoint that should be collected +# --[no-]collector.perf.disable-hardware-profilers +# disable perf hardware profilers +# --collector.perf.hardware-profilers=COLLECTOR.PERF.HARDWARE-PROFILERS ... +# perf hardware profilers that should be collected +# --[no-]collector.perf.disable-software-profilers +# disable perf software profilers +# --collector.perf.software-profilers=COLLECTOR.PERF.SOFTWARE-PROFILERS ... +# perf software profilers that should be collected +# --[no-]collector.perf.disable-cache-profilers +# disable perf cache profilers +# --collector.perf.cache-profilers=COLLECTOR.PERF.CACHE-PROFILERS ... +# perf cache profilers that should be collected +# --collector.powersupply.ignored-supplies="^$" +# Regexp of power supplies to ignore for powersupplyclass collector. +# --collector.qdisc.fixtures="" +# test fixtures to use for qdisc collector end-to-end testing +# --collector.qdisc.device-include=COLLECTOR.QDISC.DEVICE-INCLUDE +# Regexp of qdisc devices to include (mutually exclusive to device-exclude). +# --collector.qdisc.device-exclude=COLLECTOR.QDISC.DEVICE-EXCLUDE +# Regexp of qdisc devices to exclude (mutually exclusive to device-include). +# --[no-]collector.rapl.enable-zone-label +# Enables service unit metric unit_start_time_seconds +# --collector.runit.servicedir="/etc/service" +# Path to runit service directory. +# --collector.slabinfo.slabs-include=".*" +# Regexp of slabs to include in slabinfo collector. +# --collector.slabinfo.slabs-exclude="" +# Regexp of slabs to exclude in slabinfo collector. +# --[no-]collector.stat.softirq +# Export softirq calls per vector +# --collector.supervisord.url="http://localhost:9001/RPC2" +# XML RPC endpoint. ($SUPERVISORD_URL) +# --collector.sysctl.include=COLLECTOR.SYSCTL.INCLUDE ... +# Select sysctl metrics to include +# --collector.sysctl.include-info=COLLECTOR.SYSCTL.INCLUDE-INFO ... +# Select sysctl metrics to include as info metrics +# --collector.systemd.unit-include=".+" +# Regexp of systemd units to include. Units must both match include and not match exclude to +# be included. +# --collector.systemd.unit-exclude=".+\\.(automount|device|mount|scope|slice)" +# Regexp of systemd units to exclude. Units must both match include and not match exclude to +# be included. +# --[no-]collector.systemd.enable-task-metrics +# Enables service unit tasks metrics unit_tasks_current and unit_tasks_max +# --[no-]collector.systemd.enable-restarts-metrics +# Enables service unit metric service_restart_total +# --[no-]collector.systemd.enable-start-time-metrics +# Enables service unit metric unit_start_time_seconds +# --collector.tapestats.ignored-devices="^$" +# Regexp of devices to ignore for tapestats. +# --collector.textfile.directory= ... +# Directory to read text files with metrics from, supports glob matching. (repeatable) +# --collector.vmstat.fields="^(oom_kill|pgpg|pswp|pg.*fault).*" +# Regexp of fields to return for vmstat collector. +# --collector.wifi.fixtures="" +# test fixtures to use for wifi collector metrics +# --[no-]collector.arp Enable the arp collector (default: enabled). +# --[no-]collector.bcache Enable the bcache collector (default: enabled). +# --[no-]collector.bonding Enable the bonding collector (default: enabled). +# --[no-]collector.btrfs Enable the btrfs collector (default: enabled). +# --[no-]collector.buddyinfo +# Enable the buddyinfo collector (default: disabled). +# --[no-]collector.cgroups Enable the cgroups collector (default: disabled). +# --[no-]collector.conntrack +# Enable the conntrack collector (default: enabled). +# --[no-]collector.cpu Enable the cpu collector (default: enabled). +# --[no-]collector.cpu_vulnerabilities +# Enable the cpu_vulnerabilities collector (default: disabled). +# --[no-]collector.cpufreq Enable the cpufreq collector (default: enabled). +# --[no-]collector.diskstats +# Enable the diskstats collector (default: enabled). +# --[no-]collector.dmi Enable the dmi collector (default: enabled). +# --[no-]collector.drbd Enable the drbd collector (default: disabled). +# --[no-]collector.drm Enable the drm collector (default: disabled). +# --[no-]collector.edac Enable the edac collector (default: enabled). +# --[no-]collector.entropy Enable the entropy collector (default: enabled). +# --[no-]collector.ethtool Enable the ethtool collector (default: disabled). +# --[no-]collector.fibrechannel +# Enable the fibrechannel collector (default: enabled). +# --[no-]collector.filefd Enable the filefd collector (default: enabled). +# --[no-]collector.filesystem +# Enable the filesystem collector (default: enabled). +# --[no-]collector.hwmon Enable the hwmon collector (default: enabled). +# --[no-]collector.infiniband +# Enable the infiniband collector (default: enabled). +# --[no-]collector.interrupts +# Enable the interrupts collector (default: disabled). +# --[no-]collector.ipvs Enable the ipvs collector (default: enabled). +# --[no-]collector.ksmd Enable the ksmd collector (default: disabled). +# --[no-]collector.lnstat Enable the lnstat collector (default: disabled). +# --[no-]collector.loadavg Enable the loadavg collector (default: enabled). +# --[no-]collector.logind Enable the logind collector (default: disabled). +# --[no-]collector.mdadm Enable the mdadm collector (default: enabled). +# --[no-]collector.meminfo Enable the meminfo collector (default: enabled). +# --[no-]collector.meminfo_numa +# Enable the meminfo_numa collector (default: disabled). +# --[no-]collector.mountstats +# Enable the mountstats collector (default: disabled). +# --[no-]collector.netclass Enable the netclass collector (default: enabled). +# --[no-]collector.netdev Enable the netdev collector (default: enabled). +# --[no-]collector.netstat Enable the netstat collector (default: enabled). +# --[no-]collector.network_route +# Enable the network_route collector (default: disabled). +# --[no-]collector.nfs Enable the nfs collector (default: enabled). +# --[no-]collector.nfsd Enable the nfsd collector (default: enabled). +# --[no-]collector.ntp Enable the ntp collector (default: disabled). +# --[no-]collector.nvme Enable the nvme collector (default: enabled). +# --[no-]collector.os Enable the os collector (default: enabled). +# --[no-]collector.pcidevice +# Enable the pcidevice collector (default: disabled). +# --[no-]collector.perf Enable the perf collector (default: disabled). +# --[no-]collector.powersupplyclass +# Enable the powersupplyclass collector (default: enabled). +# --[no-]collector.pressure Enable the pressure collector (default: enabled). +# --[no-]collector.processes +# Enable the processes collector (default: disabled). +# --[no-]collector.qdisc Enable the qdisc collector (default: disabled). +# --[no-]collector.rapl Enable the rapl collector (default: enabled). +# --[no-]collector.runit Enable the runit collector (default: disabled). +# --[no-]collector.schedstat +# Enable the schedstat collector (default: enabled). +# --[no-]collector.selinux Enable the selinux collector (default: enabled). +# --[no-]collector.slabinfo Enable the slabinfo collector (default: disabled). +# --[no-]collector.sockstat Enable the sockstat collector (default: enabled). +# --[no-]collector.softirqs Enable the softirqs collector (default: disabled). +# --[no-]collector.softnet Enable the softnet collector (default: enabled). +# --[no-]collector.stat Enable the stat collector (default: enabled). +# --[no-]collector.supervisord +# Enable the supervisord collector (default: disabled). +# --[no-]collector.swap Enable the swap collector (default: disabled). +# --[no-]collector.sysctl Enable the sysctl collector (default: disabled). +# --[no-]collector.systemd Enable the systemd collector (default: disabled). +# --[no-]collector.tapestats +# Enable the tapestats collector (default: enabled). +# --[no-]collector.tcpstat Enable the tcpstat collector (default: disabled). +# --[no-]collector.textfile Enable the textfile collector (default: enabled). +# --[no-]collector.thermal_zone +# Enable the thermal_zone collector (default: enabled). +# --[no-]collector.time Enable the time collector (default: enabled). +# --[no-]collector.timex Enable the timex collector (default: enabled). +# --[no-]collector.udp_queues +# Enable the udp_queues collector (default: enabled). +# --[no-]collector.uname Enable the uname collector (default: enabled). +# --[no-]collector.vmstat Enable the vmstat collector (default: enabled). +# --[no-]collector.watchdog Enable the watchdog collector (default: enabled). +# --[no-]collector.wifi Enable the wifi collector (default: disabled). +# --[no-]collector.xfrm Enable the xfrm collector (default: disabled). +# --[no-]collector.xfs Enable the xfs collector (default: enabled). +# --[no-]collector.zfs Enable the zfs collector (default: enabled). +# --[no-]collector.zoneinfo Enable the zoneinfo collector (default: disabled). +# --web.telemetry-path="/metrics" +# Path under which to expose metrics. +# --[no-]web.disable-exporter-metrics +# Exclude metrics about the exporter itself (promhttp_*, process_*, go_*). +# --web.max-requests=40 Maximum number of parallel scrape requests. Use 0 to disable. +# --[no-]collector.disable-defaults +# Set all collectors to disabled by default. +# --runtime.gomaxprocs=1 The target number of CPUs Go will run on (GOMAXPROCS) ($GOMAXPROCS) +# --[no-]web.systemd-socket Use systemd socket activation listeners instead of port listeners (Linux only). +# --web.listen-address=:9100 ... +# Addresses on which to expose metrics and web interface. Repeatable for multiple addresses. +# Examples: `:9100` or `[::1]:9100` for http, `vsock://:9100` for vsock +# --web.config.file="" Path to configuration file that can enable TLS or authentication. See: +# https://github.com/prometheus/exporter-toolkit/blob/master/docs/web-configuration.md +# --log.level=info Only log messages with the given severity or above. One of: [debug, info, warn, error] +# --log.format=logfmt Output format of log messages. One of: [logfmt, json] +# --[no-]version Show application version. diff --git a/filesystem/etc/sysctl.d/iank.conf b/filesystem/etc/sysctl.d/iank.conf new file mode 100644 index 0000000..6442b2e --- /dev/null +++ b/filesystem/etc/sysctl.d/iank.conf @@ -0,0 +1,4 @@ +# misc settings + +# default is 120 and gets hit a lot with heavy io. +kernel.hung_task_timeout_secs=600 diff --git a/filesystem/usr/local/bin/bat b/filesystem/usr/local/bin/bat new file mode 100755 index 0000000..486292d --- /dev/null +++ b/filesystem/usr/local/bin/bat @@ -0,0 +1,23 @@ +#!/bin/bash +# I, Ian Kelling, follow the GNU license recommendations at +# https://www.gnu.org/licenses/license-recommendations.en.html. They +# recommend that small programs, < 300 lines, be licensed under the +# Apache License 2.0. This file contains or is part of one or more small +# programs. If a small program grows beyond 300 lines, I plan to change +# to a recommended GPL license. + +# Copyright 2025 Ian Kelling + +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at + +# http://www.apache.org/licenses/LICENSE-2.0 + +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +batcat "$@" diff --git a/filesystem/usr/local/bin/prof-tmux-attach b/filesystem/usr/local/bin/prof-tmux-attach new file mode 100755 index 0000000..0ab3dcc --- /dev/null +++ b/filesystem/usr/local/bin/prof-tmux-attach @@ -0,0 +1,59 @@ +#!/bin/bash +# I, Ian Kelling, follow the GNU license recommendations at +# https://www.gnu.org/licenses/license-recommendations.en.html. They +# recommend that small programs, < 300 lines, be licensed under the +# Apache License 2.0. This file contains or is part of one or more small +# programs. If a small program grows beyond 300 lines, I plan to switch +# its license to GPL. + +# Copyright 2024 Ian Kelling + +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at + +# http://www.apache.org/licenses/LICENSE-2.0 + +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + + +set -e; . /usr/local/lib/bash-bear; set +e + +source /p/c/domain-info + + +if systemctl --user --quiet is-active profanity || [[ $HOSTNAME == "$d_host" ]]; then + # local connection. + tmux -L profanity a + exit 0 +fi +## remainder of script is in the case of a remote connection + + +fastcon=0 +while true; do + start=$EPOCHSECONDS + if ! ssh-add -l | grep SHA256:YEhwH5u+wkqkSl/dCq8rFebi2qz7Os3RmIWPxMg13eA &>/dev/null; then + ssh -n prof + fi + ssh -l iank -t prof tmux -L profanity a ||: + if (( EPOCHSECONDS > start + 600 )); then + fastcon=0 + fi + # we try to reconnect quickly for a while (just once as I write this), + # then try to reconnect slowly. + if (( fastcon < 1 )); then + echo "waiting 10. any key to cancel" + read -rsN1 -t 10 ||: + fastcon=$((fastcon+1)) + else + echo "waiting 120. any key to cancel" + # like sleep but stop on any input + read -rsN1 -t 120 ||: + fi +done diff --git a/filesystem/usr/local/bin/wghole-check b/filesystem/usr/local/bin/wghole-check new file mode 100755 index 0000000..086aeb1 --- /dev/null +++ b/filesystem/usr/local/bin/wghole-check @@ -0,0 +1,49 @@ +#!/bin/bash +# I, Ian Kelling, follow the GNU license recommendations at +# https://www.gnu.org/licenses/license-recommendations.en.html. They +# recommend that small programs, < 300 lines, be licensed under the +# Apache License 2.0. This file contains or is part of one or more small +# programs. If a small program grows beyond 300 lines, I plan to change +# to a recommended GPL license. + +# Copyright 2025 Ian Kelling + +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at + +# http://www.apache.org/licenses/LICENSE-2.0 + +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +### Checks if wghole is missing its ip address and other conditions + + +[[ $EUID == 0 ]] || exec sudo -E "${BASH_SOURCE[0]}" "$@" + +. /usr/local/lib/fsf-script-lib + + +needs-restart() { + ip_out=$(ip a show dev wghole 2>/dev/null) || exit 0 + if printf "%s\n" "$ip_out" | grep -Fq 10.8.0; then + exit 0 + fi + if ! curl -s 72.14.176.105 &>/dev/null; then + exit 0 + fi + if ! systemctl is-active wg-quick@wghole | grep -Fxq active; then + exit 0 + fi +} + +needs-restart +# Sleep and recheck should be good enough to beavoid a race condition +# with another instance restarting. +sleep $(( 3 + ( RANDOM % 5 ) )) +needs-restart +systemctl restart wg-quick@wghole.service diff --git a/machine_specific/frodo/filesystem/etc/btrbk/root.conf b/machine_specific/frodo/filesystem/etc/btrbk/root.conf new file mode 100644 index 0000000..b48b877 --- /dev/null +++ b/machine_specific/frodo/filesystem/etc/btrbk/root.conf @@ -0,0 +1,24 @@ +transaction_syslog local7 + +lockfile /var/lock/btrbk-root.lock + +timestamp_format long-iso + +snapshot_create onchange + +snapshot_preserve 18h 14d 8w 12m +snapshot_preserve_min 2d +snapshot_dir btrbk + +target_preserve 18h 14d 8w 12m +target_preserve_min 2d + +rate_limit no +volume /mnt/root + +# a & q are handled separately by btrbk-run & btrbk.timer + +subvolume m0 +subvolume m1 +subvolume m2 +subvolume ro2 diff --git a/machine_specific/frodo/filesystem/etc/mdadm/mdadm.conf b/machine_specific/frodo/filesystem/etc/mdadm/mdadm.conf new file mode 100644 index 0000000..52d5ab5 --- /dev/null +++ b/machine_specific/frodo/filesystem/etc/mdadm/mdadm.conf @@ -0,0 +1,4 @@ +ARRAY /dev/md/pg1 level=raid0 num-devices=4 metadata=1.2 UUID=3bab0b4d:ad7a3136:c75fde32:f4373de1 + devices=/dev/dm-16,/dev/dm-22,/dev/dm-5,/dev/dm-7 +ARRAY /dev/md/ndi level=raid0 num-devices=4 metadata=1.2 UUID=693bf056:3875b2bb:7794738b:98914a2c + #devices=/dev/mapper/int-vgnvme-WD_BLACK_SN850P_for_PS5_8000GB_24517P800200-ndi,/dev/mapper/int-vgnvme-WD_BLACK_SN850X_8000GB_245244802091-ndi,/dev/mapper/int-vgnvme-WD_BLACK_SN850X_8000GB_245244802317-ndi,/dev/mapper/int-vgnvme-WD_BLACK_SN850X_8000GB_25026Y802189-ndi diff --git a/machine_specific/frodo/filesystem/etc/systemd/system/btrbkroot.service b/machine_specific/frodo/filesystem/etc/systemd/system/btrbkroot.service new file mode 100644 index 0000000..7473146 --- /dev/null +++ b/machine_specific/frodo/filesystem/etc/systemd/system/btrbkroot.service @@ -0,0 +1,7 @@ +[Unit] +Description=Btrbk to root +After=multi-user.target + +[Service] +Type=oneshot +ExecStart=/usr/local/bin/sysd-mail-once btrbkroot btrbk -c /etc/btrbk/root.conf run diff --git a/machine_specific/frodo/filesystem/etc/systemd/system/btrbkroot.timer b/machine_specific/frodo/filesystem/etc/systemd/system/btrbkroot.timer new file mode 100644 index 0000000..afab97c --- /dev/null +++ b/machine_specific/frodo/filesystem/etc/systemd/system/btrbkroot.timer @@ -0,0 +1,8 @@ +[Unit] +Description=Btrbk root timer + +[Timer] +OnCalendar=*-*-* 13:00:00 America/New_York + +[Install] +WantedBy=timers.target diff --git a/machine_specific/frodo/subdir_files/.config/systemd/user/profanity.service.d/frodo.conf b/machine_specific/frodo/subdir_files/.config/systemd/user/profanity.service.d/frodo.conf new file mode 100644 index 0000000..1c9c2a4 --- /dev/null +++ b/machine_specific/frodo/subdir_files/.config/systemd/user/profanity.service.d/frodo.conf @@ -0,0 +1,2 @@ +[Unit] +AssertPathExists=/d/p/profanity diff --git a/subdir_files/.config/bat/config b/subdir_files/.config/bat/config new file mode 100644 index 0000000..11df923 --- /dev/null +++ b/subdir_files/.config/bat/config @@ -0,0 +1,28 @@ +# This is `bat`s configuration file. Each line either contains a comment or +# a command-line option that you want to pass to `bat` by default. You can +# run `bat --help` to get a list of all possible configuration options. + +# Specify desired highlighting theme (e.g. "TwoDark"). Run `bat --list-themes` +# for a list of all available themes +#--theme="TwoDark" + +# Enable this to use italic text on the terminal. This is not supported on all +# terminal emulators (like tmux, by default): +#--italic-text=always + +# Uncomment the following line to disable automatic paging: +--paging=never + +# Uncomment the following line if you are using less version >= 551 and want to +# enable mouse scrolling support in `bat` when running inside tmux. This might +# disable text selection, unless you press shift. +#--pager="less --RAW-CONTROL-CHARS --quit-if-one-screen --mouse" + +# Syntax mappings: map a certain filename pattern to a language. +# Example 1: use the C++ syntax for Arduino .ino files +# Example 2: Use ".gitignore"-style highlighting for ".ignore" files +#--map-syntax "*.ino:C++" +#--map-syntax ".ignore:Git Ignore" + +--theme=Coldark-Cold +--plain diff --git a/subdir_files/.config/konsolerc b/subdir_files/.config/konsolerc index 0ceaeed..310d7bf 100644 --- a/subdir_files/.config/konsolerc +++ b/subdir_files/.config/konsolerc @@ -23,10 +23,10 @@ ShowMenuBarByDefault=false 2 screens: Width=1916 2 screens: XPosition=2 2 screens: YPosition=2 -3840x2160 screen: Height=2142 -3840x2160 screen: Width=1916 +3840x2160 screen: Height=2156 +3840x2160 screen: Width=3836 3840x2160 screen: XPosition=2 -3840x2160 screen: YPosition=16 +3840x2160 screen: YPosition=2 DP-0=DP-0 DP-1 eDP-1=DP-1 DP-1-1 eDP-1=DP-1-1 @@ -34,8 +34,7 @@ DP-1-3 eDP-1=eDP-1 HDMI-1 eDP-1=eDP-1 HDMI-2 eDP-1=HDMI-2 MenuBar=Disabled -State=AAAA/wAAAAD9AAAAAQAAAAAAAAAAAAAAAPwCAAAAAvsAAAAiAFEAdQBpAGMAawBDAG8AbQBtAGEAbgBkAHMARABvAGMAawAAAAAA/////wAAATUA////+wAAABwAUwBTAEgATQBhAG4AYQBnAGUAcgBEAG8AYwBrAAAAAAD/////AAAA5QD///8AAAd8AAAIbAAAAAQAAAAEAAAACAAAAAj8AAAAAQAAAAIAAAACAAAAFgBtAGEAaQBuAFQAbwBvAGwAQgBhAHIAAAAAAP////8AAAAAAAAAAAAAABwAcwBlAHMAcwBpAG8AbgBUAG8AbwBsAGIAYQByAAAAAAD/////AAAAAAAAAAA= -ToolBarsMovable=Disabled +State=AAAA/wAAAAD9AAAAAQAAAAAAAAAAAAAAAPwCAAAAAvsAAAAiAFEAdQBpAGMAawBDAG8AbQBtAGEAbgBkAHMARABvAGMAawAAAAAA/////wAAATUA////+wAAABwAUwBTAEgATQBhAG4AYQBnAGUAcgBEAG8AYwBrAAAAAAD/////AAAA5QD///8AAA78AAAIbAAAAAQAAAAEAAAACAAAAAj8AAAAAQAAAAIAAAACAAAAFgBtAGEAaQBuAFQAbwBvAGwAQgBhAHIAAAAAAP////8AAAAAAAAAAAAAABwAcwBlAHMAcwBpAG8AbgBUAG8AbwBsAGIAYQByAAAAAAD/////AAAAAAAAAAA= eDP-1=eDP-1 [TabBar] diff --git a/subdir_files/.config/systemd/user/profanity.service b/subdir_files/.config/systemd/user/profanity.service index bec7c1d..65bd785 100644 --- a/subdir_files/.config/systemd/user/profanity.service +++ b/subdir_files/.config/systemd/user/profanity.service @@ -19,5 +19,10 @@ Type=forking # new-session is a tmux command which allows launching profanity. ExecStart=/usr/bin/tmux -L profanity new-session -d profanity + +# if we have to move this to a system service: +#User=iank +#Group=iank + [Install] WantedBy=default.target diff --git a/subdir_files/.local/share/kxmlgui5/konsole/sessionui.rc b/subdir_files/.local/share/kxmlgui5/konsole/sessionui.rc index 124005b..9faefbf 100644 --- a/subdir_files/.local/share/kxmlgui5/konsole/sessionui.rc +++ b/subdir_files/.local/share/kxmlgui5/konsole/sessionui.rc @@ -3,50 +3,50 @@ - + - + - - + + - - + + - - + + - - - - + + + + - - - + + + - - - - - + + + + + - - + + - - - - + + + + - - + + - - + + @@ -83,11 +83,11 @@ - - - - - - + + + + + + diff --git a/znc-start-delay b/znc-start-delay index 9402e13..93a922e 100755 --- a/znc-start-delay +++ b/znc-start-delay @@ -29,8 +29,11 @@ set -e; . /usr/local/lib/bash-bear; set +e # first field as an integer. up_secs=$(sed 's/[^0-9].*//' /proc/uptime) -delay=$(( 120 - up_secs )) +delay=$(( 180 - up_secs )) + if (( delay > 0 )); then sleep $delay fi + +sleep 5