Accidentally running rm -rf ~/Documents or letting a rogue script wipe your entire home directory is a nightmare that can happen to anyone. If your root filesystem sits on Btrfs, you can usually recover almost instantly by leveraging snapshots. This post walks through the steps you need to take—from setting up snapshots before you delete anything to restoring the lost data—and discusses the trade‑offs and pitfalls you should watch out for.
Welcome to the Café
Explore the world of Linux with clear, approachable guides. Whether you’re just starting out or looking to sharpen your skills, you’ll find something to brew your interest here.
Deploy Traefik to Route Home NAS and Pi‑Hole Without Self‑Signed Certs
Why Traefik is a Good Fit for Home NAS and Pi‑Hole
If you’re already running a NAS (Synology, QNAP, or a DIY Raspberry Pi) and a Pi‑Hole instance, you’re probably exposing them through a static IP or a dynamic‑DNS service. The easiest way to add HTTPS without juggling self‑signed certs is to let Traefik be the reverse proxy and hand off certificate acquisition to Let’s Encrypt automatically. Traefik is lightweight, runs in a container, and can be configured with a single YAML file. Below is a step‑by‑step guide that shows how to set it up on a Raspberry Pi running Raspberry OS (Debian‑based) and how to route traffic to both services while keeping the configuration simple.
[Read More]Using jq to extract a single field from nested JSON logs
Extracting a Single Field from Nested JSON Logs with jq
Running a homelab or a tiny self‑hosted service usually means dealing with JSON‑encoded logs. Whether it’s systemd‑journal, docker logs, or a custom app, the output is often a tidy JSON object per line. The catch? Those objects are usually nested, and if you only care about one value—like the HTTP status code or a user ID—you’ll waste a lot of time sifting through the whole file. That’s where jq steps in.
[Read More]Preventing /tmp from Over‑filling: a quick Ubuntu desktop fix
Why /tmp can become a silent disk‑drainer
On an Ubuntu desktop /tmp is just another folder on the root partition.
Every app that needs a scratch pad drops files there, and most of the time it’s fine—just a few megabytes.
But if a program starts spitting out large temporary data (think big builds, video editors, or a runaway installer) and never cleans up, that folder can gobble up the whole root filesystem.
A full root partition means apps crash, new files can’t be created, and worst of all you might find yourself locked out of the login screen.
How to Stop a Log File from Filling Your SSD in 5 Minutes
The problem
On a fresh SSD a single log file can grow fast enough to fill the drive in minutes.
Typical culprits are:
- Systemd journal when
systemd-journaldis left to write to/var/log/journal/without limits. - Application logs that never rotate, e.g.
nginx,docker,postgres, or custom scripts. - Debug or verbose modes that are left enabled in production.
When the disk is full, services stop, new writes fail, and the machine can become unresponsive. Below is a hands‑on guide that shows how to stop a log file from filling an SSD in 5 minutes, using tools that are already part of most distributions.
[Read More]When nftables silently drops your local web server: a step‑by‑step debug
If a browser on the same machine can’t reach http://localhost:8080 but curl from another host works, the culprit is often nftables. Unlike iptables, nftables doesn’t log dropped packets by default, so you may not see any trace in /var/log/syslog. Below is a concise, hands‑on checklist that will help you locate the invisible rule that’s blocking local traffic.
1. Verify the service is listening
sudo ss -tulpn | grep 8080
You should see something like:
[Read More]Running a FreeNAS Backup Server with rsync and Snapshots on a Raspberry Pi 4
Running a FreeNAS‑style Backup Server with rsync and Snapshots on a Raspberry Pi 4
If you’ve ever wanted a tiny, energy‑efficient NAS that still gives you snapshots and incremental sync, the Pi 4 is a solid choice. I’ve set up a few of these in my own home lab, and they’re surprisingly robust. Below is the walk‑through I use, with a few practical tweaks that keep things running smoothly.
Why this stack?
- rsync is the workhorse for incremental copies; it’s built into almost every distro and keeps permissions, timestamps, and ownership intact.
- btrfs (or ZFS‑on‑Linux if you’re adventurous) gives you instant, copy‑on‑write snapshots that are cheap in space and fast to roll back.
- The Pi 4’s 4 GB RAM and single‑GbE port are plenty for a handful of clients and a few hundred gigabytes of data.
- All tools are free, and the Pi can run headless – SSH is all you need, but if you’re a GUI fan, Webmin or Cockpit is an option.
Hardware checklist
| Item | Minimum | Recommendation |
|---|---|---|
| Raspberry Pi | 4 B (any revision) | 4 B + USB‑3.0 HAT |
| Storage | 1 TB HDD/SSD (USB‑3.0) | 2 TB SSD for speed |
| Power | 5 V 3 A | 5 V 3 A USB‑C |
| Network | 1 GbE | 1 GbE or 2.5 GbE via USB‑3.0 HAT |
A USB‑3.0 HAT gives you a real 5 Gbps link to your drives, which keeps rsync throughput high. I’ve seen the Pi choke on 100 Mbps when you only use the on‑board Ethernet.
[Read More]Rootless Podman: How I Got My Home Directory Synced to a Container Volume
Why a Rootless Podman Volume for Your Home Directory?
Running services inside containers is a staple of most homelab setups. When you use Podman in rootless mode you keep the container runtime isolated from the host’s privileged space, which is great for security and for users who don’t have root access. A frequent pain point is that the container’s filesystem is isolated from your personal files. If you want a container to read or write your documents, photos, or configuration files, you need a way to expose a part of your home directory to the container. This post walks through a reliable method to mount a subdirectory of ~/ into a rootless Podman container, covering the trade‑offs, pitfalls, and a few tricks that make the setup robust.
Setting up a Home NAS with Docker, NFS, and SMB – A Hands‑On Guide
Why a Docker‑Based Home NAS?
If you’re looking to turn a spare PC, a Raspberry Pi, or an old laptop into a file server that talks to Windows, macOS, and Linux, Docker is a great way to keep the host clean. You can drop in or pull out services without messing with the kernel, and you still get the familiar NFS/SMB combo that covers every client. Below is a walk‑through that sticks to Debian 12 or Ubuntu 24.04, but the same ideas work on any distro with systemd and Docker.
[Read More]Running a Rootless Podman Web App with Persistent Volumes on Ubuntu
Ubuntu 24.04 LTS ships with Podman 4.8 straight from the official repos, which makes it a solid choice for a lightweight, root‑less container runtime. Rootless mode means you never have to type sudo, and the container stays inside your own user namespace – a big win for home labs and self‑hosted services.
Below is a step‑by‑step walk‑through that pulls the popular Ghost blogging platform, runs it in rootless Podman, and keeps its data in a bind mount. The same pattern works for any stateless or stateful web service you want to host.
[Read More]