Skip to content

Instantly share code, notes, and snippets.

@mradbourne
Last active July 30, 2018 17:06
Show Gist options
  • Save mradbourne/0c2a291c65c9e969a07d9b02fce4daf4 to your computer and use it in GitHub Desktop.
Save mradbourne/0c2a291c65c9e969a07d9b02fce4daf4 to your computer and use it in GitHub Desktop.
Common Terminal commands
# See what's running on port 5000
lsof -i :5000
# Find Foreman processes
ps aux | grep foreman
# Kill process
kill -9 PID
# PostgreSQL - Restore DB from dump
pg_restore --verbose --clean --no-owner -d dbname filename.dump
# git - Revert a commit not pushed
git commit -m "Something terribly misguided"
git reset HEAD~
### edit files as necessary
git add ...
git commit -c ORIG_HEAD
# git - Revert a commit already pushed
git reset HEAD^ --hard
git push origin -f
# git - Revert a single file to head version
git checkout HEAD -- my-file.txt
# docker - Delete all containers
docker rm $(docker ps -a -q)
# docker - Delete all images
docker rmi $(docker images -q)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment