Skip to content

Instantly share code, notes, and snippets.

View tuxx's full-sized avatar

Tuxx tuxx

  • Netherlands
View GitHub Profile
#!/bin/bash
# vm-backup.sh — Automated VM backup with virtnbdbackup + direct-to-NFS output + summary
set -euo pipefail
# === CONFIG ===
readonly BACKUP_DIR="/mnt/nfsbackup"
DOMAINS=($(virsh list --name --all | grep -v '^$'))
readonly VIRTNBDBACKUP_BIN="/usr/bin/virtnbdbackup"
@tuxx
tuxx / gh_release_stats.py
Created April 3, 2025 22:10
Github release downloads statistics
import requests
import os
# --------- CONFIGURE THIS ---------
GITHUB_OWNER = "your-username-or-org"
GITHUB_REPO = "your-repo"
GITHUB_TOKEN = os.getenv("GITHUB_TOKEN")
# ----------------------------------
headers = {}
@tuxx
tuxx / hyprland_windowrule_fix.py
Last active April 13, 2025 12:07
Hyprland 0.48 windowrule config fix
import re
def update_hyprland_config(config_path):
with open(config_path, 'r') as file:
lines = file.readlines()
updated_lines = []
for line in lines:
# Convert 'windowrule' to 'windowrulev2' with updated syntax
match = re.match(r'^\s*windowrule\s*=\s*([^,]+),\s*(.+)$', line)
@tuxx
tuxx / cleanup_music_folder.sh
Created February 14, 2025 23:28
My music folder has alot of random files i do not want. This script cleans up my music folder, but ignores any music files and cover.jpg files. Use at your own risk ;-)
#!/bin/bash
# Define a list of music file extensions to ignore
IGNORE_EXTENSIONS=("mp3" "flac" "wav" "ogg" "m4a" "aac" "opus" "wma")
# Create a pattern for grep to filter out music files
IGNORE_PATTERN=$(printf "|%s" "${IGNORE_EXTENSIONS[@]}")
IGNORE_PATTERN="${IGNORE_PATTERN:1}" # Remove leading |
# Get the script name