A collection of commands that are useful and I never seem to remember off the top of my head.
curl -i -X POST -H "Content-Type: multipart/form-data" -F "email@example.com" http://127.0.0.1:8000/files/upload
Setup a poor-man's secure tunnel and proxy traffic over ssh to a remote server. Useful when needing to access corporate networks without the benefit of a fully fledged VPN.
ssh -N -D 8080 [USER]@[SERVER_IP]
After setting up the tunnel, you need to setup your system to use the proxy. System Preferences -> Network -> Advanced -> Proxies
Tunnel a remote port to a local port on your machine. Useful for accessing remote ports (e.g. databases) as if they were running on localhost.
ssh -L <locally accessible port>:<ip address to bind to>:<remote port> firstname.lastname@example.org
ssh -L 5434:127.0.0.1:5432 email@example.com
Recursively find and replace all instances
foo and replace it with
hoge, excluding the migrations directory. Using ripgrep because it's fast / ignores files in your .gitignore. Does not create a backup of modified files because, you're using git, right?!
Command is for FreeBSD sed, as found on macOS.
rg 'foo' -g '!migrations/' --files-with-matches -0 | xargs -0 sed -i '' 's/foo/hoge/g'