Debugging and remote development with VS Code
You debug Python and Bash with breakpoints, and develop on servers and in containers with Remote-SSH and Dev Containers.
Level 201 · 15 lessons · 12 practice labs
Lessons
Debugging
- The debugger: breakpoints, stepping, watches
- launch.json and run configurations
- Conditional breakpoints and logpoints
- Debugging a Python script
- Debugging a Bash script
- Short task: debug a log parser that gives wrong results
Remote development
- Editing on a server with Remote-SSH
- Port forwarding and the remote terminal
- Security in remote development: keys and the server side
- Short task: fix a broken service script on the server remotely
Dev Containers
- Defining a dev environment with devcontainer.json
- Features, extensions and lifecycle commands
- Debugging inside a container
- Short task: prepare a one-click dev environment for a newcomer
Wrap-up
- Capstone: deliver a tool by developing in a container and debugging on a server
Practice labs
- Launch a script that needs arguments: Write a launch.json configuration for a script that needs arguments, an environment variable and a working directory, and show the debugger stops at the first breakpoint.
- The one bad record in ten thousand: Find the single record that breaks the total using a conditional breakpoint and a logpoint without changing the code, and report its line number and value.
- A swallowed exception: In Caravan Travel’s pricing tool, which gives wrong results without any error, find the silently swallowed exception using exception breakpoints, the call stack and watch expressions, and fix the root cause.
- A report that counts one short: Step through the Python script that skips the last day in the weekly report to find the wrong boundary, fix it and show the total reaches the expected value.
- A script that breaks on file names with spaces: Step through the Bash backup script that moves the wrong files when names contain spaces in the debugger, find the faulty variable expansion and fix it.
- Attach to a hung process: Attach the debugger to a Python service that hangs now and then while it is running, find which thread is waiting where and explain the cause of the deadlock with evidence.
- Connect to the server by alias: Add a host alias with key and user to the SSH configuration, connect with Remote-SSH and edit and save a configuration file on the server.
- A panel that listens only on the server: Open the admin panel that listens only on the server’s local address from your desktop using port forwarding, restart the service from the remote terminal and show the panel answers.
- A machine behind a jump host: Set up a Remote-SSH connection to a machine behind a jump host with a dedicated key and no agent forwarding, limit forwarding on the server side to what is needed and show the connection works.
- A first dev container: Write a devcontainer.json that starts from a ready image, installs the needed extensions and loads dependencies on creation, and open the project in the container.
- A dev container that won’t open: Read the logs of a dev container that won’t open because of a wrong Dockerfile path, a bad feature version and the wrong remote user, fix all three and show the workspace is writable.
- Debugging in a container alongside a database: Start the app and its database together in a Compose-based dev container, forward the port and set up a debug configuration where a breakpoint stops on an incoming request.
About this course
You debug Python and Bash with breakpoints, and develop on servers and in containers with Remote-SSH and Dev Containers.
What you will learn
- Debugging
- Remote development
- Dev Containers
- Wrap-up
Prerequisites
Finishing the level 101 courses of the same path, or knowing those topics, is enough.
Lab environment
Lessons run on your own Kali Linux desktop in the browser, with the tools ready in their windowed interfaces. Nothing to install; a computer screen is recommended.
Frequently asked questions
- Is this course right for my level?
- The course is at level 201; it assumes you know the topics of the lower-level courses.
- Is there anything to install?
- No. Every lesson runs in your own lab environment that opens in the browser.
- How do lessons work?
- Each lesson has 8 to 10 steps and a short quiz. Early steps show the command to type, later steps give less help; if two attempts fail, the solution opens.
- Can I try it for free?
- Yes. The first three lessons of every course are free.