Trick
Check redirects and headers from the terminal with curl
Follow a redirect chain, check a status code, time a page and test a whole list of old URLs with curl. Each one takes a single line.
3 min read
Trick
Check redirects and headers from the terminal with curl
Follow a redirect chain, check a status code, time a page and test a whole list of old URLs with curl. Each one takes a single line.
3 min read
Trick
Use the Linux command line on Windows 11 and 10 with WSL
Open PowerShell as administrator, run wsl --install and restart. You get Ubuntu with a real bash shell, running alongside Windows.
4 min read
Trick
How to create and use shell aliases on macOS and Linux
An alias turns a long command into a short one, like alias ll='ls -lah'. Add it to ~/.zshrc on a Mac or ~/.bashrc on Linux to keep it for good.
4 min read
Trick
How to kill a process using a TCP port on Mac
Find what's holding the port with lsof -nP -iTCP:8000 -sTCP:LISTEN, then stop it with kill PID. I keep kill -9 as a last resort.
4 min read
Trick
How to add a folder to your $PATH on Mac (zsh and bash)
Add export PATH="$HOME/.local/bin:$PATH" to ~/.zprofile and open a new Terminal window. Typing export on its own only changes the current window.
5 min read
Trick
How to copy a remote folder to your computer with rsync
Run rsync -avz user@server:/path/to/folder/ ./folder/ to pull a folder over SSH. After the first copy, rsync only sends what has changed.
4 min read
Trick
How to create a symlink to a folder on Linux and Mac
Run ln -s /real/folder link-name to make a folder appear in a second place. I cover argument order, relative links, repointing with -sfn and safe removal.
5 min read