Terminal

ctrl + a // start of line (twice if mapped to tmux prefix)
ctrl + e // end of line
alt + arrows // word at a time
alt + b // move the cursor backwards one word
alt + f // move the cursor forward one word
ctrl + k // delete from cursor to the end of the line
ctrl + u // delete from cursor to the beginning of the line
alt + d // delete the word in front of the cursor
ctrl + w // delete the word behind of the cursor

ctrl + r // search history (and again to scroll through)
ctrl + s // search histor in other direction
ctrl + n // next command (instead of down arrow)
ctrl + p // previous command (instead of up arrow)

ctrl-z // move the current process to the background in a suspended state
jobs -l // list the current background processes for the current tty session
bg // tell the most recent background process to continue running in the background
fg // bring the most recent background process back to the foreground
disown -h disown the most recent background job. This will remove it from your current tty session. It will not be able to be brought back to the foreground. You will have to control it either with kill or something else.

bg, fg, and disown can be used with the job number found in jobs -l

less /path/to/file // open and read file with pagination

tmux

Default PREFIX = control + b 
A user-specific configuration file should be located at ~/.tmux.conf.
A global configuration file should be located at /etc/tmux.conf.

tmux list-keys list bound tmux keys
tmux list-commands list tmux commands
tmux info list session info
tmux source-file ~/.tmux.conf source updated conf

pbcopy / pbpaste

pbcopy < ~/.ssh/id_rsa.pub // # copy my public ssh key to system clipboard for pasting into Github
pbpaste > main.go // paste something I've copied from the internet to a file
pbpaste >> main.go // append something I've copied from the internet to the END a file
curl -Ss icanhazip.com | pbcopy // copy my public IP address to clipboard
ip addr show en0 | grep -inet\ | awk '{ print $3 }' | awk -F/ '{print $1}' | pbcopy // copy my private IP address to clipboard
pbpaste | base64 | pbcopy // replace what is in my clipboard with the base64 encoded version of itself

Sublime

ln -s "/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl" /usr/local/bin/subl // symlink subl cli to path

Web Server

python -m SimpleHTTPServer // Access it at your_local_ip:8000
http-server

Cookies

1. Client GET request
2. Server Response OK
Set-Cookie header
- session cookie: if no expiry will be deleted by browser on close
- sessionToken: with expiry, will last as long as expiry (for example, used to handle logged in state)
3. Client GET request
Cookie header