Skip to content

Instantly share code, notes, and snippets.

View lordjabez's full-sized avatar
🔧
https://makingofthings.com

Judson Neer lordjabez

🔧
https://makingofthings.com
View GitHub Profile
@lordjabez
lordjabez / get-auth0-access-token.py
Created June 7, 2025 20:39
Get an Auth0 access token via script
#!/usr/bin/env python3
import getpass
import os
import requests
auth0_url = os.environ['AUTH0_URL']
@lordjabez
lordjabez / get-security-findings.py
Created June 6, 2025 01:55
Get AWS Security Hub findings
#!/usr/bin/env python3
import csv
import sys
import boto3
# USAGE: ./get-security-findings.py severity1,severity2 findings.csv
@lordjabez
lordjabez / get-route53-zonefile.bash
Created May 21, 2025 17:26
Create a zonefile from Route53
#!/bin/bash
hosted_zone_name="$1"
hosted_zone_id=$(aws route53 list-hosted-zones --output text --query "HostedZones[?Name==\`$hosted_zone_name.\`].Id")
aws route53 list-resource-record-sets --hosted-zone-id "$hosted_zone_id" --output json | jq -jr '.ResourceRecordSets[] | "\(.Name)\t\(.TTL)\t\(.Type)\t\(.ResourceRecords[]?.Value)\n"'
@lordjabez
lordjabez / sublime-settings.json
Created May 10, 2025 23:47
Sublime Text Configuration
{
"ensure_newline_at_eof_on_save": true,
"font_face": "MonaspaceNeon-Regular",
"font_size": 12,
"save_on_focus_lost": true,
"theme": "Default Dark.sublime-theme",
"translate_tabs_to_spaces": true,
"rulers": [120],
"ignored_packages":
[
@lordjabez
lordjabez / restart-network.bash
Last active February 3, 2025 01:06
Restart network on MacOS
#!/usr/bin/env bash
set -e
# Run with sudo
ifconfig en0 down
route flush
ifconfig en0 up
dscacheutil -flushcache
@lordjabez
lordjabez / terraform-docker
Created December 25, 2024 00:55
Run terraform in Docker
#!/bin/bash -e
TF_VERSION=1.1.6
docker run -i -t --platform linux/amd64 -e AWS_PROFILE="$AWS_PROFILE" -v "$HOME/.aws":/root/.aws -v "$PWD":/mnt -w /mnt "hashicorp/terraform:$TF_VERSION" $@
@lordjabez
lordjabez / update-domains.py
Created December 15, 2024 03:19
Bulk update domains in Route 53
#!/usr/bin/env python3
import boto3
import time
route53_client= boto3.client('route53domains')
response = route53_client.list_domains(MaxItems=100)
@lordjabez
lordjabez / aws-account-actions.py
Created November 2, 2024 02:21
Do a thing across all AWS accounts in an organization
#!/usr/bin/env python3
import boto3
orgs_client = boto3.client('organizations')
sts_client = boto3.client('sts')
@lordjabez
lordjabez / connect-to-vpn
Created October 24, 2024 19:05
Use openconnect to log into a Cisco-compatible VPN
#!/usr/bin/env bash
set -e
# Prerequisites:
# brew install openconnect xmlstarlet
# pip install keyring
# curl https://raw.githubusercontent.com/sailfishos-mirror/openconnect/refs/heads/master/trojans/csd-post.sh
# keyring set HOSTNAME USERNAME
# Usage:
from bottle import request, route, run, redirect
redirect_url = 'https://example.com/foo
@route('/foo')
def job():
requestor_id = request.query['requestor_id']
print(f'{requestor_id} clicked the link')
redirect(redirect_url)