Skip to content

Instantly share code, notes, and snippets.

View qrkourier's full-sized avatar

Kenneth Bingham qrkourier

View GitHub Profile
@qrkourier
qrkourier / docker-get-libc-versions.bash
Created August 21, 2023 15:00
print table of Linux distros' libc versions by running a Docker container
for OS in \
oraclelinux:{7..9} \
debian:{buster,bullseye,bookworm} \
registry.access.redhat.com/ubi{8,9}/ubi \
ubuntu:{bionic,focal,jammy} \
quay.io/centos/centos:7 \
fedora:{34,35,36} \
rockylinux/rockylinux:{8,9};
do
(
@qrkourier
qrkourier / Dockerfile.debian
Last active April 8, 2025 15:52
ziti-edge-tunnel Dockerfile for Debian
# this may still be useful for building arm 32bit images, e.g., assuming the binary was built in the default path,
# docker buildx build --platform linux/arm/v7 --file ./Dockerfile.debian --tag ziti-edge-tunnel:armv7 .
#
# run command "run-host" doesn't require elevated privileges, and "docker run --network container:myserverapp" would allow this container to host services targeting the loopback interface of "myserverapp"
# docker run --name ziti-host --detach --restart unless-stopped --network host --volume ziti-host:/ziti-edge-tunnel --env ZITI_ENROLL_TOKEN="$(< /tmp/jwt)" ziti-edge-tunnel:armv7
#
FROM debian:buster-slim AS fetch-ziti-artifacts
WORKDIR /
@qrkourier
qrkourier / krun
Last active April 15, 2023 21:33
run any command in any container image in any Kubernetes namespace
# krun busybox whoami
krun(){
local NAMESPACE=default
local PRIVILEGED=false
while getopts 'n:pu:' OPT; do
case $OPT in
n) NAMESPACE=$OPTARG
;;
p) PRIVILEGED=true
LATEST_GOLANG=$(wget -qO- "https://go.dev/VERSION?m=text" | /bin/grep -Po '^go(\s+)?\K\d+\.\d+\.\d+$');
LATEST_GOLANG_ARCH=go${LATEST_GOLANG}.linux-$(dpkg --print-architecture).tar.gz;
wget -qO /tmp/${LATEST_GOLANG_ARCH} https://go.dev/dl/${LATEST_GOLANG_ARCH}
sudo tar -xf /tmp/${LATEST_GOLANG_ARCH} -C /usr/local/
echo "~/go/bin:/usr/local/go/bin:$PATH" >> ~/.bashrc
@qrkourier
qrkourier / x11vnc.service
Created December 11, 2022 16:48
x11vnc systemd user service unit
# ${HOME}/.config/systemd/user/x11vnc.service
[Unit]
Description=Attach Running x11 Server as SPICE Server
[Install]
WantedBy=default.target
[Service]
ExecStart=/usr/local/bin/x11spice
Restart=always
@qrkourier
qrkourier / build-x11spice.sh
Last active December 11, 2022 22:24
build/install x11spice on Debian
#!/usr/bin/env bash
set -euo pipefail
sudo apt install \
build-essential \
libspice-server1 \
xutils-dev \
libxcb-damage0-dev \
libxcb-xtest0-dev \
@qrkourier
qrkourier / host.v1
Created June 17, 2022 12:13
OpenZiti service configs for RKE control plane ports
{
"address": "127.0.0.1",
"allowedPortRanges": [
{
"high": 10256,
"low": 10256
},
{
"high": 4789,
"low": 4789
@qrkourier
qrkourier / export-ziti-ca.zsh
Last active September 21, 2021 19:22
ZSH script for MacOS to export the well-known (CA) certs of a Ziti controller as importable PEM and DER files
#!/usr/bin/env zsh
#
# get the well-known CA certs of a Ziti controller as importable PEM and DER files
#
# EXAMPLE
#
# $ ./export-ziti-ca.zsh 13.36.15.32
# SUCCESS: certificates exported in /tmp/export-ziti-ca-13-36-15-32/:
# total 16K
# -rw-rw-r-- 1 kbingham kbingham 1.7K Sep 20 12:47 NetFoundry.der
@qrkourier
qrkourier / export-ziti-ca.bash
Last active September 21, 2021 19:22
BASH script for Linux to export the well-known (CA) certs of a Ziti controller as importable PEM and DER files
#!/usr/bin/env zsh
#
# get the well-known CA certs of a Ziti controller as importable PEM and DER files
#
# EXAMPLE
#
# $ ./export-ziti-ca.sh 13.36.15.32
# SUCCESS: certificates exported in /tmp/export-ziti-ca-13-36-15-32/:
# total 16K
# -rw-rw-r-- 1 kbingham kbingham 1.7K Sep 20 12:47 NetFoundry.der
@qrkourier
qrkourier / csv2aws.bash
Created September 13, 2021 21:40
Source the CSV IAM credential download in BASH
#!/usr/bin/env bash
set -o pipefail -e -u
[[ ${#@} -eq 1 && "$1" =~ .csv$ ]] || {
echo "ERROR: need a CSV file to convert" >&2
exit 1
}
CSV_FILE="$1"