Skip to content
Hands-on IT IT Drills

Day 15: Competition – speed drills

Goal: Solve ten everyday tasks against the clock and measure how much faster you’ve become without a mouse. · Duration: approx. 90 min · Prerequisite: Day 14

Briefing

  • Ten drills, each with a situation, a time limit and a solution path. Solve it yourself first, then read up.
  • Two times per drill: the mouse variant is the reference value with Finder, clicks and arrow keys. The pro variant is your goal.
  • The stopwatch wk starts with wk <nr> and stops with wk. Every time lands in ~/term-lab/wettkampf.csv.
  • Preparation doesn’t count toward the time. The clock runs from the first keystroke after wk <nr>.
  • Tested on macOS 15.6.1 with zsh 5.9, tmux 3.8, fzf 0.74, atuin 18.23, Neovim 0.12, Git 2.56 and chezmoi 2.73. Everything should run the same under macOS 26.
 wk 3 ──► solve task ──► wk ──► wettkampf.csv ──► wkstand (points)
          ⌃R  ⌥R  ⌥.  ⌃X⌃E  ⌃a |  z  frg  …

Preparation

Start the lab shell (~/term-lab/lab) and create the competition file. It brings the stopwatch, the SSH alias from Day 12 and a chezmoi function for the “new Mac”:

cat > ~/term-lab/config/zsh/wettkampf.zsh <<'EOF'
# wettkampf.zsh – stopwatch and helpers for the speed drills (Day 15)
zmodload zsh/datetime
wk() {
  if [[ -n $1 ]]; then                         # wk 3  -> start Drill 3
    typeset -g WK_NR=$1 WK_T0=$EPOCHREALTIME
    print "⏱  Drill $1 läuft – fertig? Dann: wk"
  elif [[ -n $WK_T0 ]]; then                   # wk    -> stop + log
    local s=$(( EPOCHREALTIME - WK_T0 ))
    printf '✔ Drill %s: %.0f s\n' $WK_NR $s
    printf '%s;%s;%.0f\n' "$(date +%F)" $WK_NR $s >> $LAB/wettkampf.csv
    unset WK_T0
  else
    print -u2 "usage: wk <nr> (Start) | wk (Stopp)"; return 2
  fi
}

# SSH with lab configuration (Day 12)
alias lssh='ssh -F ~/term-lab/ssh/config'

# chezmoi for the "new Mac" (Drill 10): empty home under $LAB/wk/neu
czneu() {
  local N=$LAB/wk/neu
  chezmoi --source $N/src --destination $N/home --config $N/cfg/chezmoi.toml \
    --persistent-state $N/cfg/state.boltdb --cache $N/cfg/cache "$@"
}
EOF
reload
wk 0; sleep 1; wk

Expected:

⏱  Drill 0 läuft – fertig? Dann: wk
✔ Drill 0: 1 s

Delete the trial run again: sed -i '' '/;0;/d' ~/term-lab/wettkampf.csv.

Now the training ground. A separate branch protects main, the logs are also available as JSON, zoxide knows the jump targets, the practice sshd from Day 12 runs again, and a small dotfiles repo is waiting for the new Mac:

cd ~/term-lab/projekt
git switch main && git switch -c speed/fixup
jq -Rc 'split(" ") | {ts: .[0], mod: .[1], level: .[2],
  req: (.[3] | ltrimstr("request_id=")), user: (.[4] | ltrimstr("user="))}' \
  logs/app.log > logs/app.jsonl
zoxide add ~/term-lab/projekt{,/internal/cart,/deploy/k8s,/scripts} \
  ~/term-lab/config/zsh
/usr/sbin/sshd -f ~/term-lab/ssh/sshd_config -E ~/term-lab/ssh/sshd.log
lssh lab-bastion true
mkdir -p ~/term-lab/wk/neu/home ~/term-lab/wk/download
cp -R $BUCH/chezmoi/src ~/term-lab/wk/dotfiles
git -C ~/term-lab/wk/dotfiles init -q
git -C ~/term-lab/wk/dotfiles add -A
git -C ~/term-lab/wk/dotfiles commit -qm "Dotfiles (Lab)"
head -1 logs/app.jsonl

Expected (depending on your state, the first line may also be “Bereits auf ‘main’”):

