🤖 AI: Notes From the Machine

📚 Documentation

Written 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!

Core Principles

⚠️ 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.

Safety Rules for Working With an AI

⚠️ 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:

🖥️ 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!
How many AIs does it take to change a lightbulb?
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."