Skip to content

Instantly share code, notes, and snippets.

@Elektordi
Elektordi / jwt-decode.sh
Last active July 31, 2023 13:51
Decode jwt from command line
#!/bin/sh
token="$1"
if [ -z "$token" ]; then
read token
fi
echo $token | jq -R 'gsub("-";"+") | gsub("_";"/") | split(".") | select(length > 0) | .[0],.[1] | @base64d | fromjson'
echo
@MadmanMonty
MadmanMonty / ESP32 CAM setup
Created April 2, 2021 08:51
ESP32 CAM Tasmota Template, with LED1 and Light configuration. The default on the tasmota website incorrectly defines these, preventing activation of the light.
{"NAME":"AITHINKER CAM inc LEDs","GPIO":[4992,1,1,1,416,5088,1,1,1,1,1,1,1,1,5089,5090,0,5091,5184,5152,0,5120,5024,5056,0,0,0,0,4928,320,5094,5095,5092,0,0,5093],"FLAG":0,"BASE":1}
@Elektordi
Elektordi / saml-decode.sh
Last active April 11, 2024 12:05
Decode SAML payload from command line
#!/bin/sh
token="$1"
if [ -z "$token" ]; then
read token
fi
echo $token | sed -e "s/-/+/" -e "s/_/\//" | base64 -d | xmllint --format --recover -
echo
@ctrl-freak
ctrl-freak / purestorage-hdparm-secure-erase.sh
Created October 1, 2023 11:55
Clear ATA Security Lock (Encryption) on ex-Pure Storage array drives
# Done successfully on a Toshiba THNSNJ512GCSY
# WARNING: ALL DATA ON THE DRIVE WILL BE LOST; DON'T DO THIS UNLESS YOU KNOW ITS WHAT YOU NEED
# This is a series of shell commands, not a functional script
# Once unlocked, the drive should be able to be initialized/MBR written and partitions created.
sudo -s
# Identify drives
lsblk