Zu Branch 'main' gewechselt
Zu neuem Branch 'speed/fixup' gewechselt
{"ts":"2026-10-05T08:00:00","mod":"cart","level":"INFO","req":"r0000","user":"u00"}

If ~/term-lab/ssh/sshd_config is missing, repeat Day 12, Drills 1 and 2. All logs are lab data; thanks to logs/ in .gitignore, the file app.jsonl doesn’t show up in the Git status.

Drill 1: Finding and fixing a TODO

Situation: You’re in ~/term-lab/projekt. Somewhere there’s a TODO about discounts.

Task: Find it, turn TODO into NOTE in the editor, save. Afterwards there are only two TODOs left in the project.

Time limit: mouse variant 120 s · pro variant 20 s

Solution path:

Step Key / command Effect
1 wk 1 clock running
2 frg TODO⏎ rg matches in fzf (Day 7)
3 rab ⏎ pick the match cart.go:16, nv opens line 16
4 /TODO⏎ cursor on the word
5 ciw NOTE ⎋ replace the word (Day 11)
6 :wq⏎ save, back to the shell
7 wk stop the clock
sed -n 16p internal/cart/cart.go
rg -c TODO

Expected:

    // NOTE: Rabatte berücksichtigen
scripts/report.py:1
cmd/shop/main.go:1

Without frg, the quickfix list is almost as fast: nv -q <(rg --vimgrep TODO) and :cn up to the discount match. The mouse variant: open the project in a GUI editor, global search, click the match, select the word, type, ⌘S.

Save your progress? Sign up for free

Drill 2: Rebuilding a long command line

Situation: At the prompt (not yet run) there’s:

kubectl --context kunde-dev --namespace shop get pods -o wide

Task: Without arrow keys and without retyping, turn it into kubectl --context kind-lab --namespace shop get deploy -o yaml.

Time limit: mouse variant 45 s · pro variant 10 s

Solution path: The cursor is at the end of the line. Since Day 3, - and / separate words.

Step Keys Buffer afterwards (excerpt)
1 ⌃W yaml … get pods -o yaml
2 ⌥B ⌥B ⌥B cursor before pods
3 ⌥D deploy … get deploy -o yaml
4 ⌃A ⌥F ⌥F cursor before kunde-dev
5 ⌥D ⌥D kind-lab --context kind-lab --namespace …

Expected:

[lab] projekt % kubectl --context kind-lab --namespace shop get deploy -o yaml▮

Discard with ⌃C; no cluster is needed. A second pro way, if the old line is already in the history: history modifiers in a row. HIST_VERIFY (Day 4) shows the result; only the second ⏎ runs it:

!!:s/kunde-dev/kind-lab/:s/pods/deploy/:s/wide/yaml/

Expected:

[lab] projekt % kubectl --context kind-lab --namespace shop get deploy -o yaml

A third way for even longer lines: ⌃X⌃E and in nv :s/kunde-dev/kind-lab/ (Day 3). The mouse variant: hold down the arrow keys, delete character by character.

Save your progress? Sign up for free

Drill 3: Rescuing a command from the history

Situation: On Day 6 you set replicas to 5 with yq and piped it to rg. Since then, hundreds of commands have piled up in between. If it’s missing from your history (new machine), create it first: print -s "yq '.spec.replicas = 5' deploy/k8s/deployment.yaml | rg replicas".

Task: (a) Bring the command back and run it. (b) Find the last failed command you typed in ~/term-lab/projekt.

Time limit: mouse variant 60 s · pro variant 5 s per part

Solution path:

Part Keys Effect
a ⌃R yq rep 5 ⏎ ⏎ fzf history (Day 7), word fragments in any order
a yq ↑ alternative: prefix search (Day 4)
b ⌥R open atuin (Day 4)
b ⌃R until [ DIRECTORY ] only commands from this folder

Expected after (a):

[lab] projekt % yq '.spec.replicas = 5' deploy/k8s/deployment.yaml | rg replicas
  replicas: 5

In atuin, failed commands are marked red. As a one-liner for scripts and runbooks, (b) also works without the UI:

atuin search --cwd $PWD --exclude-exit 0 --format "{exit}  {command}" | tail -3

