All tags
Start here · debuggingFind out why a Linux service failed, with journalctl12 steps · 13 min read · Linux server owners who rarely read logsStart the guide debugging
Narrow down
Guides1
Web21
- Tip
node --inspect-brk app.jsnode --inspect-brk pauses a Node script on its first linePause a Node.js script on line one so a debugger can attach before anything runs3 Dec 2026 - Tip
google-chrome --user-data-dir=/tmp/chrome-clean --no-first-runStart Chrome with its own user data folder for a clean test profileTest a site without your extensions, cookies and settings getting in the way.1 Dec 2026 - Tip
queryObjects(Promise)QueryObjects() in the DevTools console finds every instance of a classCount the live objects of one type while hunting a memory leak.1 Dec 2026 - Tip
inspect(document.querySelector('footer'))Inspect() jumps from the DevTools console to an element in the pageOpen the Elements panel on exactly the node your selector returns.1 Dec 2026 - Tip
Console > Create Live ExpressionA DevTools live expression keeps a changing value pinned above the consoleWatch a value update by itself instead of typing it again and again.1 Dec 2026 - Tip
User agent > untick "Use browser default"Override the user agent in DevTools to see what another browser getsCheck what a server or script sends when the browser claims to be different.1 Dec 2026 - Tip
right-click the node > Store as global variableStore as global variable in DevTools gives a clicked element a nameTurn something you found by clicking into a variable you can script.1 Dec 2026 - Tip
const text = '{"createdAt":"2026-11-30T09:00:00Z","name":"x"}';A JSON.parse reviver turns date strings back into real Date objectsConvert dates once while parsing instead of all over your code.1 Dec 2026 - Tip
npm config listnpm config list shows which config file set each npm optionSee the active npm settings grouped by the file they come from.1 Dec 2026 - Tip
wp rewrite list --format=csvwp rewrite list prints the rewrite rules WordPress usesPrints the WordPress rewrite rules and lets you see which one matches a given URL.28 Nov 2026 - Tip
define( 'SCRIPT_DEBUG', true );SCRIPT_DEBUG makes WordPress load the unminified scripts and stylesMakes WordPress load readable, unminified core scripts and styles so browser errors are traceable.28 Nov 2026 - Tip
console.time("fetchData");Console.time() and timeLog() measure how long a piece of code takesPrints how long code took between two labelled console calls.28 Nov 2026 - Tip
'cart total', total, items.lengthChrome DevTools logpoints log a value without editing your codePrints a message to the Console each time a line runs, without pausing the page.28 Nov 2026 - Tip
Elements > right-click #results > Break on > Subtree modificationsBreak on subtree modifications finds the script that changes an elementPauses the page in the script that adds, removes or changes an element.28 Nov 2026 - Tip
monitorEvents($0, 'click')MonitorEvents($0, 'click') logs the events of the element you inspectedLogs the events fired on the element you last inspected, straight from the Console.28 Nov 2026 - Tip
getEventListeners($0)GetEventListeners($0) lists which handlers are attached to an elementShows every event listener registered on the element you just inspected.28 Nov 2026 - Tip
:block analytics.example.com:block in the Firefox console blocks every request whose URL contains a stringBlocks requests to a URL fragment from the Firefox console, to test failures.28 Nov 2026 - Tip
/api/ordersAn XHR/fetch breakpoint in DevTools pauses when a request URL matches a stringPauses the debugger on the line that sends a request whose URL contains your text.28 Nov 2026 - Tip
Ctrl+Shift+F > AuthorizationCtrl+Shift+F in DevTools searches all the files a page has loadedFinds a piece of text in every file the page has loaded, from one search box.28 Nov 2026 - Tip
define( 'WP_DEBUG', true );Log WordPress errors to a file and keep them off the screenWrites WordPress errors to a log file while hiding them from visitors on the page.6 Jul 2026 - Tip
define( 'WP_DEBUG', true );WP_DEBUG_LOG accepts a file path so wordpress can log outside wp-contentWrites the WordPress debug log to a chosen path, which can be outside the public web folder.1 Apr 2026
Python18
- Tip
except* ValueError as eg:Python's except* handles each error type inside an ExceptionGroupUse except* to catch some exceptions from a group and leave the others for later.2 Dec 2026 - Tip
pytest --maxfail=2pytest --maxfail=2 stops the run after two failuresStop a pytest run after a set number of failures instead of waiting for the whole suite.2 Dec 2026 - Tip
python3 -m trace -t script.pypython -m trace -t prints every line as your script runs itWatch the exact path a script takes through its code, line by line.30 Nov 2026 - Tip
log = logging.getLogger(__name__)Python's log.exception writes the error message and traceback in one callLog a caught exception with its full traceback at error level.30 Nov 2026 - Tip
import tracemallocPython's tracemalloc shows which lines are eating your memoryFind the lines of code that allocate the most memory in a Python program.30 Nov 2026 - Tip
import tracebackPython's traceback.print_exc shows the full error and lets the script carry onPrint the complete traceback inside an except block without stopping the program.30 Nov 2026 - Tip
python3 -O check.py # assert is skipped, delete_everything() runspython -O removes assert statements, so never use them for real checksKnow when assert disappears and what to use for checks that must always run.30 Nov 2026 - Tip
import inspect, textwrapPython's inspect.getsource shows the code behind any functionRead the source of a function or class from the prompt without hunting for the file.30 Nov 2026 - Tip
from pprint import ppPython's pprint.pp prints nested data so you can actually read itPrint a big nested dict or API response across lines, keys left in order.30 Nov 2026 - Tip
python -X dev script.pypython -X dev turns on extra runtime checksEnables extra warnings and checks, such as unclosed files, while a script runs.28 Nov 2026 - Tip
python -P script.pypython -P stops the script directory from landing on sys.pathKeeps the script's own folder off the import path so local files cannot shadow modules.28 Nov 2026 - Tip
import faulthandlerFaulthandler.dump_traceback_later shows where a script hangsPrints the traceback of every thread after a timeout, so a hung script shows where it is stuck.28 Nov 2026 - Tip
for name, email in zip(names, emails, strict=True):Zip(strict=True) makes Python complain when two lists differ in lengthRaises an error when the lists you zip together don't have the same length.27 Nov 2026 - Tip
from contextlib import suppressPython's contextlib.suppress ignores one expected error in a single lineReplaces a try/except/pass block for an error you expect and are fine with.26 Nov 2026 - Tip
PYTHONBREAKPOINT=0 python3 app.pyPYTHONBREAKPOINT decides what a python breakpoint() call doesSwitches or disables breakpoint() calls without editing the source.24 Nov 2026 - Tip
python3 -i script.pypython -i script.py leaves you in a prompt with the script's variablesRuns a script and then keeps the interpreter open so you can inspect its state.24 Nov 2026 - Tip
python3 -W error script.pypython -W error turns every warning into an exceptionMakes python raise warnings as errors, so deprecations fail loudly during development.24 Nov 2026 - Tip
python3 -m pytest -x --pdb tests/test_api.pypython -m pytest -x --pdb opens the debugger at the first failing testDrops into the python debugger at the first test failure so you can inspect variables.24 Nov 2026
Shell10
- Tip
sudo pmap -x 1234Pmap -x breaks the memory of one process down by mappingSee whether a big process is heap, libraries or mapped files.1 Dec 2026 - Tip
leaks -atExit -- ./myprogram --some-optionleaks can check a program for lost memory the moment it exits on a MacTest your own command line program for leaked allocations.1 Dec 2026 - Tip
sudo lsof -nP -p 1234Lsof -p shows every file and socket one process has openSee which config, log and network connections a running program is using.1 Dec 2026 - Tip
set -xBASH_XTRACEFD sends set -x output of a bash script to its own fileKeep trace lines out of the normal error output of a script.30 Nov 2026 - Tip
declare -f mkcddeclare -f prints the code of a shell function you loaded earlierSee what a function in your shell really does, and where it came from.30 Nov 2026 - Tip
sudo tcpdump -i any -n -c 500 -w /tmp/capture.pcap host 192.168.1.50 and port 443Tcpdump -w saves a capture you can open in Wireshark laterRecords packets to a file with a filter and a packet limit for later analysis.28 Nov 2026 - Tip
sudo fs_usage -w -f filesys Mailsudo fs_usage shows which files a Mac app is reading and writingLists the file system calls of one app live, so you see which files it touches.28 Nov 2026 - Tip
sample Safari 5 -file ~/Desktop/safari-sample.txtsample shows what a frozen Mac app is busy doingRecords where a running or frozen app spends its time, as a text call tree.28 Nov 2026 - Tip
declare -p appsdeclare -p shows exactly what is inside a bash variable or arrayPrints the type and exact quoted value of a bash variable, array or function.27 Nov 2026 - Tip
set -xset -x with a better PS4 shows the line number of every traced commandShows the file and line number in front of every command bash traces with set -x.27 Nov 2026
Network10
- Tip
chrome://net-export/Chrome://net-export records a network log of everything Chrome doesCapture DNS, proxy and connection problems that the Network panel cannot explain.1 Dec 2026 - Tip
chrome://net-internals/#hstsChrome://net-internals can make Chrome forget a site's HSTS ruleReach a test site over plain HTTP again after Chrome insisted on HTTPS.1 Dec 2026 - Tip
right-click the request > Edit and ResendEdit and Resend in Firefox replays a request with your own changesChange a header or body and send the request again from the browser.1 Dec 2026 - Tip
Network panel > Disable cacheDisable cache in DevTools makes every reload fetch files from the serverStop old CSS and scripts from confusing you while you work on a site.1 Dec 2026 - Tip
Network panel > tick "Preserve log" in the toolbarPreserve log in the Network panel keeps requests after a redirect or form submitSee the request that caused a redirect instead of an empty list after navigation.30 Nov 2026 - Tip
curl -sL -D headers.txt -o page.html https://example.com/curl -D saves the response headers next to the downloadKeep the headers of a download in a separate file while the body goes to its own file.30 Nov 2026 - Tip
ss -sss -s counts your sockets before you list themPrints totals of open sockets per protocol and TCP state in a few lines.28 Nov 2026 - Tip
Resolve-DnsName example.com -Type MX -Server 1.1.1.1Resolve-DnsName is the PowerShell way to ask a specific DNS serverLooks up DNS records from PowerShell, with the record type and DNS server you choose.26 Nov 2026 - Tip
tr '\0' '\n' < /proc/$(pgrep -o nginx)/environ | sorttr on /proc/PID/environ shows the environment of a running linux processPrints the variables a running process was started with, one per line.9 Apr 2026 - Tip
curl -s https://example.com/wp-json/ | jq '.namespaces'curl the wp-json root and jq namespaces to see which wordpress REST routes existFetches the REST API index and lists the route namespaces, including those added by plugins.29 Mar 2026
Other tips9
- Tip
printf 'GET /\r\n' | hexdump -CHexdump -C shows a file as hex bytes next to readable textSee the exact bytes of a file, with hex on the left and readable characters on the right.3 Dec 2026 - Tip
Safari > Settings > Advanced >Switch on the Develop menu in Safari with one checkboxGet the web developer tools that Safari hides by default.1 Dec 2026 - Tip
right click an entry > Show Same KeybindingsShow Same Keybindings finds clashing keyboard shortcuts in VS CodeSee every command that is bound to the same key combination.1 Dec 2026 - Tip
type "sensors" > Show Sensors > GeolocationThe DevTools Sensors panel fakes your location for testingTest location based features as if you were somewhere else.1 Dec 2026 - Tip
Get-ExecutionPolicy -ListGet-ExecutionPolicy -List shows which Windows scope blocks your scriptFind the PowerShell scope whose policy wins, before changing anything.1 Dec 2026 - Tip
ps -o pid,lstart,etime,cmd -p 1234ps -o lstart,etime shows when a process started and how long it ranCheck whether a service really restarted after your change or crashed recently.1 Dec 2026 - Tip
fc-match Helveticafc-match tells you which font Linux really picks for a nameSee the fallback font you get when the requested one is missing.1 Dec 2026 - Tip
| openssl s_client -connect example.com:443 -servername example.com -quiet -keylogfile keys.logOpenssl s_client -keylogfile lets Wireshark decrypt your own TLS testWrite the TLS session secrets to a file so a packet capture of that connection can be decrypted.30 Nov 2026 - Tip
// DevTools pauses on the first line of the functionDebug(functionName) in the console pauses the next time that function runsSet a breakpoint on a function without finding it in the Sources panel.30 Nov 2026
Git8
- Tip
git grep -n 'API_KEY' $(git rev-list --all)git grep over every commit finds a secret that was ever committedSearches all versions of all files in history, not just the current checkout.30 Nov 2026 - Tip
git tag --contains a1b2c3dgit tag with contains tells you which releases have a fixLists every tag and branch that includes a given commit.30 Nov 2026 - Tip
git cat-file -p HEADgit cat-file -p shows what a commit really is insidePrints the raw content of a commit, tree or blob so you see git's own data.30 Nov 2026 - Tip
git fsck --no-reflog | awk '/dangling commit/ {print $3}'git fsck can find a stash you dropped by accidentRecovers a dropped or cleared stash by looking for dangling commits in the object store.30 Nov 2026 - Tip
git blame -w -C -C -L 40,60 src/config.pygit blame -w -C -C to skip whitespace and find moved codeAttributes lines to the commit that wrote them, ignoring whitespace changes and code moved between files.28 Nov 2026 - Tip
git diff --checkgit diff --check catches whitespace errors and conflict markersWarns about trailing whitespace and leftover conflict markers in your changes.28 Nov 2026 - Tip
git rebase --exec "make test" origin/maingit rebase --exec runs a command after every commitRuns a test command on every commit of a branch during a rebase and stops at the first failure.28 Nov 2026 - Tip
git bisect run ./test.shLet git bisect run your test for youFinds the commit that introduced a bug by running your test script on commits automatically.20 Aug 2026
Media3
- Tip
log stream --predicate 'process == "Finder"' --style compactlog stream --predicate watches the Mac log live for one appStreams the macOS unified log live, filtered to one process or subsystem.28 Nov 2026 - Tip
name = "jellyfin"Python's f"{x=}" prints the variable name and its value in one goPrints both the expression and its value, so debug output labels itself.27 Nov 2026 - Tip
redis-cli monitor | head -n 20redis-cli monitor streams every command, so stop it after a few lines on a busy cacheShows live Redis commands for a moment while keeping the load on a busy server small.26 May 2026
Docker2
- Tip
docker compose run --rm --service-ports webdocker compose run --service-ports publishes the ports for a one-off runStarts a one-off compose container with its published ports mapped to the host.28 Nov 2026 - Tip
docker diff mycontainerdocker diff shows what a container changed in its filesystemLists every file a container added, changed or deleted compared to its image.22 Oct 2026
Storage1
AI1
CSS1
Nothing matches.