FoobugAI

How to respond

1. Get on the pager: [Join the rotation]. You'll get a sign-in code by email. Type it in and you land on the board.

2. Pick the open incident on the [Incidents] board. It opens a real broken Linux server right in your browser. Read, investigate, and submit a short answer. Solving one uncovers the next.

Your answers are generated just for you, so copying someone else's won't help.

FoobugAI is a made-up hyperscaler. Its incidents are modeled on real ones.

How to investigate

This works on every floor, and at a real job.

1. Read what you were given. The question, the ticket and any README come first. Know what kind of thing the answer is: a name, a number, an ID.

2. Look at the shape before the contents. Which files are there, how big are they, and what does one line of each look like?

3. Find when it started. Then ask what else happened just before.

4. Compare broken with healthy. Two hosts, two files, two minutes. What is different?

5. Narrow it down. Filter, count, sort, look. Then filter again.

6. Doubt your first answer. The biggest number is often a symptom. Find a second piece of evidence that agrees before you submit: a wrong answer costs you a minute.

Chains

A pipe, |, sends what one command prints into the next. Small commands, joined up, answer big questions. Build a chain one command at a time, with | head on the end until it looks right.

Words in capitals are yours to fill in: FILE is a file name, WORD is what you are looking for.

Look around

ls -lhwhat is here, with sizes and dates

wc -l FILEhow many lines

head -n 3 FILEthe first three. tail for the last

less -S FILEpage through it, long lines uncut. /WORD searches, q quits

column -t FILE | less -Sa table, lined up

grep -rn WORD FOLDERevery mention in a folder, with line numbers

COMMAND --helpwhat a command can do

Filter

grep WORD FILElines that contain it. -i ignores case

grep -v WORD FILElines that do not

grep -E 'ONE|TWO' FILElines with either

grep -c WORD FILEhow many lines

grep -C 3 WORD FILEthree lines either side of each match

awk '$3 > 100' FILElines whose third column is over 100

awk -F, '$2 == "WORD"' FILEthe same idea, for a file with commas

Count and rank

uniq only counts repeats that are next to each other, so sort goes first.

cut -f2 FILE | sort | uniq -c | sort -rn | headThe classic: the most common values in column 2. cut splits on tabs. Use cut -d, -f2 for commas, cut -d' ' -f2 for spaces.

cut -f2 FILE | sort | uniq -c | sort -n | headThe same, rarest first. Odd ones out live here.

grep -o 'user=[a-z0-9]*' FILE | sort | uniq -c | sort -rn | headPull one piece out of messy lines, then count it.

awk '{ n[$1] += $3 } END { for (k in n) print n[k], k }' FILE | sort -rn | headAdd up column 3 for each name in column 1.

for f in *.log; do echo "$(grep -c WORD "$f") $f"; done | sort -rn | headAsk every file the same question, and rank the answers.

Find when

grep -n WORD FILE | head -n 1The first time it happened, and on which line.

grep WORD FILE | cut -c1-16 | sort | uniq -cHow often, minute by minute, if lines start like 2026-11-30T14:02. Look for the jump.

awk '$1 >= "14:00" && $1 < "14:10"' FILEA ten-minute window, if column 1 is the time.

sort -m ONE.log TWO.log | less -STwo logs as one story, if both start with the time.

Compare

diff ONE TWOWhat changed. No output means nothing did.

diff <(sort ONE) <(sort TWO)The same, when the order does not matter.

comm -13 <(sort -u ONE) <(sort -u TWO)Lines that are only in TWO. -23 for only in ONE, -12 for both.

join <(sort ONE) <(sort TWO)Put two files side by side where their first columns match.

grep -F -f ids.txt FILELines that mention anything on your list.

JSON

Files that end in .jsonl hold one JSON record per line.

head -n 1 FILE | jq .One record, made readable.

jq -r .NAME FILE | sort | uniq -c | sort -rn | headThe classic, for one field.

jq -c 'select(.status >= 500)' FILE | headOnly the records that match.

jq -r '[.time, .user] | @tsv' FILE | sort | headTurn fields into columns. Then everything above works.

Keep your place

CHAIN > /tmp/step1save what you found, to use again

CHAIN | tee /tmp/step1save it and see it

X=$(CHAIN)remember one value. Use it as $X

history | grep WORDthat command you typed earlier

Tab finishes a name, Up brings back the last command, Ctrl-C stops one and Ctrl-L clears the screen.

Built by Samuel Mohler. [Contact SME] [Costs and sponsors] [Privacy]