Expected (your commands will differ):

1  cat gibtsnicht.txt
1  kubectl --context kunde-dev get pods -n shop --request-timeout=1s
-1  atuin search --cwd $PWD --exclude-exit 0 --format "{exit}  {command}"

The running command itself appears at the end with -1; it doesn’t have an exit code yet. The mouse variant: scroll in the terminal, ⌘F, select, copy, paste.

Save your progress? Sign up for free

Drill 4: Five directories in ten seconds

Situation: You’re in /tmp. zoxide has known the targets since the preparation.

Task: Jump one after another to internal/cart, deploy/k8s, ~/term-lab/config/zsh, projekt/scripts and back to the project root. Run pwd once in each target.

Time limit: mouse variant 60 s · pro variant 10 s

Solution path:

z cart && pwd
z k8s && pwd
z conf zsh && pwd
z scr && pwd
z projekt && pwd

Expected:

/Users/du/term-lab/projekt/internal/cart
/Users/du/term-lab/projekt/deploy/k8s
/Users/du/term-lab/config/zsh
/Users/du/term-lab/projekt/scripts
/Users/du/term-lab/projekt

Several words narrow it down: the last one must be in the last path component, hence conf zsh and not zsh conf. On a tie, zi opens the fzf picker; ⌥C searches below the current folder (Day 7). The mouse variant: Finder, double-click folders, right-click “New Terminal at Folder”.

Save your progress? Sign up for free

Drill 5: Pulling fields from JSON logs

Situation: logs/app.jsonl from the preparation, one JSON line per log entry.

Task: (a) Count WARN and ERROR entries per component. (b) Output the request IDs of all ERRORs from user u06 as a comma-separated list. (c) When was the first and when the last ERROR?

Time limit: mouse variant 300 s · pro variant 60 s

Solution path:

jq -r 'select(.level | test("WARN|ERROR")) | "\(.mod) \(.level)"' logs/app.jsonl |
  sort | uniq -c
jq -r 'select(.level == "ERROR" and .user == "u06") | .req' logs/app.jsonl |
  paste -sd, -
jq -sr 'map(select(.level == "ERROR"))
  | "\(length) Fehler, erster \(.[0].ts), letzter \(.[-1].ts)"' logs/app.jsonl

Expected:

  50 checkout ERROR
  50 http WARN
r0006,r0236,r0466
50 Fehler, erster 2026-10-05T08:06:42, letzter 2026-10-05T16:16:52

select() filters line by line; -s (slurp) reads everything into an array so that length, .[0] and .[-1] work. "\(.feld)" builds text, -r outputs it without quotes. For (b) it also works purely in jq: jq -sr '[.[] | select(.level == "ERROR" and .user == "u06") | .req] | join(",")'. The mouse variant: load the file into an editor, search, count the matches by hand.

Tip: Build jq filters step by step with ⌃X⌃E or ↑: first select, then the field, then the pipe. If you work like this often, add the interactive jnv or fx.

Save your progress? Sign up for free

Drill 6: A project session with three panes in one command

Situation: You’re outside tmux, in the project folder. There’s no shop session on the lab server yet (otherwise tl kill-session -t shop cleans it up).

Task: A single command builds the shop session: window main, a large pane on the left, two stacked on the right, all in the project folder, cursor on the left.

Time limit: mouse variant 90 s · pro variant 10 s

Solution path:

cd ~/term-lab/projekt
tl new -s shop -n main \; split-window -h \; split-window -v \; \
  select-layout main-vertical \; select-pane -t .1

You can check from inside with:

tmux list-panes -F '#{pane_index} #{pane_width}x#{pane_height} #{pane_current_path}'

Expected (sizes depend on the window):

1 95x40 /Users/du/term-lab/projekt
2 64x20 /Users/du/term-lab/projekt
3 64x19 /Users/du/term-lab/projekt

\; separates tmux commands within one call; the backslash protects the semicolon from zsh. New panes inherit the tmux client’s working directory, hence the cd first. If you’re already in tmux, add -d to new and jump with tmux switch-client -t shop. For every day, tp from Day 9 still applies. The mouse variant: iTerm2 splits via the menu and cd three times.

Save your progress? Sign up for free

Drill 7: Repairing an old commit

