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.

~30 min
http · api · debugging · resilience

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.

~20 min
api · http · debugging

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.

~30 min
api · http2 · debugging

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.

~20 min
deploy · kubernetes · debugging

Debug Kubernetes DNS ndots Latency

Measure resolver latency caused by the ndots search path and reduce unnecessary DNS queries for external names.

~30 min
kubernetes · dns · performance

Debug Mutual TLS Handshake Failures

Use openssl s_client to verify the client certificate chain and cipher agreement when mutual TLS handshakes fail intermittently.

~35 min
tls · security · debugging

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.

~30 min
oauth · security · debugging

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.

~30 min
frontend · react · debugging

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.

~30 min
api · sse · resilience

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.

~25 min
testing · vitest · mocking

Debug Duplicate Webhook Deliveries

Correlate webhook delivery ids and timestamps to distinguish provider retries from duplicate events emitted by your own pipeline.

~30 min
webhook · api · idempotency

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.

~30 min
http · debugging · streaming

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.

~35 min
data · python · csv

Deduplicate Rows with Window Functions

Use row_number to keep the newest row per natural key and delete the rest without losing referential consistency.

~30 min
sql · database · data

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.

~35 min
frontend · performance · third-party

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.

~25 min
deploy · docker · ci

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.

~40 min
testing · performance · observability

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.

~35 min
mysql · database · concurrency

Detect Outliers with the IQR Method

Flag statistical outliers using the interquartile range before they distort aggregates and model training.

~25 min
data · statistics · pandas

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.

~25 min
database · postgres · ci

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.

~35 min
api · resilience · debugging

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.

~25 min
api · nginx · observability

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.

~30 min
database · postgres · operations

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.

~25 min
sse · streaming · debugging

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.

~25 min
deploy · helm · kubernetes

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.

~30 min
api · openapi · contract-testing

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.

~30 min
deploy · operations · nginx

Validate Kubernetes Manifests with kubeconform

Validate manifests against the target server schema with kubeconform in CI before they reach the cluster.

~25 min
kubernetes · ops · validation

Enable auditd execve Rules

Add audit rules that record process execution on sensitive hosts so unexpected commands leave an auditable trail.

~30 min
security · linux · audit

Enable sudo Command Logging

Log every sudo invocation to syslog with the invoking user and command so privileged actions are auditable.

~25 min
security · linux · audit

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.

~25 min
security · secrets · git

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.

~35 min
testing · performance · ci

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.

~25 min
container · security · hardening

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.

~20 min
postgresql · database · data

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.

~45 min
api · graphql · performance

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.

~30 min
frontend · react · ssr