More in Networking
Which DNS records does a domain have?
Networking
dig with +short strips everything but the answer.
Follow redirects and show only the headers
Networking
Traces a redirect chain to its destination without downloading the body.
Time every phase of an HTTP request
Networking
Splits DNS, connect, TLS and first byte apart, which tells you which one is actually slow.
Open an SSH tunnel to a remote database
Networking
Forwards a local port through a bastion so a client can connect as if the database were local.
Call a JSON API from PowerShell
Networking
Invoke-RestMethod parses the response for you, so no ConvertFrom-Json step is needed.
Random picks
Find the largest files under a directory
Shell
Sorts everything beneath the working directory by real disk usage and shows the twenty worst offenders.
Prepared statement with PDO
PHP
Placeholders rather than interpolation. This is the whole of SQL injection defence in PHP.
Const assertion for a lookup table
TypeScript
`as const` keeps the literal types, so the derived union is the actual keys rather than string.
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.
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.
Iterate and collect in Rust
Systems
Filter and map fuse into a single pass; collect decides what comes out the other end.
A regular expression for ISO 8601 dates
Text Processing
Matches a date, optionally with a time and a zone. Deliberately strict about separators.
Shell into a running container
Containers
Falls back to sh, since slim images often have no bash.