Situation: On speed/fixup, internal/cart/cart.go from Drill 1 is modified but not yet committed. The file belongs to the commit feat: Warenkorb und HTTP-Server, two commits back.

Task: Fold the change into that old commit without copying a hash. main must not move.

Time limit: mouse variant 300 s · pro variant 45 s

Solution path:

git add internal/cart/cart.go
git fixup ":/feat: Warenkorb"
GIT_SEQUENCE_EDITOR=: git ri --no-update-refs HEAD~3
git ll | head -3
git ll main | head -1

Expected (hashes on speed/fixup will differ):

[speed/fixup 22f86e0] fixup! feat: Warenkorb und HTTP-Server
 1 file changed, 1 insertion(+), 1 deletion(-)
Erfolgreich Rebase ausgeführt und refs/heads/speed/fixup aktualisiert.
519adf1 chore: Config, Manifeste, Report
121b13d feat: Warenkorb und HTTP-Server
1dc0abc init: Projektgerüst
2e4e6aa chore: Config, Manifeste, Report

git fixup and git ri are the aliases from Day 10. HEAD~3 is the commit before the target. GIT_SEQUENCE_EDITOR=: accepts the sorted todo list without an editor. In everyday use, you leave out the variable, check the list in nv and save with :wq.

Warning: Without --no-update-refs, rebase.updateRefs = true from the lab gitconfig drags along every branch that points to a rewritten commit. Here that would be main. After every rebase, check with git ll main whether other branches have moved.

The mouse variant: lazygit or a GUI, find the commit, click “Fixup”, rebase. In lazygit it’s quick too: stage the file with space, panel 4, pick the target commit, F.

Save your progress? Sign up for free

Drill 8: Port in use – find and kill the process

Situation: A forgotten test server is blocking port 8765. Start it before the clock:

python3 -m http.server 8765 --bind 127.0.0.1 -d ~/term-lab/projekt >/dev/null 2>&1 &!

&! starts in the background and detaches the job from the shell. It doesn’t show up in jobs, so kill %1 won’t work.

Task: Find out which process is listening on 8765 and kill it.

Time limit: mouse variant 120 s · pro variant 15 s

Solution path:

port 8765
kill $(lsof -ti tcp:8765 -sTCP:LISTEN)
port 8765; echo "rc=$?"

Expected (PID will differ):

COMMAND   PID USER FD   TYPE             DEVICE SIZE/OFF NODE NAME
Python  44535 du    3u  IPv4 0xe93b2b70de3a3a0c      0t0  TCP 127.0.0.1:8765 (LISTEN)
rc=1

port is the function from Day 5. lsof -t outputs only PIDs and therefore fits directly into kill. Interactively, fkill (Day 7) works too: type 8765, ⏎. The mouse variant: Activity Monitor, search for “Python”, guess which one it is, “Quit”.

Save your progress? Sign up for free

Drill 9: SSH via the bastion

Situation: The practice sshd from Day 12 is running (preparation). According to ~/term-lab/ssh/config, you can only reach lab-app via lab-bastion.

Task: (a) On lab-app, count the ERROR lines in ~/term-lab/projekt/logs/app.log. (b) Fetch the file to ~/term-lab/wk/download/. (c) Check whether the master connection is up.

Time limit: mouse variant 180 s · pro variant 20 s

Solution path:

lssh lab-app 'grep -c ERROR ~/term-lab/projekt/logs/app.log'
scp -O -q -F ~/term-lab/ssh/config \
  lab-app:term-lab/projekt/logs/app.log ~/term-lab/wk/download/
wc -l < ~/term-lab/wk/download/app.log
lssh -O check lab-bastion

Expected (PID will differ):

50
     500
Master running (pid=44787)

Why scp -O? The practice sshd has no SFTP subsystem configured, and newer scp versions use SFTP by default. -O switches to the old protocol. Against real servers you leave out -O. Without a configuration, -J helps: ssh -J bastion app-web01 (Day 12). The mouse variant: two terminal windows, first the bastion, then onward from there, copy the file via the clipboard.

Tip: lab-app and lab-bastion have the same host, port and user. That’s why they even share the master socket via %C. With real servers, each host has its own.

Save your progress? Sign up for free

Drill 10: New Mac – dotfiles in one command

