Skip to content

Instantly share code, notes, and snippets.

@seidler2547
seidler2547 / auto-switch.sh
Created March 22, 2026 18:21
How to make an SBC appear as USB storage device and have access to the files via Samba
#!/bin/bash
while :
do
sleep 1
if [ -e /mnt/write ]
then
if grep -q usb /sys/kernel/config/usb_gadget/g1/UDC
then
sync
@seidler2547
seidler2547 / cephfs-csi-backup.sh
Last active March 18, 2026 12:08
CephFS CSI Kubernetes Backup to Proxmox Backup Server
#!/bin/bash
# this is just an example, better source this from a .env file or via cron/other means
export PBS_PASSWORD=password
export PBS_REPOSITORY=k8sbackup@pbs@pbs:backup
ROOTNS=k8s
cd /mnt/pve/cephfs/volumes/csi
for d in csi-vol-*
do
@seidler2547
seidler2547 / Dockerfile
Created October 27, 2023 14:48
Signal XPRA
FROM ffeldhaus/xpra-html5-minimal
RUN mv /etc/apt/sources.list.d/xpra.list /etc/apt/sources.list.d/xpra.list.bak && \
apt-get update -y && \
apt-get install -y --no-install-recommends curl dirmngr gnupg2 ca-certificates gpg && \
curl -s https://xpra.org/xpra.asc | gpg --dearmor | apt-key --keyring /etc/apt/trusted.gpg.d/xpra-apt-key.gpg add && \
curl -s https://updates.signal.org/desktop/apt/keys.asc | gpg --dearmor > /usr/share/keyrings/signal-desktop-keyring.gpg && \
mv /etc/apt/sources.list.d/xpra.list.bak /etc/apt/sources.list.d/xpra.list && \
echo 'deb [arch=amd64 signed-by=/usr/share/keyrings/signal-desktop-keyring.gpg] https://updates.signal.org/desktop/apt xenial main' > /etc/apt/sources.list.d/signal-xenial.list && \
apt-get update -y && \
@seidler2547
seidler2547 / products.txt
Created June 5, 2023 07:32
Victron ProductId to product mapping (velib products.h)
# extracted from vecan-dbus binary using
# od -i -w8 < ids | grep -m 1 65535 -B 1000 | while read -a REPLY ; do echo ${REPLY[1]} $(dd if=vecan-dbus bs=1 count=60 status=none skip=$((${REPLY[2]}-65536)) | cut -d '' -f1) ; done > products.txt
1 VPN
2 VBC
3 VVC
4 VCC
5 VCM
6 VGM
7 VRS
8 Free Technics software
@seidler2547
seidler2547 / ffmpeg.py
Created July 1, 2021 18:20
Speech to text from mp3/mp4/url using vosk+ffmpeg
#!/usr/bin/env python3
from vosk import Model, KaldiRecognizer, SetLogLevel
import sys
import os
import wave
import subprocess
import json
SetLogLevel(0)
@seidler2547
seidler2547 / check_mem_full
Created March 25, 2021 09:09
Useful Icinga/Nagios Linux Memory check
#!/usr/bin/awk -E
BEGIN {
while ((getline <"/proc/meminfo") > 0 ) {
gsub(/:/,"");
gsub(/\(/,"_");
gsub(/\)/,"");
a[$1]=$2;
u[$1]=toupper($3);
}
swapfactor=(ENVIRON["swapfactor"]~/^[0-9]+$/)?ENVIRON["swapfactor"]:0.5;
@seidler2547
seidler2547 / check_puppet
Created February 16, 2021 11:05
Nagios/Icinga Puppet run check
#!/opt/puppetlabs/puppet/bin/ruby
require 'yaml'
require 'puppet'
require 'optparse'
options = {
:lastrun_warn => 3600,
:lastrun_crit => 36000,
:runtime_warn => 25,
@seidler2547
seidler2547 / check_hwmon
Created February 16, 2021 11:04
Nagios/Icinga hardware monitor check
#!/bin/bash
export LANG=C
export LC_ALL=C
R=3
WC=0
CC=0
IGN=$1
@seidler2547
seidler2547 / proxmox.pp
Last active July 23, 2020 17:39
Proxmox SSH key exchange Puppet
class mymod::proxmox {
$loc = downcase(hiera('hostgroup'))
tag "hostgroup-$loc"
@@sshkey { "$hostname":
ensure => present,
host_aliases => [ $fqdn, $facts['networking']['ip'] ],
type => "rsa",
key => $sshrsakey,
}
@seidler2547
seidler2547 / master.pp
Created April 16, 2020 08:37
Exchange SSH user and host keys using Puppet
class mybase::jenkins::master {
Sshkey <<| tag == 'jenkinsslave' |>>
}