Skip to content

Instantly share code, notes, and snippets.

View leetrout's full-sized avatar
🎸

Lee Trout leetrout

🎸
View GitHub Profile
@leetrout
leetrout / lambda-build.sh
Created October 7, 2025 03:14
Building a lambda with uv
#!/usr/bin/env bash
# Build a .zip compatible with AWS Lambda
set -euo pipefail
# operate from the same directory as this script
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
cd "$SCRIPT_DIR"
# By default create lambda.zip for Python 3.13 on amd64
OUTPUT_ZIP="${OUTPUT_ZIP:-lambda.zip}"
@leetrout
leetrout / latency.markdown
Created June 10, 2025 14:27 — forked from hellerbarde/latency.markdown
Latency numbers every programmer should know

Latency numbers every programmer should know

L1 cache reference ......................... 0.5 ns
Branch mispredict ............................ 5 ns
L2 cache reference ........................... 7 ns
Mutex lock/unlock ........................... 25 ns
Main memory reference ...................... 100 ns             
Compress 1K bytes with Zippy ............. 3,000 ns  =   3 µs
Send 2K bytes over 1 Gbps network ....... 20,000 ns  =  20 µs
SSD random read ........................ 150,000 ns  = 150 µs

Read 1 MB sequentially from memory ..... 250,000 ns = 250 µs

@leetrout
leetrout / README.md
Last active May 1, 2025 16:01
AWS ALB GROK PATTERN
@leetrout
leetrout / 1_hour_dry_cleaning.lbrn2
Created August 2, 2024 21:51
1 Hour Dry Cleaning
<?xml version="1.0" encoding="UTF-8"?>
<LightBurnProject AppVersion="1.6.03" FormatVersion="1" MaterialHeight="0" MirrorX="False" MirrorY="False">
<Thumbnail Source="iVBORw0KGgoAAAANSUhEUgAAAQAAAAEACAYAAABccqhmAAAACXBIWXMAABYlAAAWJQFJUiTwAAAgAElEQVR4nO2deXycVb3/P+dZZ0kymaxN0qb7RpuWFmpboIDsiKLsIGhRQa+iqFe91+XFxatcr16vVxFF/SH3trIjO8oighQoW1taOm3TNWn2PTOZZLZnO78/nmyTmSSTZGaemcl5v155QWee55zvJHM+zznf8z3fL6GUUjCyH8NA9549kN1uKH4/enfvhrO6Gs4FCyC5XNBVFXnV1VZbycgwBKsNYEwPxefDkd/9DiefeAKq34/+EyfAiyIc1dWQCgoQ7u6GVFgIQ1Gg9PUh0t0NUIqi9evhXrMGHM+j8uKLUX3FFVZ/FIaFEDYDyB766+qw5zvfQc/evVC8XhStW4eqiy/G/KuuQv6SJZPer4VC8Hk88O7fj5YXXoC3thaRzk7M++Qnkb9wIdbccUcaPgUjk2ACkAW897Wvof3116EHgyjduBErvvY1lG7enJS2I729aHr2WRz+zW/Qu28fVn7jG1h5++3Imz8/Ke0zMhsmABnMvjvvxNE//AGOefOw4Re/QPnZZ6e0P6rrqL37btT++tfQFQXn/vnPKDvzzJT2ybAWJgAZSN1DD+Gtm2/Gsltvxdo774S9vDztNtT+6lc4vn07ClevxsZf/xqS2512GxiphwlABtH6t79h1ze/iaJ16/CRu++GXFxstUmoe/BBvHvbbdh0771YdOONVpvDSDJMADKA1ldegXf/fuz/8Y9x3rPPovycc6w2KYqB+nq8fO65+Ni778JeUWG1OYwkwrYBLeavmzbBCIdRccEFuMHns9qcuO
@leetrout
leetrout / pxe-boot.md
Created July 7, 2024 17:28 — forked from Rafisto/pxe-boot.md
pxe-boot

How to easily setup PXE boot for cluster provisioning

This guide will show you how to setup a PXE boot server to provision a cluster of machines. For the sake of this guide, we will be using system agnostic docker containers to simulate the DHCP and the PXE boot server.

Featured technologies:

PXE boot description

@leetrout
leetrout / pxe-boot.sh
Created July 7, 2024 17:25 — forked from spipm/pxe-boot.sh
Create (UEFI/Secureboot) PXE boot server on interface
#!/bin/bash
# Run PXE boot server on interface
# Seems to work with UEFI and Secureboot
# Spip, 2023
#
# Most stuff from https://www.youtube.com/watch?v=E_OlsA1hF4k
#
# Check args
@leetrout
leetrout / all-the-way-downify.sh
Created April 20, 2023 17:41 — forked from lafentres/all-the-way-downify.sh
:*-all-the-way-down: Slack emoji creator, based off alisdair/intensify.sh
#!/bin/bash
# Credit to https://gist.github.com/alisdair/ffc7c884ee36ac132131f37e3803a1fe for the excellent original
# script that this one is based on. This script modifies the original to create the all-the-way-down effect.
# Generate a `:*-all-the-way-down:` Slack emoji, given a reasonable image
# input. I recommend grabbing an emoji from https://emojipedia.org/
set -euo pipefail
@leetrout
leetrout / jumboify.sh
Created April 20, 2023 17:41 — forked from lafentres/jumboify.sh
Jumbo Slack emoji creator, based off alisdair/intensify.sh
#!/bin/bash
# Credit to https://gist.github.com/alisdair/ffc7c884ee36ac132131f37e3803a1fe for the excellent original
# script that this one is based on. This script modifies the original to create the jumbo.
# Generate a jumbo Slack emoji, given a reasonable image
# input. I recommend grabbing an emoji from https://emojipedia.org/
set -euo pipefail
@leetrout
leetrout / debug.js
Created February 26, 2023 04:58
Minecraft WorldEdit debug script
/**
* Small helper script to debug via printing in WorldEdit CraftScript.
* Save this file as debug.js in your WorldEdit config folder:
* e.g. config/worldedit/craftscript/debug.js
*
* Use in the console:
* /cs debug
* /cs debug player
*
* With no arguments this script will print all globals.
@leetrout
leetrout / partyify.sh
Created July 15, 2022 12:49 — forked from lafentres/partyify.sh
:something-party: Slack emoji creator, based off alisdair/intensify.sh
#!/bin/bash
# Generate a `:something-party:` Slack emoji, given a reasonable image
# input. I recommend grabbing an emoji from https://emojipedia.org/
set -euo pipefail
if [ $# -eq 0 ]; then
echo "Usage: $0 input.png"
exit 1