Situation: ~/term-lab/wk/neu/home is the empty home of a fresh Mac. ~/term-lab/wk/dotfiles is your dotfiles repo (a copy of $BUCH/chezmoi/src).

Task: Bring the dotfiles and Git configuration for a private machine onto the new Mac without installing packages. Then check permissions, drift and the Brewfile.

Time limit: mouse variant 1800 s · pro variant 120 s

Solution path:

czneu init --apply --exclude=scripts ~/term-lab/wk/dotfiles

chezmoi asks once for the machine type (privat) and the Git email. For scripts, you answer both in advance with --promptChoice Rechnerart=privat --promptString Git-E-Mail=… (Day 13).

find ~/term-lab/wk/neu/home -type f | sed "s#$HOME/term-lab/wk/neu/##"
stat -f %Lp ~/term-lab/wk/neu/home/.config/termlab/secrets.env
czneu status
brew bundle check --no-upgrade --file=$(czneu source-path)/Brewfile

Expected (shortened):

Klone nach '/Users/du/term-lab/wk/neu/src'...
home/.config/termlab/secrets.env
home/.config/zsh/aliases.zsh
home/.gitconfig
home/.zshrc
600
 R .chezmoiscripts/10-brew.sh
The Brewfile's dependencies are satisfied.

init --apply clones the repo, generates the configuration from .chezmoi.toml.tmpl and writes all files. --exclude=scripts holds back the brew bundle script; R in status shows: it would still run. On a real Mac that’s exactly the desired next step; there the command is simply chezmoi init --apply <repo> (Day 13, Drill 8). The mouse variant: old Mac, Finder, show hidden files (⌘⇧.), copy them one by one via AirDrop and adjust them by hand.

Save your progress? Sign up for free

Shortcut table

Key Effect Mnemonic
⌃R / ⌥R history with fzf / atuin Replay
⌃W / ⌥D delete word left / right Word, Delete
⌥B / ⌥F word back / forward Back, Forward
⌃X⌃E build the line in the editor eXternal Edit
⌥C / z folder via fzf / zoxide Change dir
ciw replace word in the editor change inner word
⌃a | / ⌃a - tmux split looks like the cut
F in lazygit fixup onto the selected commit Fixup

Scoring

The stopwatch logged every round. A small function converts the best time per drill into points:

cat >> ~/term-lab/config/zsh/wettkampf.zsh <<'EOF'

# wkstand – best time per drill, points and total from wettkampf.csv
wkstand() {
  awk -F';' '
    BEGIN { split("20 10 5 10 60 10 45 15 20 120", pro, " ")
            split("120 45 60 60 300 90 300 120 180 1800", maus, " ") }
    $2 > 0 && (!($2 in best) || $3 < best[$2]) { best[$2] = $3 }
    END {
      for (d = 1; d <= 10; d++) {
        if (!(d in best)) { printf "Drill %2d      –\n", d; continue }
        t = best[d]
        p = t <= pro[d] ? 3 : t <= 2 * pro[d] ? 2 : t <= maus[d] ? 1 : 0
        s += p
        printf "Drill %2d %5d s  Profi %4d s  %d P\n", d, t, pro[d], p
      }
      printf "Summe: %d von 30 Punkten\n", s
    }' "$LAB/wettkampf.csv"
}
EOF
reload
wkstand

Expected (example with four measured drills):

Drill  1    18 s  Profi   20 s  3 P
Drill  2     9 s  Profi   10 s  3 P
Drill  3      –
...
Drill  5   400 s  Profi   60 s  0 P
...
Drill 10   110 s  Profi  120 s  3 P
Summe: 9 von 30 Punkten
Time Points Meaning
up to pro time 3 it’s in your fingers
up to double the pro time 2 path clear, hands still slow
up to mouse time 1 solved, but not faster than before
above that 0 do that drill’s day again

24 to 30 points: senior pace. 15 to 23: solid; repeat the weakest three drills daily for a week. Below 15: Part A (Day 1 to 4) once more, then measure again. Every repetition lands in the CSV; wkstand always takes the best time. That way you see your before and after.

Checkpoint

After all ten drills, in the lab shell:

