Using journalctl to Track Down the Hidden ‘eth0’ Carrier Lost Messages That Cause Network Flaps After a Kernel Upgrade

When a kernel upgrade silently breaks your network

Kernel upgrades are usually painless, but on a few systems they can trigger a cascade of “carrier lost” messages that make the interface drop and come back up repeatedly. The messages are buried deep in the system journal, so you may not notice them until the network flaps start causing outages. This post shows how to locate those hidden messages with journalctl, correlate them with real‑world symptoms, and apply a fix that keeps the interface stable.

[Read More]

Rebuilding initramfs to exit emergency mode after a kernel update on Ubuntu 24.04

Rebuilding the initramfs is the most reliable way to escape an emergency shell after a kernel upgrade that leaves the system stuck in emergency mode.
The problem usually stems from a mismatch between the running kernel and the modules or hooks that the initramfs contains.
Below is a step‑by‑step guide that covers the common causes, the exact commands you’ll run, and the security‑aware trade‑offs you should keep in mind.


Why Emergency Mode Happens After a Kernel Update

When you install a new kernel on Ubuntu 24.04, GRUB points to the new image, but the initramfs that ships with it must contain:

[Read More]

How to Extract a Single File from a Borg Backup Archive Without Recreating the Entire Directory Tree

Extracting a Single File from a Borg Archive Without Recreating the Entire Directory Tree

When a backup archive grows to several terabytes, restoring a single configuration file or a database dump can feel like pulling a needle from a haystack. Borg’s default extract command rebuilds the whole directory tree, which is wasteful when you only need one file. The following guide shows how to pull a single file efficiently, keeps metadata intact, and keeps your system secure.

[Read More]

When chmod 2775 Turns Into a Security Hole: Fixing Setgid Misconfigurations on /srv/shared

Understanding the 2775 Permission Set

The octal mode 2775 is the go‑to for giving a directory shared write access while keeping new files in the same group.

  • 2 – set‑gid bit: new files inherit the directory’s group.
  • 7 – owner gets rwx.
  • 7 – group gets rwx.
  • 5 – others get r-x.

On a path like /srv/shared it looks tidy: any member of the group can drop files, and those files stay in the same group for later collaboration. The flip side? Group write is a double‑edged sword. If the group contains people you don’t fully trust, or if the directory is exposed to a wider audience, the set‑gid bit can become a vector for privilege escalation or accidental data exposure.

[Read More]

How I Stopped Debian from Installing KDE Plasma During a System Upgrade – A Practical APT Pinning Example

Why KDE Plasma Appeared During Upgrade

When Debian 12 “Bookworm” landed in early 2025, the default desktop stack for the desktop task was GNOME. A lot of folks, myself included, still had KDE Plasma sitting around from a previous release or a custom install. During a normal apt full-upgrade, the package manager pulls in the newest kde-plasma-desktop meta‑package because it’s part of the kde-standard task, which is automatically enabled by the tasksel configuration that ships with Debian. The result? A silent, automatic installation of a sizeable KDE stack even if you never intended to use it.

[Read More]

Fixing broken /etc/hosts entries after a Windows sync introduces stray CR characters

When a Windows machine syncs a shared folder that contains /etc/hosts, the file often ends up with Windows‑style CRLF line endings.

If you’ve ever pulled a hosts file from a Windows share, you’ve probably noticed that the resolver starts acting weird. The glibc resolver stops at the carriage return (\r) and treats the rest of the line as part of the hostname. That means lookups for localhost, myserver, or any entry that follows a stray CR fail, and some services silently fall back to DNS—exposing the system to name‑resolution attacks.

[Read More]

Why Your systemd Service Stays “activating” After a Kernel Upgrade – A Step‑by‑Step Fix​

Why a service can stay “activating” after a kernel upgrade

When you bump the kernel, systemd does a hard reset of almost everything.
If a unit you depend on never leaves the activating state, the rest of the boot can stall or the service simply never runs.
The usual suspect is a dependency on a kernel‑provided resource that is missing or delayed after the upgrade.

Below is a practical checklist that shows how to diagnose the issue, why it happens, and how to fix it without compromising security or stability.

[Read More]

Taming the DNS Resolver: Mastering resolvectl for Faster and More Reliable Internet Connections

Why systemd‑resolved matters

On most modern distros the DNS stack is no longer a simple /etc/resolv.conf.
systemd‑resolved runs in the background, pulls DNS servers from every interface, does caching, validates with DNSSEC, and even acts as a local DNS‑over‑TLS (DoT) proxy.
resolvectl (now systemd-resolve in newer releases) is the CLI that lets you look inside this stack and tweak it without hunting through config files.

If you run a home lab, self‑hosted services, or just want a snappier, more reliable lookup, mastering resolvectl can shave milliseconds off each query and give you a clear view of what the resolver is actually doing.

[Read More]

Taming Duplicate Entries in Your Bash History with a Simple Script

Introduction to Bash History

As a long-time Linux user, I’ve come to rely on the command line to get my work done. The Bash shell is an incredibly powerful tool, and one of its most useful features is its ability to store a history of previously executed commands. This history is stored in the ~/.bash_history file and can be accessed using the history command. However, as our systems see more use, the Bash history can become cluttered with duplicate entries, making it tough to find the commands we need.

[Read More]