Safely Using find -delete on the Right Directory

Adding guardrails with maxdepth and mindepth

The “find … -delete” Catastrophe and How to Stop It

A single typo in a find command can wipe a production directory, a backup, or an entire filesystem. The classic recipe that trips even seasoned sysadmins is:

find / -name '*.tmp' -delete

If the leading slash is omitted or the pattern is too broad, the command starts at the wrong root and deletes everything that matches. In 2025, a handful of high‑profile incidents were traced back to this exact mistake, underscoring that defensive scripting is as much about guardrails as it is about automation.

[Read More]

Why my tmux status bar keeps flickering after a system update

Flickering isn’t just a visual nuisance; in a hardened environment it can hide real alerts, break scripts that poll the status line, or even leak timing info to an attacker. A recent upgrade that swapped in a new terminal renderer, patched a font, or tweaked an environment variable can push the status bar past the terminal’s refresh limits. Below is a practical, step‑by‑step walk‑through that covers the usual suspects, fixes you can apply immediately, and how to keep the bar steady without opening new attack vectors.

[Read More]

Giving a Backup User Read-Only Access to /var/log

Using ACLs without granting sudo

ACLs for log‑only access

When you need a user to read system logs but you don’t want to give them sudo or pull them into a privileged group, POSIX ACLs are the cleanest way to do it.
They let you hand out read rights on a per‑file or per‑directory basis, and you can set defaults so that every new file inherits the same restrictions.

A backup account that pulls logs to an off‑site archive but never touches the live system is the classic case. ACLs keep the principle of least privilege intact while still letting the job run unattended.

[Read More]

Giving Group Write Access with ACLs

Managing /var/www/html without changing ownership

Why ACLs instead of changing ownership?

When a web server runs as www-data and the dev squad needs to touch files in /var/www/html, the quick fix is usually chgrp the directory and slap a write bit on the group. That swaps the group ownership, which can trip up services that expect the original group or automated deploy scripts that hard‑code the owner. ACLs let you hand out the right permissions without touching the classic ownership columns.

[Read More]