Skip to content

Instantly share code, notes, and snippets.

View haircommander's full-sized avatar

Peter Hunt haircommander

View GitHub Profile
@haircommander
haircommander / cri-o.spec
Last active August 6, 2021 14:59
Proposal for new CRI-O spec file
# https://github.com/cri-o/cri-o
%global goipath github.com/cri-o/cri-o
Version: 1.21.2
%if 0%{?rhel} && 0%{?rhel} <= 8
%define gobuild(o:) %{expand:
# https://bugzilla.redhat.com/show_bug.cgi?id=995136#c12
%global _dwz_low_mem_die_limit 0
%ifnarch ppc64
go build -buildmode pie -compiler gc -tags="rpm_crashtraceback ${BUILDTAGS:-}" -ldflags "${LDFLAGS:-}%{?currentgoldflags} -B 0x$(head -c20 /dev/urandom|od -An -tx1|tr -d ' \\n') -extldflags '%__global_ldflags %{?__golang_extldflags}' -compressdwarf=false" -a -v -x %{?**};
@haircommander
haircommander / solve.py
Created April 29, 2020 16:08
mdame's impossible problem
#!/usr/bin/python3
import itertools
operations = []
# thanks to https://www.geeksforgeeks.org/print-all-combinations-of-given-length/
# for reminding (telling) me how to permute every possible string of length k that can be formed from a set of n characters
# The method that prints all
# possible strings of length k.
#!/usr/bin/env bash
set -euo pipefail
IFS=$'\n\t'
export KUBE_CONTAINER_RUNTIME=remote
export KUBECONFIG=/var/run/kubernetes/admin.kubeconfig
export GOPATH=/home/pehunt/go
export PATH=/usr/local/go/bin:/usr/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/root/bin:$GOPATH/bin:$GOPATH/src/k8s.io/kubernetes/third_party/etcd:$GOPATH/src/k8s.io/kubernetes/_output/local/bin/linux/amd64
IP=$(hostname -I | cut -d' ' -f1)
@haircommander
haircommander / cri-o-kubeadm
Last active December 27, 2020 06:19
An /etc/default/kubelet file to quickly configure kubelet variables to use CRI-O with kubeadm
KUBELET_EXTRA_ARGS=--feature-gates="AllAlpha=false,RunAsGroup=true" --container-runtime=remote --cgroup-driver=systemd --container-runtime-endpoint='unix:///var/run/crio/crio.sock' --runtime-request-timeout=5m
#!/bin/bash -e
set -x
set -u
IP=$(hostname -I | cut -d' ' -f1)
echo "Using IP: $IP"
export GOROOT=/usr/local/go
export GOPATH=/home/pehunt/go
export KUBE_PATH="$GOPATH/src/github.com/kubernetes/kubernetes"
export GO_OUT=$KUBE_PATH/_output/local/bin/linux/amd64/