Skip to content

Instantly share code, notes, and snippets.

View xFuture603's full-sized avatar
💭
🕵🏿 Greetings!

Daniel xFuture603

💭
🕵🏿 Greetings!
View GitHub Profile
@Kartones
Kartones / postgres-cheatsheet.md
Last active November 15, 2024 21:14
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)
@Cactiw
Cactiw / sentry_backup_fix.py
Created December 17, 2022 21:47
This is quick fix for sentry generated backup.json file.
import json
FILENAME = "backup.json"
FILENAME_FIXED = "backup_fixed.json"
def restore():
with open(FILENAME, "r") as f:
lines = f.readlines()
lines = lines[lines.index('[\n'):]