Skip to content

Instantly share code, notes, and snippets.

@aegrumet
aegrumet / decrypt-nextauth-jwe.go
Created December 4, 2022 01:24
Decrypt a NextAuth jwe from somewhere else
package main
import (
"crypto/sha256"
"fmt"
"io"
"github.com/lestrrat-go/jwx/v2/jwa"
"github.com/lestrrat-go/jwx/v2/jwe"
"golang.org/x/crypto/hkdf"
@aegrumet
aegrumet / gist:6374367
Last active December 21, 2015 22:19
AWS command-line jq commands
# ec2 instance info
aws ec2 describe-instances | sed -e 's/"Key"/"key"/' -e 's/"Value"/"value"/' |jq -c '[.Reservations[].Instances[]|{PrivateIpAddress,PublicIpAddress, AZ: .Placement.AvailabilityZone, Name: (.Tags|from_entries|.Name)}]|sort_by(.Name)[]'
# ec2 instance info with filter
aws --profile us ec2 describe-instances --filters '[{"Name":"tag-key","Values":["Name"]}, {"Name":"tag-value","Values":["*agentserver*"]}]' | sed -e 's/"Key"/"key"/' -e 's/"Value"/"value"/' |jq -c '[.Reservations[].Instances[]|{PrivateIpAddress,PublicIpAddress, AZ: .Placement.AvailabilityZone, Name: (.Tags|from_entries|.Name)}]|sort_by(.Name)[]'
# ebs snapshot info