Recipes
Step-by-step solutions for real development tasks.
699 published
Page 11 of 20
Debug HTTP 503 with Retry-After Backoff
Reproduce a 503 response, read the Retry-After header, and prove a client backoff schedule respects server guidance under load.
Debug a 406 Not Acceptable with curl Header Experiments
Bisect the Accept header piece by piece to find exactly which media type the server rejects, then fix the negotiation on the correct side.
Debug HTTP/2 Stream Resets and Mysterious Failed Requests
Reproduce intermittent HTTP/2 RST_STREAM errors with nghttp, read the error code, and fix the framing or intermediary that resets streams silently.
Debug a CrashLoopBackOff in Ten Minutes
Read previous container logs, exit codes, and event messages to classify the crash cause, then fix the right layer instead of restarting harder.
Debug Kubernetes DNS ndots Latency
Measure resolver latency caused by the ndots search path and reduce unnecessary DNS queries for external names.
Debug Mutual TLS Handshake Failures
Use openssl s_client to verify the client certificate chain and cipher agreement when mutual TLS handshakes fail intermittently.
Debug OAuth Token Clock Skew
Compare token issued-at, not-before, and expiry against server clocks to prove intermittent 401s come from time drift, not bad tokens.
Diagnose an Infinite Rerender Loop in React
Identify which component re-mounts or re-renders endlessly, trace the state update that fuels the loop, and break the cycle at the dependency.
Debug an SSE Reconnect Storm on the Server Side
Recognize the signature of every EventSource client reconnecting at once, add heartbeat frames, and fix client backoff so idle proxies stop amplifying drops.
Debug vi.mock Hoisting Surprises in Vitest
Understand why vi.mock runs before your imports, why factory closures capture stale variables, and how to reference live values correctly.
Debug Duplicate Webhook Deliveries
Correlate webhook delivery ids and timestamps to distinguish provider retries from duplicate events emitted by your own pipeline.
Decode Chunked Transfer Encoding Errors
Parse malformed chunked bodies frame by frame to pinpoint a broken chunk size or missing terminator in a streaming response.
Deduplicate a Large CSV with a Hash Index
Remove duplicate rows from a huge CSV using an in-memory hash set of key hashes so it runs in a single streaming pass.
Deduplicate Rows with Window Functions
Use row_number to keep the newest row per natural key and delete the rest without losing referential consistency.
Defer Third-Party Scripts Without Breaking Their Features
Audit what each external script costs on the critical path, load analytics and widgets post-interaction, and verify events still arrive.
Deploy Pinned Artifacts by Digest, Not by Tag
Pin container images and packages by content digest, record the exact deployed artifact in metadata, and make tag drift impossible to ship.
Detect Memory Leaks with a Soak Test
Drive repeated workload cycles for hours, plot heap against cycle count, and distinguish a leak from a plateau before blaming the runtime.
Detect MySQL Lock Wait and Deadlock Patterns
Read InnoDB lock-wait and deadlock diagnostics to find the transaction that always grabs locks in the opposite order.
Detect Outliers with the IQR Method
Flag statistical outliers using the interquartile range before they distort aggregates and model training.
Detect Schema Drift Between Environments with migra
Compare two live Postgres schemas with migra, review the generated SQL diff, and push the drift back into versioned migrations.
Diagnose API Requests That Hang Forever
Spot requests stuck without timeouts, count half-open connections, find the dependency with no deadline, and add end-to-end request deadlines.
Diagnose HTTP 499 Client Aborts in nginx Logs
Find 499 entries in nginx access logs, correlate them with upstream response times, and decide whether clients time out too early or the server is too slow.
Diagnose Connection Pool Exhaustion with PgBouncer
Distinguish pool exhaustion from database overload, read PgBouncer stats to find the thief, and size the pool to the database instead of to peak fear.
Diagnose SSE Heartbeat Timeout Disconnects
Measure server-sent event heartbeat intervals against proxy idle timeouts to stop long-lived streams from being cut mid-flight.
Diff Rendered Helm Manifests Before Applying Them
Render charts locally with helm template, diff against the cluster live state, and review the exact YAML that will change before it changes.
Diff a Live API Response Against Its OpenAPI Spec
Capture a real response, validate every field against the published OpenAPI schema, and list exact mismatches before clients discover them by breaking.
Drain Traffic Before Maintenance and Restore It Safely
Use load balancer draining with health-check flip, watch in-flight requests complete, and restore traffic in stages with a rollback exit.
Validate Kubernetes Manifests with kubeconform
Validate manifests against the target server schema with kubeconform in CI before they reach the cluster.
Enable auditd execve Rules
Add audit rules that record process execution on sensitive hosts so unexpected commands leave an auditable trail.
Enable sudo Command Logging
Log every sudo invocation to syslog with the invoking user and command so privileged actions are auditable.
Encrypt Secrets in Git with SOPS and age
Store encrypted secrets beside your configs with SOPS and age, keep decryption keys outside the repo, and rotate without re encrypting everything.
Enforce an API Latency Budget as a CI Gate with k6
Encode percentile thresholds in a k6 scenario, run it against a staged build in CI, and fail the merge when p95 or error rate breaches budget.
Enforce a Non-Root Container User
Set a numeric non-root user and group in the image so a container escape does not start with root privileges.
Export a Large Table to CSV Fast
Use COPY TO with a server-side file or stdout stream to export large tables far faster than row-by-row SELECT.
Fix an N+1 Query Problem in a GraphQL Resolver
Detect N+1 resolver queries with request-scoped query logging, batch them with DataLoader, and prove the query count drops from 1+N to exactly 2.
Fix React Hydration Mismatches at the Source
Read the exact server-versus-client diff, find the nondeterministic render input, and isolate it with suppressHydrationWarning only as a last resort.