More in Networking
Time every phase of an HTTP request
Networking
Splits DNS, connect, TLS and first byte apart, which tells you which one is actually slow.
Inspect a TLS certificate from the command line
Networking
Prints the subject, issuer and validity dates without opening a browser.
Call a JSON API from PowerShell
Networking
Invoke-RestMethod parses the response for you, so no ConvertFrom-Json step is needed.
Which DNS records does a domain have?
Networking
dig with +short strips everything but the answer.
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.
Random picks
Merge dictionaries
Python
The | operator returns a new dict; |= updates in place. Later keys win in both.
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.
Check a file's checksum
Security
Verifies a download actually matches what the publisher signed, rather than trusting the transfer.
Relative time without a date library
JavaScript
Turns a timestamp into 'three days ago' using the built-in formatter.
Table sizes, largest first
Databases
Where the disk actually went, including indexes and TOAST.
Make some properties optional
TypeScript
Composes the built-in helpers rather than writing a second interface that will drift from the first.
Reset a Postgres sequence after a bulk import
Databases
Copying rows with explicit ids leaves the identity sequence behind, so the next insert collides with an existing row.
Parameterised tests in Python
Testing
One test body, many cases, and a failure that names the case that broke.