Lynxbee topic

Linux

Safely Rename Parts of Filenames and File Content

Renaming `memory_map.c` to `memory_mapping.c` and changing identifiers inside source files are separate operations. This guide previews both, handles unusual filenames, refuses collisions, keeps backups, and makes rollback practical.

Fix “No Address Associated with Hostname” on Linux

The error means the resolver could not return a usable address for the requested name and address family. Diagnose the same NSS path the application uses before editing `/etc/hosts`, changing DNS, or flushing caches.

Connect to an Amazon EC2 Linux Instance with SSH

Connect to an EC2 Linux instance without weakening its security: verify the instance and host key, protect the SSH private key, choose the correct AMI username and address, restrict ingress, and diagnose timeout versus authentication failures.

Monitor CPU, Memory, I/O and Processes on Linux

A high load average, low “free” memory, or busy disk is a clue—not a root cause. Use interval-based Linux tools to separate CPU saturation, memory reclaim, swap, storage latency, network load, process behavior, and cgroup pressure before restarting or killing anything.

Find Linux Disk Usage with ncdu Safely

ncdu turns a recursive disk-usage scan into a fast terminal browser, but its delete key deserves the same respect as `rm`. Start read-only, stay on the intended filesystem, export remote scans for offline analysis, and confirm why `df`, `du`, and ncdu may report different numbers.

Copy Files Between Linux Hosts with SSH

Use scp for a straightforward one-off copy, rsync over SSH for repeatable or resumable directory synchronization, SFTP for interactive/file-oriented workflows, and a tar stream for carefully controlled archive pipelines. The protocol encrypts transport; you still need host verification, least privilege, safe destination semantics, and end-to-end validation.

List Files Installed by a Linux Package

Use the package database for installed ownership, repository content indexes for packages not installed, and archive queries for downloaded DEB/RPM files. These inventories describe packaged paths—not every file created later by services, scripts, or users.

C atexit(): Cleanup on Normal Termination, Not Every Exit

`atexit()` registers no-argument callbacks for normal program termination. They run in reverse registration order after `main` returns or `exit()` is called—but not after `_Exit()`, `_exit()`, `abort()`, an unhandled fatal signal, a crash, or a forced kill.

Fix “sudo: unable to resolve host” on Ubuntu

This warning usually means the machine’s active hostname no longer resolves through its configured Name Service Switch sources. Diagnose the exact name first, correct `/etc/hosts` or hostname configuration safely, and verify through `getent` before changing DNS.

Shuffle Music from the Ubuntu Command Line

For a trusted local music folder, mpv can recurse and shuffle it directly. This article also preserves the MPlayer workflow, fixes fragile filename handling, shows reusable playlists, and explains playback controls and audio troubleshooting.

Explore a Running Linux Process Through /proc

Linux procfs exposes a live, file-like view of process state without creating ordinary files on disk. This lab starts a harmless C process, captures its PID, inspects the useful `/proc/PID` entries, and cleans up reliably.

How C Code Becomes a Running Linux Process

A single GCC command hides several distinct transformations, followed later by Linux process startup. Saving each intermediate file makes macros, assembly, ELF objects, linking, and dynamic loading much easier to reason about.

setup_irq vs request_irq in Modern Linux

setup_irq belongs to historical early-platform code. Current device drivers should register handlers with request_irq, request_threaded_irq, or a device-managed wrapper.

WiFi monitor mode and commands to enforce monitor mode in Linux / Ubuntu

Monitor mode, or RFMON (Radio Frequency MONitor) mode, allows a computer with a wireless network interface controller (WNIC) to monitor all traffic received from the wireless network. Monitor mode allows packets to be captured without having to associate with an access point or ad hoc network first.

Engineering weekly

Useful technical knowledge, not inbox noise.

Receive verified fixes, references, labs, and tools. Confirm by email; unsubscribe any time.