Skip to content

Instantly share code, notes, and snippets.

View jens-maus's full-sized avatar
💻
Busy developing for you!

Jens Maus jens-maus

💻
Busy developing for you!
View GitHub Profile
@jens-maus
jens-maus / lxc_cpu.sh
Created July 28, 2023 16:37
CheckMK LXC container CPU local check script to output CPU utilization in the range of 0-100% (required for ProxmoxVE LXC)
#!/bin/bash
cpu_last_sum=0
while :; do
# get the first line with aggregate of all CPUs
cpu_now=($(head -n1 /proc/stat))
# get all columns but skip the first (which is the "cpu" string)
cpu_sum="${cpu_now[@]:1}"
@jens-maus
jens-maus / gist:497e03cf1305ffe8a07e3196c27d6ebd
Created January 19, 2024 10:48
rpi5 8GB device-tree output
/dts-v1/;
/ {
#address-cells = <0x02>;
memreserve = <0x3f800000 0x800000>;
model = "Raspberry Pi 5 Model B Rev 1.0";
serial-number = "6b206ca09127ae99";
#size-cells = <0x01>;
interrupt-parent = <0x01>;
compatible = "raspberrypi,5-model-b\0brcm,bcm2712";
@jens-maus
jens-maus / docker-overlay-prune.sh
Created April 16, 2025 06:36
docker orphaned overlay2 cleanup script
#!/bin/bash
# partly based on https://stackoverflow.com/a/72548686
[[ $(id -u) -eq 0 ]] || exec sudo /bin/bash -c "$(printf '%q ' "$BASH_SOURCE" "$@")"
progname=$(basename $0)
quiet=false
no_dry_run=false
while getopts ":qn" opt; do
case "$opt" in
q)