Skip to content

Instantly share code, notes, and snippets.

View alexlovelltroy's full-sized avatar
🏫
Attending Marcel Marceau College of Radio Performance

Alex Lovell-Troy alexlovelltroy

🏫
Attending Marcel Marceau College of Radio Performance
View GitHub Profile
@alexlovelltroy
alexlovelltroy / jwt-client.py
Created September 2, 2024 14:05
OIDC client_assertion with private key jwt for authelia
#!/usr/bin/env python
## Demonstration code for confirming that https://github.com/authelia/authelia/issues/7790 is fixed in authelia
## Tested with the OIDC suite.
## Be sure to add the client public key (~/.config/jwt-client/public.pem) to your configuration.yml once both have been created
## python script.py auth --client-id=oidc-tester-app-2 --auth-url=https://login.example.com:8080 --redirect-uri=https://oidc.example.com:8080/oauth2/callback --insecure
## MIT License. Do what you want.
"""
Copyright (c) 2024 [email protected]
Permission is hereby granted, free of charge, to any person obtaining a copy
@alexlovelltroy
alexlovelltroy / Dockerfile
Created June 6, 2024 16:30
Dockerfile for running OpenBMC locally
# Use a base image suitable for OpenBMC
FROM ubuntu:24.04
# Install necessary dependencies for OpenBMC
RUN apt-get update && apt-get install -y \
git \
build-essential \
cmake \
qemu-system \
bash \
@alexlovelltroy
alexlovelltroy / .bashrc
Last active August 30, 2024 14:18
Portable dotfiles
# .bashrc
# curl -sSL https://gist.github.com/alexlovelltroy/70af48b195bec4f9c7d0faaa9dd217b3/raw -o ~/.bashrc
# If not running interactively, don't do anything
case $- in
*i*) ;;
*) return;;
esac
# Source global definitions
@alexlovelltroy
alexlovelltroy / Vagrantfile
Last active April 17, 2024 16:46
OpenCHAMI development vagrantfile
$script = <<SCRIPT
# Refresh the packages and install the necessary ones
dnf config-manager --set-enabled crb
dnf install -y epel-release && dnf update --refresh -y
dnf install -y dkms kernel-devel kernel-headers gcc make bzip2 perl elfutils-libelf-devel vim-enhanced git clang jq telnet
dnf groupinstall -y 'Development Tools'
# Install a modern version of the go programming language
curl -LO https://go.dev/dl/go1.21.9.linux-amd64.tar.gz && tar -C /usr/local -xzf go1.21.9.linux-amd64.tar.gz
@alexlovelltroy
alexlovelltroy / mirror_repos.sh
Created May 7, 2023 04:10
Mirror a set of packages from public repositories to a new private ECR
#!/bin/bash
# Define the containers you want to mirror from Docker Hub to ECR
containers=(\
"confluentinc/cp-zookeeper:6.1.11"\
"confluentinc/cp-kafka:6.1.11"\
"minio/mc:RELEASE.2023-04-12T02-21-51Z" \
"hashicorp/vault:1.13" \
"postgres:11-alpine" \
"alpine:3.16" \
@alexlovelltroy
alexlovelltroy / latest_gh_releases.sh
Created May 15, 2021 14:53
Bash script for retrieving the latest released versions of all the stuff I star on github
#!/bin/bash
GH_USER=${1-$USER}
REPOS=`curl -s https://api.github.com/users/$GH_USER/starred |grep full_name | cut -f 4 -d\" |xargs`
for REPO in $REPOS; do
VERSION=`curl -s https://api.github.com/repos/$REPO/releases |grep tag_name |grep -v rc | head -1 |cut -f4 -d\"`
echo "$REPO : $VERSION"
done
@alexlovelltroy
alexlovelltroy / index.js
Created June 16, 2020 09:18
Cloudflare Worker Mnemonic-as-a-Service
addEventListener('fetch', event => {
event.respondWith(handleRequest(event.request))
})
var wordlist = ["acrobat", "africa", "alaska", "albert", "albino", "album",
"alcohol", "alex", "alpha", "amadeus", "amanda", "amazon",
"america", "analog", "animal", "antenna", "antonio", "apollo",
"april", "aroma", "artist", "aspirin", "athlete", "atlas",
"banana", "bandit", "banjo", "bikini", "bingo", "bonus",
"camera", "canada", "carbon", "casino", "catalog", "cinema",
@alexlovelltroy
alexlovelltroy / DaemonSet.yaml
Last active May 6, 2019 20:33
DaemonSet for controling the light rings on NUCs. Kubernetes running on debian stretch
apiVersion: apps/v1
kind: DaemonSet
metadata:
name: nuc-light-control
spec:
selector:
matchLabels:
name: nuc-light-control
template:
metadata:
from debian:stretch-slim as builder
RUN apt-get -y update
RUN apt-get -y install build-essential linux-headers-$(uname -r)
RUN apt-get -y install debhelper dkms kmod unzip
RUN curl -LO https://github.com/milesp20/intel_nuc_led/archive/master.zip && unzip master.zip
RUN cd intel_nuc_led-master && make clean && make dkms-install
from alpine as base
RUN apk update --no-cache && apk add kmod --no-cache
@alexlovelltroy
alexlovelltroy / create_vms.sh
Created February 21, 2019 16:11
Create, Load, and Start a bunch of simple firecracker vms
#!/bin/bash
echo "Bash version ${BASH_VERSION}..."
FIRECRACKER_BIN=/usr/bin/firecracker
JAILER_BIN=/usr/bin/jailer
echo -n "Jailer version "
$JAILER_BIN -V
echo -n "Firecracker version "