Skip to content

Instantly share code, notes, and snippets.

View alfonso1003's full-sized avatar
😮
wow

alfonso1003

😮
wow
View GitHub Profile
@magnetikonline
magnetikonline / README.md
Last active November 10, 2024 19:59
Bash getopts template.

Bash getopts template

#!/bin/bash -e

function usage {
	cat <&2
@Kartones
Kartones / postgres-cheatsheet.md
Last active June 13, 2025 02:49
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)
@bortzmeyer
bortzmeyer / gist:1284249
Created October 13, 2011 13:42
The only simple way to do SSH in Python today is to use subprocess + OpenSSH...
#!/usr/bin/python
# All SSH libraries for Python are junk (2011-10-13).
# Too low-level (libssh2), too buggy (paramiko), too complicated
# (both), too poor in features (no use of the agent, for instance)
# Here is the right solution today:
import subprocess
import sys