Posts for: #Command-Line

Monitoring File Handles with 1975 Technology

Monitoring File Handles with 1975 Technology

Your process is leaking file handles. You need to track which processes are consuming handles over time, spot anomalies, and correlate with system behavior. Modern observability platforms want you to install 200MB Docker images, connect to cloud services, and pay subscription fees.

Or you could use six shell scripts totaling 150 lines.

The Tools

collect - Sample file handle counts every 5 minutes avg - Calculate statistics (count, average, min, max) graph - ASCII chart of handle counts over time spikes - Find anomalies (2x average or custom threshold) top - Show processes by handle consumption timeline - Aggregate by time buckets (hourly, daily)

[Read more]

direnv: Tree-Based Environment State for Your Terminal

direnv: Tree-Based Environment State for Your Terminal

Every project needs different environment variables. GitHub credentials for personal projects. GitHub Enterprise for work. Different AWS profiles. Different API keys. Different Node.js versions.

The traditional approach: manually export variables, or source project-specific shell scripts, or maintain complex .zshrc configurations that load everything globally.

direnv automates this. Drop a .envrc file in any directory. direnv loads it when you cd in, unloads it when you cd out. Tree-based: child directories inherit parent .envrc settings. Works with any shell.

[Read more]