Skip to content

Instantly share code, notes, and snippets.

@bradtraversy
bradtraversy / mongodb_cheat_sheet.md
Last active February 8, 2026 18:42
MongoDB Cheat Sheet

MongoDB Cheat Sheet

Show All Databases

show dbs

Show Current Database

@zenorocha
zenorocha / etc-hosts-on-win.md
Last active January 25, 2026 17:48
/etc/hosts on Windows

1. Get your IP Address

echo `ifconfig $(netstat -nr | grep -e default -e "^0\.0\.0\.0" | head -1 | awk '{print $NF}') | grep -e "inet " | sed -e 's/.*inet //' -e 's/ .*//' -e 's/.*\://'`

2. Modify your hosts file

notepad

@Kartones
Kartones / postgres-cheatsheet.md
Last active February 9, 2026 00:44
PostgreSQL command line cheatsheet

PSQL

Magic words:

psql -U postgres

Some interesting flags (to see all, use -h or --help depending on your psql version):

  • -E: will describe the underlaying queries of the \ commands (cool for learning!)
  • -l: psql will list all databases and then exit (useful if the user you connect with doesn't has a default database, like at AWS RDS)