Welcome to BAFM#
This blog is a collection of thoughts, experiences, and technical insights from a sysadmin’s perspective. Here you’ll find posts about system administration, infrastructure challenges, troubleshooting adventures, and the occasional philosophical rambling about technology and its role in our daily work.
Whether you’re a fellow sysadmin looking for solutions, someone curious about the behind-the-scenes work that keeps systems running, or just stumbled upon this corner of the internet – welcome! Feel free to explore, and don’t hesitate to reach out if you have questions or want to share your own experiences.
Follow me through my journey through life with all it’s neat little tricks, caveats and side-quests.
Quick Links#
Last updated: January 2026
Introduction When developing automation for Cisco Intersight, understanding the API structure is crucial. The Intersight OpenAPI v3 specification contains over 5,000 schemas across 575,000+ lines of YAML—a daunting document to navigate manually. This article introduces a Python-based tool that makes exploring this specification efficient and practical.
The Challenge Developing PowerShell functions for Intersight requires deep knowledge of:
Object properties and their types Required vs. optional fields Relationship hierarchies (MoMoRef patterns) Enum values and defaults Inheritance structures through allOf references Without proper tooling, developers must:
...
ℹ️ Attribution This article is a reproduction/adaptation of the original article by @nawazdhandala on OneUptime. The original article can be found here: How to Use NAS Storage with Docker Compose. I am not the original author of this content. You have a NAS with terabytes of storage, RAID protection, and automatic backups. Your Docker containers keep losing data when you recreate them. The solution is obvious: mount your NAS storage directly into your containers. Docker Compose makes this surprisingly easy once you understand the volume driver options.
...
This is a personal quick-reference for working with LVM (Logical Volume Manager) on Linux. It covers the full lifecycle from creating Physical Volumes through extending Logical Volumes, and finally growing the filesystem on top.
...
A lightweight Python service that watches Docker events on worker nodes, extracts Traefik labels, and syncs them as file provider rules to the Swarm manager.
OwnCloud Camera Import Sort Script 1 2 3 4 5 6 7 8 9 10 11 12 BASE_DIR=/var/www/owncloud.heimdaheim.de/data/christian/files/Camera-Import SORT_DIR=/var/www/owncloud.heimdaheim.de/data/christian/files/Camera-Sorted find "$BASE_DIR" -type f -name "*" | while IFS= read -r file; do year="$(date -d "$(stat -c %y "$file")" +%Y)" month="$(date -d "$(stat -c %y "$file")" +%b)" filestamp="$(date -d "$(stat -c %y "$file")" +%Y%m%d)" [[ ! -d "$SORT_DIR/$year/$month" ]] && mkdir -p "$SORT_DIR/$year/$month" mv "$file" "$SORT_DIR/$year/$month/${filestamp}_${file##*/}" done Description This Bash script automatically sorts camera uploads from OwnCloud into a year/month directory structure. Files are organized based on their modification date and prefixed with a timestamp in the filename.
...
This is how to sort files into date separated folders.
1 2 3 4 5 6 7 8 9 10 BASE_DIR=/var/www/owncloud.heimdaheim.de/data/christian/files/oldgallery SORT_DIR=/var/www/owncloud.heimdaheim.de/data/christian/files/datedgallery find "$BASE_DIR" -type f -name "*" | while IFS= read -r file; do year="$(date -d "$(stat -c %y "$file")" +%Y)" month="$(date -d "$(stat -c %y "$file")" +%b)" filestamp="$( date -d "$( stat -c %y "$file")" +%Y%m%d)" [[ ! -d "$SORT_DIR/$year/$month" ]] && mkdir -p "$SORT_DIR/$year/$month"; mv "$file" "$SORT_DIR/$year/$month/${filestamp}_${file##*/}" done
So I just had the issue, that I encountered a long running local tracking git repo to be huge.
And it wasn’t that there are huge (lfs) files stored in it.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 # du -h --max-depth=1 --exclude=.git /var/www/pma.heimdaheim.de/www/ 60K /var/www/pma.heimdaheim.de/www/.github 676K /var/www/pma.heimdaheim.de/www/doc 20K /var/www/pma.heimdaheim.de/www/examples 9.0M /var/www/pma.heimdaheim.de/www/js 5.8M /var/www/pma.heimdaheim.de/www/libraries 59M /var/www/pma.heimdaheim.de/www/po 92K /var/www/pma.heimdaheim.de/www/scripts 28K /var/www/pma.heimdaheim.de/www/setup 28K /var/www/pma.heimdaheim.de/www/sql 1.5M /var/www/pma.heimdaheim.de/www/templates 3.3M /var/www/pma.heimdaheim.de/www/test 9.0M /var/www/pma.heimdaheim.de/www/themes 20M /var/www/pma.heimdaheim.de/www/vendor 92M /var/www/pma.heimdaheim.de/www/node_modules 28K /var/www/pma.heimdaheim.de/www/tmp 200M /var/www/pma.heimdaheim.de/www/ Now after looking at that, we can take a closer look into the git-directory itself (as to what is consuming the space):
...
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 # Clone the VM qm clone 9000 4140 --name nzbget.ka.beiheimdaheim.de --full=true --storage vmstorage # Set the nameserver qm set 4140 --nameserver=10.76.41.1 # Set the ipconfiguration qm set 4140 --ipconfig0 ip=10.76.41.40/24,gw=10.76.41.1 # Configure the virtual network adapter. qm set 4140 --net0 virtio,bridge=vmbr0,tag=41 # Enable autoboot qm set 4140 --onboot 1 # Set the RAM of the VM qm set 4140 --memory 2048 # Set the vCPU count for the VM qm set 4140 --cores 2 # Start the VM qm start 4140
Step 1: Download the Ubuntu image 1 2 3 4 5 6 SRC_IMG="https://cloud-images.ubuntu.com/jammy/current/jammy-server-cloudimg-amd64-disk-kvm.img" #VMSTORAGE="/vmstorage" VMSTORAGE="/var/lib/vz/images" IMG_NAME="jammy-server-cloudimg-amd64-disk-kvm.qcow2" IMG_PATH="$VMSTORAGE/$IMG_NAME" wget -O $IMG_PATH $SRC_IMG Step 2: Add necessary packages 1 2 sudo apt install -y libguestfs-tools sudo virt-customize -a $IMG_PATH --install cloud-initramfs-growroot,atop,htop,nano,vim,qemu-guest-agent,curl,wget,unattended-upgrades,git Step 3: Modify /etc/ssh/sshd_config 1 sudo virt-customize -a $IMG_PATH --run-command "sed -i 's/.*PasswordAuthentication.*/PasswordAuthentication yes/g' /etc/ssh/sshd_config" Step 4: Modify /etc/apt/apt.conf.d/50unattended-upgrades 1 2 export EDITOR=nano sudo -E virt-edit -a $IMG_PATH /etc/apt/apt.conf.d/50unattended-upgrades Step 5: Modify /etc/default/grub 1 2 3 export EDITOR=nano sudo -E virt-edit -a $IMG_PATH /etc/default/grub sudo virt-customize -a $IMG_PATH --run-command "update-grub" Step 6: Install ohmybash 1 2 sudo virt-customize -a $IMG_PATH --run-command "git clone https://github.com/ohmybash/oh-my-bash.git /opt/ohmybash" Step 7: Fix timezone 1 sudo virt-customize -a $IMG_PATH --timezone "Europe/Berlin" Step 8: Create the Proxmox template 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 TEMPL_NAME="ubuntu2204-cloud" VMID="9000" MEM="512" DISK_SIZE="10G" DISK_STOR="vmstorage" NET_BRIDGE="vmbr0" qm create $VMID --name $TEMPL_NAME --memory $MEM --net0 virtio,bridge=$NET_BRIDGE qm importdisk $VMID $IMG_NAME $DISK_STOR qm set $VMID --agent enabled=1 qm set $VMID --scsihw virtio-scsi-pci --scsi0 $DISK_STOR:vm-$VMID-disk-0 qm set $VMID --ide2 $DISK_STOR:cloudinit qm set $VMID --boot c --bootdisk scsi0 qm set $VMID --serial0 socket --vga serial0 qm set $VMID --ipconfig0 ip=dhcp qm set $VMID --ciuser=christian qm set $VMID --cipassword="bla" qm set $VMID --searchdomain=ka.beiheimdaheim.de qm resize $VMID scsi0 $DISK_SIZE qm template $VMID
This is a quick note for some commands, I have found useful.
Get the currently configured OS hostname 1 > racadm get System.ServerOS.Hostname Set the configured OS hostname 1 2 3 > racadm set System.ServerOS.Hostname hv-2.ka.beiheimdaheim.de [Key=System.Embedded.1#ServerOS.1] Object value modified successfully Reset the SSL certificate 1 2 > racadm sslresetcfg > racadm racreset https://mindlesstux.com/2018/03/13/idrac-7-letsencrypt-wildcard-cert/ https://www.itechlounge.net/2018/03/dell-how-to-install-a-custom-issued-ssl-certificate-on-idrac/ Get a list of all storage devices, and their blocksize (conversion of NetApp Disks - blocksize 520) 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 $ for sg in $( ls /dev/sg* ); do output=$(sg\_format $sg 2>/dev/null); blocksize=$( echo "$output" \| grep 'Block size' \| cut -d\\= -f2 \| cut -d\ -f1); echo "$sg: $blocksize"; done /dev/sg0: 512 /dev/sg1: 512 /dev/sg10: 512 /dev/sg11: 512 /dev/sg12: 512 /dev/sg13: 512 /dev/sg14: 512 /dev/sg15: 512 /dev/sg16: 512 /dev/sg17: 512 /dev/sg18: 512 /dev/sg19: 512 /dev/sg2: 512 /dev/sg20: 512 /dev/sg21: 512 /dev/sg22: /dev/sg23: /dev/sg3: 512 /dev/sg4: 512 /dev/sg5: 512 /dev/sg6: 512 /dev/sg7: 512 /dev/sg8: 512 /dev/sg9: 512 List the servers power status and try and turn the power off. 1 2 3 4 admin1-> racadm serveraction powerstatus Server power status: ON admin1-> racadm serveraction powerdown ERROR: Timeout while waiting for server to perform requested power action. If you happen to have 3rd party fans inside the system, you may get the above reaction.
...