Skip to content

Instantly share code, notes, and snippets.

View Excalibaard's full-sized avatar

Bart Sluis Excalibaard

View GitHub Profile
@iamchriswick
iamchriswick / Fedora_42_with_Tiered_Btrfs_ZFS_Backups.md
Last active May 3, 2026 15:05
A Comprehensive Guide to Fedora 42 with Tiered Btrfs/ZFS Backups

Introduction

This guide provides a complete, end-to-end walkthrough for setting up an advanced Fedora 42 Workstation. The goal is to create a highly resilient and performant system built on a custom Btrfs layout, featuring:

  • Automated Local Snapshots: Using Snapper for high-frequency, local snapshots of critical system and user subvolumes.
  • Bootable Rollbacks: Integrating grub-btrfs to allow booting directly into a previous system state from the GRUB menu, making system recovery trivial.
  • A 3-Tier Backup Strategy: A sophisticated, automated backup workflow that dispatches snapshots to different storage tiers based on retention requirements:
    • Tier 1 (Local SSD): Instant, high-frequency snapshots for immediate recovery.
    • Tier 2 (Dedicated Btrfs Drive): Short-term (hourly, daily) snapshot replication for rapid data access.
  • Tier 3 (ZFS Mirror): Long-term (weekly, monthly, yearly) archival on a resilient ZFS mirror for ultimate data integrity.
@GrayedFox
GrayedFox / git-glean
Last active July 3, 2025 01:42
Remove local branches with a missing (gone) upstream
#!/usr/bin/env bash
# first we prune origin to ensure our local list of remote branches is up to date
git remote prune origin
GONE_BRANCHES=$(git branch -vv | grep 'origin/.*: gone]' | awk '{print $1}')
if [ -z "$GONE_BRANCHES" ]; then
echo "Could not find any local branches that have a gone remote"
exit 0