Skip to content

Instantly share code, notes, and snippets.

View frobware's full-sized avatar
🌴
On vacation

Andrew McDermott frobware

🌴
On vacation
  • Red Hat
  • UK
  • 07:18 (UTC)
View GitHub Profile
@frobware
frobware / config
Created January 2, 2025 12:12
ghostty config
# keybind = alt+physical:one=unbind
# keybind = alt+physical:two=unbind
# keybind = alt+physical:three=unbind
# keybind = alt+physical:four=unbind
# keybind = alt+physical:five=unbind
#keybind = clear
keybind = shift+up=adjust_selection:up
keybind = shift+left=adjust_selection:left
@frobware
frobware / ghostty-keybindings.sh
Last active January 10, 2025 19:04
ghostty-customize-menu-shortcuts
#!/usr/bin/env bash
# Reset and customise menu bar shortcuts for the Ghostty macOS app.
# Restart the app to apply the new bindings.
set -euo pipefail
# Constants for modifier keys.
CMD="@"
CTRL="^"
@frobware
frobware / BUILD-OPENSSL-1.md
Last active November 11, 2024 13:26
Running OpenShift's HAProxy Linked Against OpenSSL 1.1 on Modern RHEL/Fedora Systems

These instructions explain how to build OpenSSL 1.1 and the traditional libcrypt (specifically libcrypt.so.1 from older versions of glibc). This enables us to run versions of OpenShift's HAProxy that were linked against OpenSSL 1.1 and the older libcrypt on RHEL/Fedora systems where the runtime platform now only provides OpenSSL 3 and the newer libxcrypt. We need the older libcrypt because the OpenShift HAProxy build depends on it, and the newer libxcrypt is not fully backward compatible with the original libcrypt.

Build OpenSSL 1.1.1 on Fedora 40 (possibly RHEL?)

@frobware
frobware / cross-build.sh
Created September 10, 2024 13:06
cross-build bpfman using rust image.
#!/usr/bin/env bash
set -eu
# Detect the host architecture dynamically
host_arch=$(uname -m)
# Map common architecture names to their corresponding Rust target format.
arch_map() {
case "$1" in
@frobware
frobware / bpfdaemon.yaml
Created August 28, 2024 13:00
bpfdaemon with Nix paths mounted
apiVersion: apps/v1
kind: DaemonSet
metadata:
name: daemon
namespace: kube-system
spec:
template:
spec:
containers:
- name: bpfman-supervisor
@frobware
frobware / README-git-crypt.md
Created June 15, 2024 20:31
git-crypt setup

Initialise Repository with git-crypt

Initialise the repository:

$ git-crypt init

Git Attributes Setup

@frobware
frobware / NE1690.md
Last active May 7, 2024 17:26
NE1690: Analyse Memory Impact of Pre-Allocated Server Slots for Different Numbers of Routes

HAProxy version 2.8.5-aaba8d0 2023/12/07 - https://haproxy.org/

Algorithm=leastconn, Weight=1 maxconn=50000 (T=#Threads B=#Backends)

server-template range: 0..N  T4 B100 RSS (MB)  T4 B1000 RSS (MB)  T4 B10000 RSS (MB)  T64 B100 RSS (MB)  T64 B1000 RSS (MB)  T64 B10000 RSS (MB)
---------------------------  ----------------  -----------------  ------------------  -----------------  ------------------  -------------------
                          0                12                 18                  81                 17                  24                   86
                          1                12                 22                 123                 18                  32                  168
                          2                13                 27                 166                 19                  40                  249
                
@frobware
frobware / OCPBUGS-29690-match-weight-is-0
Created April 11, 2024 14:01
OCPBUGS-29690: Match weight == 0
#!/usr/bin/env perl
use strict;
use warnings;
# Store the current backend block.
my $backend_block = '';
# Flag to start capturing lines into the backend block.
my $capture_block = 0;
@frobware
frobware / OCPBUGS-29690-fix-weight256
Created April 9, 2024 12:33
Replace 'weight 256' with 'weight 1' for backends with a single server entry
#!/usr/bin/env perl
use strict;
use warnings;
use Getopt::Long;
use Digest::MD5 qw(md5_hex);
my $obfuscate = 0; # No obfuscation by default.
my $fix_singular_weight256 = 0; # Conditionally rewrite 'weight 256'