Skip to content

Instantly share code, notes, and snippets.

View thomasem's full-sized avatar
👻

Thomas Maddox thomasem

👻
View GitHub Profile
@KevCui
KevCui / jwtDecoder.sh
Last active September 7, 2020 09:08
A Bash script to decode JWT token
#!/usr/bin/env bash
# HOW TO USE:
# ~$ chmod +x jwtDecoder.sh
# ~$ ./jwtDecoder.sh "<JWT token>"
padding() {
# $1: base64 string
local m p=""
m=$(( ${#1} % 4 ))
[[ "$m" == 2 ]] && p="=="
@Kartones
Kartones / postgres-cheatsheet.md
Last active July 25, 2024 09:09
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)