Quick guide on configuring rustup target add aarch64-unknown-linux-gnu and setting up linkers. Covers both native and cross-compilation workflows with Cargo. Also includes notes on using cross tool from cross-rs for Docker-based builds.
Collection of EXPLAIN ANALYZE patterns and index strategies that improved our API response times from 200ms to under 15ms. Key takeaway: partial indexes on filtered columns made the biggest difference. Also covers pg_stat_statements for finding slow queries.
Minimal Dockerfiles for Go, Rust and Node.js services. Final images under 20MB using scratch and alpine bases. Includes a comparison table of image sizes and build times across different strategies. See also the official Docker docs.
Configuration snippets for proxying WebSocket connections through nginx, including timeout tuning and proxy_set_header Upgrade forwarding. Solved the annoying 60s disconnect issue with proxy_read_timeout 3600s.
Notes on blocking the Tokio runtime with CPU-heavy work, why spawn_blocking exists, and how select! cancellation works. Spent two days debugging a deadlock that turned out to be a std::sync::Mutex held across an .await point. Use tokio::sync::Mutex instead.
Cheatsheet for local/remote/dynamic port forwarding with ssh -L, ssh -R, and ssh -D. Includes a ProxyJump setup for accessing services behind a bastion host without exposing them to the internet.
Setup guide for exposing /metrics endpoint from rust-prometheus and building Grafana dashboards. Covers histogram buckets for latency tracking, counter vs gauge usage, and alerting on error rate spikes via Alertmanager.
Automated cert renewal using Certbot with nginx plugin. Includes systemd timer setup for auto-renewal and testing with --dry-run. Also notes on wildcard certs via DNS-01 challenge with Cloudflare API.
Cache-aside, write-through, and write-behind patterns implemented with redis-rs. Key insight: use SETEX with TTL instead of manual expiry. Reduced database load by 70% on our heaviest endpoint. Also covers cache invalidation strategies — still the hardest problem in CS.
Template for running Rust services as systemd units with proper Restart=on-failure, logging to journald, and resource limits. Includes hardening options: ProtectSystem=strict, NoNewPrivileges=true, PrivateTmp=true.