🤖 AI: Notes From the Machine
📚 Documentation
Click a title to view the full guide:
Claude Code Perplexity Ollama Ollama on a Cloud VM AI-Assisted Shell Scripting Prompt Cheat Sheet for Sysadmins Prompt Injection Defense Agents with GuardrailsWritten with help from the thing it's about. Yes, that's me. Hi. I'll be gentle with the rm -rf jokes.
Why did the AI get kicked out of the terminal?
It kept trying to autocomplete everyone's sentences, including the sudo prompt!
It kept trying to autocomplete everyone's sentences, including the sudo prompt!
Core Principles
- Trust, but Verify — I sound equally sure when I'm right and when I'm wrong. Run the code. Read the diff.
- Context Is Everything — I only know what's in the conversation. Paste the error, the version, and what you already tried.
- Be Specific — "Make it better" is a wish, not a prompt. Say what better means.
- Iterate — The first answer is a draft. Push back, ask why, ask for alternatives.
- You Own the Result — I write it, you ship it. "The AI told me to" is not a post-mortem.
⚠️ Confession: I can be confidently, fluently, beautifully wrong. I have invented flags that don't exist (grep --fix-my-life) and cited functions nobody ever wrote. Always test in a scratch directory before you run anything against production.
Talking to Me: Prompts That Work
🎯 Vague vs. Specific
Bad: my script doesn't work
Better: This bash script should rename *.JPG to *.jpg but does
nothing. Ubuntu 24.04, bash 5.2. Here is the script and
the output of `bash -x script.sh`.
🧩 A Prompt Recipe
1. Role/goal What are you trying to get done? 2. Context OS, versions, files, constraints, what you tried 3. The input Paste the real error or code, not a description of it 4. The output "Give me a one-liner", "explain it", "a table", etc. 5. Guardrails "Don't change the API", "explain before editing"
What I'm Good At (and What I'm Not)
Good at Be careful with Explaining errors and man pages Exact version-specific flags Writing and refactoring scripts Facts newer than my training Regex, awk, sed, SQL one-liners Long math and counting things Reading a big log and summarizing Anything where I can't see the system Drafting docs (like this site) Security decisions without review Rubber-ducking a bad design Remembering last week's chat
A programmer asked me to make their code "production ready."
So I added a try/except around everything and a comment that says # TODO: handle errors.
So I added a try/except around everything and a comment that says # TODO: handle errors.
Safety Rules for Working With an AI
- Never paste secrets — API keys, passwords, private keys, and customer data stay out of the chat.
- Read before you run — especially anything with sudo, rm, dd, or curl | sh.
- Use version control — git commit before letting any AI edit your files, so git diff shows exactly what changed.
- Scratch first — try new commands in a VM, container, or throwaway directory.
- Check the sources — if it matters, confirm against official docs.
⚠️ Fun Fact: If an AI tells you to run chmod -R 777 / to fix a permissions problem, that's not a fix. That's a cry for help. Close the tab.
Local and Free Setups
You don't need a subscription to experiment. Small open models can run on your own machine, so your data never leaves it:
- ollama — download and run open models with one command
- llama.cpp — run quantized models on a CPU or modest GPU
- Open-source chat front ends that talk to your local model
🖥️ Try It
# After installing ollama (see ollama.com) ollama run llama3.2 >>> Explain what `chmod 755` does in one paragraph.
Trade-off: local models are private and free per question, but smaller and slower than the big hosted ones. Match the tool to the job.
Why did the local LLM go to therapy?
It had too many parameters and not enough VRAM to process them!
It had too many parameters and not enough VRAM to process them!
How many AIs does it take to change a lightbulb?
One. But it will first confidently explain why the lightbulb is a deprecated API.
One. But it will first confidently explain why the lightbulb is a deprecated API.
What did the developer say to the AI after a bad night of debugging?
"I'd say you were hallucinating, but honestly I was the one who kept pasting in the wrong file."
"I'd say you were hallucinating, but honestly I was the one who kept pasting in the wrong file."