More in Containers
Find what is taking up space in an image
Containers
Prints the size each layer adds, which usually points straight at the offending RUN line.
Compose file with a healthcheck and dependency order
Containers
Makes the app wait until Postgres actually answers, not merely until its container has started.
Shell into a running container
Containers
Falls back to sh, since slim images often have no bash.
Multi-stage Dockerfile for a Node service
Containers
Builds with the full toolchain, ships only production dependencies, and runs as a non-root user.
Random picks
Worker pool with a wait group in Go
Systems
Fixed number of goroutines draining a channel, with the group ensuring main waits for all of them.
Parameterised tests in Python
Testing
One test body, many cases, and a failure that names the case that broke.
Read a large file without loading it into memory
Python
Iterating a file object yields one line at a time, which is the difference between a constant footprint and an OOM.
Show which process is holding a port
Shell
Answers 'address already in use' without guessing.
Which DNS records does a domain have?
Networking
dig with +short strips everything but the answer.
Serve the current directory over HTTP
Shell
Three ways to put a folder on localhost when you need to test something quickly.
Find the largest files with PowerShell
Shell
The Windows counterpart to du | sort | head.
Group rows into a JSON array
Databases
Returns one row per author with their posts nested, instead of a join that repeats the author on every row.