Skip to content

Instantly share code, notes, and snippets.

View beezly's full-sized avatar

Andrew Beresford beezly

View GitHub Profile
@beezly
beezly / xbar.config.json
Last active March 31, 2026 15:11
xbar config to use ghostty for terminal commands
{
"terminal": {
"appleScriptTemplate3": "\n\t\t\tset quotedScriptName to quoted form of \"{{ .Command }}\"\n\t\t{{ if .Params }}\n\t\t\tset commandLine to {{ .Vars }} & \" \" & quotedScriptName & \" \" & {{ .Params }}\n\t\t{{ else }}\n\t\t\tset commandLine to {{ .Vars }} & \" \" & quotedScriptName\n\t\t{{ end }}\n\t\t\tdo shell script \"open -na Ghostty.app --args --command=\" & quoted form of commandLine\n\t\t"
}
}
{
"did": "did:plc:ean7ppbuulyscdhoxip3dplh"
}
{
"did": "did:plc:ean7ppbuulyscdhoxip3dplh"
}
@beezly
beezly / gist:5d78289bdb0caf16a2c7fc77215ae9ea
Last active February 5, 2026 13:57
examinerlive-privacy-plus-blocker.txt
! Title: Examiner Live Privacy Plus Blocker
! Description: Blocks the "Privacy Plus" paywall and consent nags on examinerlive.co.uk
! Homepage: https://gist.github.com/beezly/5d78289bdb0caf16a2c7fc77215ae9ea
! License: Public Domain
! Last modified: 2026-02-05
! ============================================
! HOW TO USE WITH UBLOCK ORIGIN
! ============================================
! 1. Open uBlock Origin settings (click the extension icon, then the gear
@beezly
beezly / gist:7553d9f76e6736ba21359a66a4da735f
Created August 20, 2025 12:33
Every 4-digit credit card PIN number in the world.
0000
0001
0002
0003
0004
0005
0006
0007
0008
0009
@beezly
beezly / gcd.rs
Last active February 26, 2024 15:51
Demo rust code for calculating Greatest Common Denominators using Euclidian Algorithm
use std::time::Instant;
const ITERATIONS: i32 = 100000000;
fn main() {
let mut line = String::new();
println!("Input your numbers: ");
let _ = std::io::stdin().read_line(&mut line).unwrap();
let mut split = line.split_whitespace();
let a = split.next().unwrap().parse().unwrap();
@beezly
beezly / ssm-rdp.sh
Created April 28, 2020 10:04
This pile of garbage will so SSM RDP on a Mac if you have the aws-cli and Microsoft RDP client installed. I'm not proud of this but it was useful to me.
#!/usr/bin/env zsh -e
LOCAL_PORT=$(( $RANDOM + 32767 )) # Handily $RANDOM gives a number between 0 and 32767, so this will give us a random port between 32767-65535
REMOTE_PORT=3389
target_id=$1
aws ssm start-session --region eu-west-1 --target "${target_id}" --document-name AWS-StartPortForwardingSession --parameters "localPortNumber=${LOCAL_PORT},portNumber=${REMOTE_PORT}" &
SESSION_PID=$!
RD_TEMP=$(mktemp -d)
@beezly
beezly / demo.c
Created April 11, 2020 17:11
MMX/SSE demo
/*
On a VM I got...
Allocating 134217728 bytes of RAM and writing a pattern to it.
allocate_ram: Took 15770 cycles
before first x86_add: Address 0xafd54010: 00000000000000000000000000000000
after first x86_add: Address 0xafd54010: 02020202020202020202020202020202
after last x86_add: Address 0xafd54010: cacacacacacacacacacacacacacacaca
x86_add: Took 13213002422 cycles
@beezly
beezly / op-wrapper.sh
Last active February 20, 2020 11:03
1password CLI wrapper - caches your "my" login token
#!/bin/bash -e
# You can use this script in two ways
# 1. Source it in to an existing script to get access to your credentials
# e.g.
# #!/bin/bash
# . ~/bin/op-wrapper
# details=$(op get item 'Top Secret Password')
# 2. Wrap another script or command with this script
# e.g.
# ~/bin/op-wrapper ./myscript up down left right
@beezly
beezly / aws-rotate-key.sh
Last active February 12, 2020 15:01
My shonky script for rotating AWS CLI access credentials - requires jq
#!/bin/bash -e
# First step, backup the old creds
tsec=$(date +%s)
pushd ~/.aws >/dev/null
tar -zcf "credential-backup-${tsec}.tar.gz" config credentials
popd > /dev/null
# Get the current key ID