Posts

Build Your Own Coding Agent in Python (It Fixes Real Code — Behind an Approval Gate)

Image
Build your own coding agent — in one Python file, with three tools and one rule that makes it safe to use: it cannot change a single line of code until a human approves the change . In this tutorial we build the agent on the Gemini API's function-calling loop, point it at a real project with a real failing test, and watch it find the bug, propose the fix, stop at the approval gate, and — only after a yes — apply it and prove the suite green. Then it prints its own bill. Every step has its own real screenshot, taken from the run you are reading about. Versions used in this tutorial Python 3.12 google-genai 3.0.0 (the Gemini SDK, pinned) and pytest 9.2.0 (pinned) Model: gemini-3.8-flash — rate card verified on Google's official pricing page on 2026-11-07: $0.75 per 1M input tokens, $3.75 per 1M output tokens (Standard tier, in effect through Dec 31, 2026); a free tier exists Companion code: topic-09-coding-agent in the Visual Studio Learn code repo Step 0 — Setup from zer...

Monitor a FastAPI App with Prometheus + Grafana (Metrics, Dashboards, Alerts)

Image
Your FastAPI app is slow, and you cannot see it. There is no graph of your traffic, no counter of your errors, and nothing that tells you which endpoint is the slow one. The first symptom is a user complaint — and by then you are debugging blind. In this tutorial you will fix that, end to end, on your own machine: instrument a FastAPI app so it publishes its own metrics, collect them with Prometheus, and build a Grafana dashboard that catches a slow endpoint live — then set an alert that fires when it happens again. Everything is local and free: no accounts, no API keys, no cloud. What we are using (pinned, so your install matches this post exactly): prometheus-fastapi-instrumentator 8.1.0 · Prometheus 3.16.0 · Grafana OSS 13.3.0 · FastAPI 0.162.4 · uvicorn 0.54.0 · Python 3.12. The complete companion code — the app, the Prometheus config, the load script, the exported dashboard JSON and the alert rule — is in the companion repository , folder topic-10-prometheus-grafana/ . S...

How Do I Backup and Restore a SQL Server Database in SSMS? (Step by Step, 2026)

Image
Back up a SQL Server database in SSMS to a .bak file, break it, then restore it back — that is this whole post, in that order. We take a full backup of the DemoDb database from the previous tutorial , delete a row and corrupt another one on purpose, then restore the backup over the damage and prove the data is back. After that we restore the same file a second time as a copy , side by side with the original. Every step has its own real screenshot, and the two restore failures we hit on the way — the ones you will hit too — are shown exactly as they appeared, with their fixes. Versions used in this tutorial SQL Server 2025 (17.x) — Enterprise Developer edition (free for development and testing), build 17.0.1000.7 SQL Server Management Studio 22.11.3 Demo database: DemoDb with the table dbo.DemoCustomers — the same database the previous post connected to Visual Studio The screenshots were captured on a Windows Server 2022 machine; the SSMS clicks are identical on Windows 10 and 1...