More in Shell
Delete files older than thirty days
Shell
Prunes an archive directory without touching anything recent. Run it with -print first to see what would go.
Find the largest files with PowerShell
Shell
The Windows counterpart to du | sort | head.
Serve the current directory over HTTP
Shell
Three ways to put a folder on localhost when you need to test something quickly.
Tail a log and colour only what matters
Shell
Follows a growing file and highlights errors and warnings, leaving the rest readable but quiet.
Find the largest files under a directory
Shell
Sorts everything beneath the working directory by real disk usage and shows the twenty worst offenders.
Show which process is holding a port
Shell
Answers 'address already in use' without guessing.
Make a shell script fail loudly
Shell
The four lines that turn a script from 'carries on after an error' into 'stops at the first problem'.
Count lines of code by extension
Shell
A quick census of a repository without installing a tool for it.
Random picks
A README that people actually read
Data Formats
The order matters more than the length: what it is, how to run it, how to develop on it.
Check a file's checksum
Security
Verifies a download actually matches what the publisher signed, rather than trusting the transfer.
Cache busting with a content hash
Build & CI
Names the built file after its contents so a deploy invalidates the cache without a version bump.
Safe navigation and fetch in Ruby
Ruby
&. stops at nil; fetch raises rather than returning nil when a key is genuinely required.
Compose file with a healthcheck and dependency order
Containers
Makes the app wait until Postgres actually answers, not merely until its container has started.
YAML anchors to avoid repeating yourself
Data Formats
Define a block once, merge it into each service. Changing the base changes all of them.
Hash and verify a password in PHP
PHP
password_hash picks the algorithm and the salt. Never store anything a hash function can reverse.
Rename a batch of files with a pattern
Shell
Strips a prefix from every file in a directory using shell parameter expansion, no rename utility required.