Your DevOps study space

Real explanations. Videos with tests. Fresh exams every time. Keep the streak alive and watch the XP stack up.

Debugging workflow & editing files · Linux Docs · StackwisePlanDevOps Debugging workflow & editing files · Linux Docs · StackwiseCodePython Debugging workflow & editing files · Linux Docs · StackwiseBuildDocker Debugging workflow & editing files · Linux Docs · StackwiseTestDevOps Debugging workflow & editing files · Linux Docs · StackwiseReleaseGit Debugging workflow & editing files · Linux Docs · StackwiseDeployKubernetes Debugging workflow & editing files · Linux Docs · StackwiseOperateLinux Debugging workflow & editing files · Linux Docs · StackwiseMonitorDevOps

Pick a topic

Eight tracks, each with docs, a cheat sheet, videos and tests.

How it works

One loop, repeated until it sticks.

Jump back in

Picked up from where you left off.

Free forever

Your DevOps journey starts with one click.

Sign in with Google or GitHub to open every chapter, video, test and challenge. Your progress is saved wherever you learn.

Debugging workflow & editing files

The TechWorld with Nana video builds its whole lesson around one realistic problem: an app on a server can't connect to its database. Working through a problem like that uses most of the commands from this topic, in a sensible order.

A step-by-step debugging routine

1 Where am I?uname -a, hostname2 Is it running?systemctl status myapp3 What do the logs say?journalctl -u myapp -n 504 Is the config right?diff app.conf app.conf.bak5 Can it reach what it needs?curl -I, nc -zv db 54326 Fix, restart, verifysystemctl restart; tail -f
Go top to bottom and don't skip ahead. Most problems show themselves by step 3, and step 1 stops you fixing the wrong server.
  1. Where am I? uname -a shows the kernel and architecture, cat /etc/os-release shows the distro and version, hostname and whoami confirm the machine and user. It sounds basic, but fixing the wrong server is a classic mistake.
  2. Is it running? systemctl status myapp or ps aux | grep myapp. If it keeps restarting, the status output shows the last log lines.
  3. What do the logs say? journalctl -u myapp -n 50, or tail -n 100 /var/log/myapp/app.log, then narrow it down: grep -i "error\|refused\|timeout" app.log.
  4. Is the config right? Find it with find / -name "*.conf" 2>/dev/null | grep myapp, read it with cat or less, and compare against a known good copy with diff app.conf app.conf.backup. In the video the bug is a wrong database host in the config.
  5. Can it reach what it needs? curl -I http://localhost:8080 fetches only the HTTP headers, a fast "is the web server answering?" test. ping db-server and nc -zv db-server 5432 check the network path and whether the database port is open.
  6. Fix, restart, verify. Edit the file, sudo systemctl restart myapp, and watch the log with tail -f to see it recover.
Before editing a config, make a copy: cp app.conf app.conf.bak. If the change makes things worse, you can put the original back in seconds.

Editing files: nano and Vim

On servers there's no graphical editor, so you edit in the terminal. nano is the easy one: the shortcuts are listed at the bottom (Ctrl+O saves, Ctrl+X exits). Vim is installed almost everywhere, so it's worth knowing the survival basics. Vim has modes: in normal mode keys are commands, in insert mode keys type text.

  • vim file opens it in normal mode.
  • i enters insert mode so you can type; Esc goes back to normal mode.
  • :w saves, :q quits, :wq saves and quits, :q! quits and throws away changes.
  • /word searches, dd deletes a line, u undoes.

If Vim seems to ignore you, you're almost certainly in the wrong mode: press Esc and try again.

Shell scripts: automating the routine

Any commands you type more than twice belong in a script. A script is a text file of commands that runs top to bottom:

#!/bin/bash
# backup.sh - archive a folder with today's date
set -e                      # stop at the first failing command

SOURCE="$1"                 # first argument
DEST="/backups/$(date +%F).tar.gz"

if [ -z "$SOURCE" ]; then
  echo "usage: ./backup.sh folder" >&2
  exit 1
fi

tar -czf "$DEST" "$SOURCE"
echo "saved $DEST"

$ chmod +x backup.sh
$ ./backup.sh /srv/app
  • The first line, the shebang #!/bin/bash, says which program runs the file.
  • $1, $2… are the arguments; $(command) inserts a command's output.
  • Every command returns an exit code: 0 means success, anything else is an error. $? holds the last one, and set -e makes the script stop as soon as one command fails, instead of carrying on in a broken state.
  • for f in *.log; do gzip "$f"; done loops over files.

Questions

Pick an answer. Get it wrong and you can try again right away, no waiting. 10 questions per topic - pick a filter below, then use Recreate questions for a fresh set on that topic.

Fresh questions every time

Exam

A mixed test across the whole site, shuffled so you never know which topic comes next. When you submit, every mistake comes with the reason and a jump to the exact moment in the video that explains it.

30 questions 6 topics 20 minute limit Up to 70 XP
1–4 answer · ←→ move
History

Essay

0 / 200-250 words
Sample answer
History
0:00 / 0:00
Not started

on YouTube
Subscribe

Topic progress

Activity

Achievements

Settings

Your profile and your account.

Profile details

* Required. Saved in this browser until you sign in.

Letters, numbers, dots, dashes and underscores.
0 / 160

Account

Checking…

App

Install Stackwise on your phone or computer. It opens in its own window from your home screen, and the Docs and cheat sheets you've opened keep working without internet.

Only admins can see this

Dashboard

Sign-ups, activity, messages and reviews in one place.

Prove it

Certificates

Pass a topic's test and get a certificate with its own public page you can share or add to LinkedIn. Each test is 10 questions drawn at random and graded on the server; you need 8 right, you have 15 minutes, and you get one try per topic a day.

From first command to production

Linux for DevOps

A path through Linux the way DevOps engineers use it: ten stages, every command explained with its flags, examples, real output and mistakes, the combinations engineers chain together, and incidents worked through step by step. Practise everything in a safe lab folder.

Before the interview

Interview prep

Questions that come up in real DevOps interviews, with the kind of answer that lands. Say yours out loud first, then compare. Each one links to the chapter that goes deeper.

    Private to you

    My notes

    Everything you wrote down while watching and reading, in one place. Saved to your account, never shown to anyone.