AI & prompting
How language models work, writing prompts, tokens, context windows and running models locally.
- How Many Tokens Is a Word? Tokens Explained with Real Counts
A token is a chunk of text, often a word or part of one. See real token counts for English, other languages and code, and why counts differ between models. - How Much VRAM Do You Need to Run an LLM Locally? (With the Math)
VRAM needed = parameters × bits per weight ÷ 8, plus KV cache and runtime overhead. A table for 8B to 70B models at FP16, 8-bit and 4-bit, with worked examples. - How to Reduce AI Token Usage: 8 Levers and Their Trade-offs
Cut LLM token costs by trimming context, summarising chat history, prompt caching, smaller models, output limits and batching. How each works, and what it costs you. - How to Run an LLM Locally with Ollama (Windows, macOS, Linux)
Install Ollama, then run a model with one command: ollama run gemma4. Install steps per OS, pull, list and ps commands, picking a model size, and the local API. - How to Write a Good AI Prompt (With Before and After Examples)
A good prompt states the task, context, constraints and output format, and shows an example. Four before/after prompts based on OpenAI and Anthropic guides. - System Prompt vs User Prompt: Roles in Chat APIs Explained
The system (or developer) prompt sets the app's standing rules; user messages carry each request. What goes where, with request JSON for OpenAI and Claude. - Temperature and Top-p Explained: What LLM Sampling Settings Do
Temperature reshapes next-token probabilities; top-p cuts off unlikely tokens. Worked numbers, each API's ranges, and why newer Claude and Gemini models drop them. - What Is a Context Window? Limits, Overflow and Long-Context Costs
A context window is the maximum number of tokens a model can handle in one request, input and output together. What happens when you exceed it, and why it matters. - What Is LLM Quantization? GGUF, Q4_K_M and Q8_0 Explained
Quantization stores model weights in fewer bits so an LLM fits in less memory. What GGUF is, what Q8_0, Q6_K and Q4_K_M mean, and how much quality each costs. - Why AI Hallucinates, and 7 Ways to Reduce It
AI models give confident wrong answers because training and testing reward guessing. Practical fixes: give sources, allow "I don't know", require quotes, verify.
Coding
Git, Python, JavaScript, APIs and the errors developers hit every day.
- CORS Error Explained: "Blocked by CORS Policy" and How to Fix It
What 'has been blocked by CORS policy: No Access-Control-Allow-Origin header' means, how preflight requests work, and the server headers that fix it for real. - Fix "[email protected]: Permission denied (publickey)"
Fix GitHub's 'Permission denied (publickey)': test with ssh -T, read ssh -vT output, load your key into the agent, check it's on your account, or use HTTPS. - Fix pip "error: externally-managed-environment" (PEP 668)
Why pip says 'externally-managed-environment' on Linux and Homebrew, and the real fixes: a venv, pipx or the distro package, not --break-system-packages. - How to Fix "Port Already in Use" (Windows, macOS, Linux)
Find which process holds a port and free it: netstat, Get-NetTCPConnection, lsof and ss commands, plus what EADDRINUSE and WinError 10048 actually mean. - Git "Detached HEAD" State: What It Means and How to Fix It
Detached HEAD means Git has checked out a commit, not a branch. Why it happens, how to keep commits made there with git switch -c, and how to get back to a branch. - Git Merge vs Rebase: What Each Does to Your History
Merge keeps history as it happened with a merge commit; rebase replays your commits for a straight line. Commit graphs, when to use each, and git pull --rebase. - How to Undo the Last Git Commit (reset, amend, revert)
Undo your last Git commit with git reset --soft, --mixed or --hard, fix it with --amend, or use git revert when the commit is already pushed to a shared branch. - How to Read a Stack Trace (Python Traceback and Node.js)
Read a Python traceback from the bottom up and a Node.js stack trace from the top down, find the first frame in your code, and tell your code from library frames. - HTTP Status Codes Explained: The Ones You Actually See
What 200, 201, 204, 301, 302, 304, 400, 401, 403, 404, 405, 409, 422, 429, 500, 502, 503 and 504 mean, plus 401 vs 403 and 502 vs 504, from RFC 9110. - JSON vs YAML vs TOML: Same Config, Three Formats Compared
One config file in JSON, YAML and TOML, with the gotchas that bite: YAML's Norway problem and indentation, TOML tables, JSON's lack of comments. When to pick each. - Python Virtual Environments (venv): Create, Activate, Use
Create a Python venv, activate it in Windows cmd, PowerShell (including the execution policy error), macOS and Linux, save requirements.txt, and keep it out of Git.
Software & OS
Windows, macOS and Linux tasks: files, permissions, environment variables, SSH, containers.
- Docker vs Virtual Machine: What's the Difference?
Containers share the host's kernel; virtual machines run a whole OS with their own kernel. How that changes isolation, size and startup, and when to use each. - How to Find Large Files on Windows, macOS and Linux
Built-in ways to find what is filling your disk: Windows Storage settings and size: search, PowerShell, macOS Storage, and du, find and ncdu on Linux. - How to Flush the DNS Cache on Windows, macOS and Linux
Clear the DNS cache with ipconfig /flushdns on Windows, killall -HUP mDNSResponder on macOS and resolvectl flush-caches on Linux, plus browser caches. - How to Force Quit a Frozen Program (Windows, macOS, Linux)
Close a frozen app with Task Manager or taskkill on Windows, Option+Command+Esc or kill on macOS, and pkill, xkill or kill -9 on Linux, and why SIGTERM comes first. - How to Generate an SSH Key (Ed25519) on Windows, macOS and Linux
Create an Ed25519 SSH key with ssh-keygen, protect it with a passphrase, load it into ssh-agent, and copy the public key to a server or GitHub, per OS. - How to Install WSL on Windows 10 and 11
Install WSL with one command, pick a Linux distro, check WSL 1 vs 2 with wsl -l -v, move files between Windows and Linux, and fix the virtualization error. - Linux File Permissions and chmod Explained (755, 644, 600)
What rwx and owner, group and others mean, how octal modes like 755, 644 and 600 add up, how to read ls -l, and how chmod u+x and chown change them. - How to Set Environment Variables on Windows, macOS and Linux
Set an environment variable for one session or permanently: set, $env: and setx on Windows, export and ~/.zshrc or ~/.bashrc on macOS and Linux, plus PATH. - How to Zip and Unzip Files from the Command Line
Zip and unzip from the terminal: Compress-Archive and tar on Windows, zip, unzip and tar -czf on macOS and Linux, listing contents, and why zip passwords are weak.
Hardware
Storage, memory, CPUs, GPUs, ports and keeping a computer healthy.
- How to Check CPU and GPU Temperature (Windows, macOS, Linux)
Built-in ways to read CPU and GPU temperature: Task Manager, nvidia-smi, lm-sensors and powermetrics, plus what Tjunction max means and how thermal throttling works. - How to Check SSD Health: smartctl, PowerShell and Windows Settings
Read your SSD's own health data: smartctl -a, Get-StorageReliabilityCounter, the Windows drive health page, and what Percentage Used and Available Spare mean. - How Much RAM Do I Need? Measure It Instead of Guessing
Work out how much RAM you need from what you actually run: OS minimums, how to read Task Manager, Activity Monitor memory pressure and free -h, plus dual-channel. - SSD vs HDD vs NVMe: What the Difference Actually Is
SATA SSD, NVMe SSD or hard drive? Interface speed limits (SATA 6 Gb/s vs PCIe x4), M.2 SATA vs M.2 NVMe, TBW endurance, and when an HDD is still the right buy. - USB-C vs Thunderbolt: Connector, Speed and Power Explained
USB-C is a connector shape, not a speed. What USB 5/10/20/40/80Gbps mean, how Thunderbolt 3, 4 and 5 differ, cable wattage, and how to tell what a port does.
Networking
IP addresses, DNS, TCP/UDP, Wi-Fi and how data actually moves.
- How DNS Works: From Root Servers to an IP Address, Step by Step
Follow a real DNS lookup with nslookup: resolver, root, .com and authoritative servers, the A, AAAA, CNAME, MX, TXT and NS record types, and how TTL caching works. - Public vs Private IP Address: Ranges, NAT and How to Find Yours
The exact private IPv4 ranges (RFC 1918), how NAT and CGNAT share a public address, what 127.x and 169.254.x mean, and how to find yours on any OS. - TCP vs UDP: Differences, Header Sizes and What Uses Which
TCP sets up a connection and guarantees ordered delivery; UDP sends datagrams with no guarantees. Handshake, 20 vs 8 byte headers, and why HTTP/3 and DNS use UDP.
Security
Passwords, two-factor authentication, encryption and public-key cryptography in plain terms.
- How 2FA Codes Work: TOTP, HOTP and HMAC Explained
How authenticator apps make 6-digit codes: a shared secret, 30-second time steps, HMAC-SHA-1 and truncation (RFC 6238), plus official test vectors to check. - Public-Key Cryptography Explained, With a Toy RSA Example
How key pairs work, the difference between encrypting and signing, and a small RSA example you can check by hand. Plus where it's used: TLS, SSH and signed software.