LAB=${LAB:-~/term-lab}; P=$LAB/projekt
SE=$LAB/wk/neu/home/.config/termlab/secrets.env
ok() { local m=$1; shift; "$@" >/dev/null 2>&1 && echo "✔ $m" || echo "✘ $m"; }
drills=$(cut -d';' -f2 "$LAB/wettkampf.csv" | grep -vx 0 | sort -u | wc -l)
ok "10 Drills gemessen"     test "$drills" -ge 10
ok "main unverändert"       test "$(git -C "$P" rev-parse --short main)" = 2e4e6aa
ok "kein fixup! übrig"      sh -c "! git -C '$P' log --format=%s main~2..speed/fixup |
                                   grep -q '^fixup!'"
ok "NOTE im alten Commit"   sh -c "git -C '$P' show \
                                   speed/fixup~1:internal/cart/cart.go | grep -q NOTE"
ok "JSON-Log komplett"      test "$(jq -s length "$P/logs/app.jsonl")" = 500
ok "zoxide kennt die Ziele" sh -c "_ZO_DATA_DIR='$LAB/zoxide' zoxide query -l |
                                   grep -q 'config/zsh$'"
ok "Port 8765 frei"         sh -c '! lsof -ti tcp:8765 -sTCP:LISTEN'
ok "Session shop: 3 Panes"  test "$(tl list-panes -t shop | wc -l)" -eq 3
ok "neuer Mac: .gitconfig"  grep -q zachmann "$LAB/wk/neu/home/.gitconfig"
ok "secrets.env ist 0600"   test "$(stat -f %Lp "$SE")" = 600

Expected:

✔ 10 Drills gemessen
✔ main unverändert
✔ kein fixup! übrig
✔ NOTE im alten Commit
✔ JSON-Log komplett
✔ zoxide kennt die Ziele
✔ Port 8765 frei
✔ Session shop: 3 Panes
✔ neuer Mac: .gitconfig
✔ secrets.env ist 0600

A ✘ for “Session shop” usually means: Drill 6 ran in a different tmux server. tl ls shows what’s running on the lab socket.

Challenge

Combine Drill 1 and Drill 6 into a single command: the session shop2 has the same three panes; on the left, nv opens the TODO in cmd/shop/main.go directly; bottom right runs tail -f logs/app.log; top right, a free shell is waiting. Goal: under 5 seconds, including typing via ⌃R, once the command is in the history.

Hint: send-keys -t .1 '<befehl>' Enter types into pane 1 of the current window, and that also works in the middle of a \; chain.

Solution

cd ~/term-lab/projekt
tl new -s shop2 -n main \; split-window -h \; split-window -v \; \
  select-layout main-vertical \; \
  send-keys -t .1 'nv +13 cmd/shop/main.go' Enter \; \
  send-keys -t .3 'tail -f logs/app.log' Enter \; select-pane -t .1

Check from another pane (⌃a l):

tmux list-panes -F '#{pane_index} #{pane_current_command} active=#{pane_active}'

Expected:

1 nvim active=0
2 zsh active=1
3 tail active=0

If you need this daily, cast it into a script in ~/term-lab/bin or extend tp (Day 9). From then on, ⌃a f and a word fragment are enough.

Save your progress? Sign up for free

Enterprise Note

  • Speed only counts with safety: commands against prod (kubectl, ssh, terraform) stay slow and deliberate. The prod guard, red prompt and --readonly from Day 14 apply in the competition too.
  • Pair programming and screen sharing: say what you’re pressing (“⌃R, yq”). Otherwise shortcuts are magic to the people watching. Keep an iTerm2 presentation profile with a large font ready (Day 1).
  • The drills work well as an onboarding exercise in the team: same lab environment, same tasks, compare times in the retro, don’t grade them.
  • After a day like this, the history, tmux scrollback and resurrect backups contain many commands. Check for secrets before sharing your screen or files (Day 4, Day 9).
  • Whatever you’ve typed fast three times belongs in the repo: as an alias, function, just recipe or runbook step (Day 5, Day 14).

Clean up after the competition: tl kill-session -t shop, tl kill-session -t shop2, kill "$(cat ~/term-lab/ssh/sshd.pid)" and git switch main in the project. You may keep the speed/fixup branch and ~/term-lab/wk for Appendix B.