Skip to content

Instantly share code, notes, and snippets.


Colin Walters cgwalters

Block or report user

Report or block cgwalters

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
cgwalters /
Created Jan 2, 2020
Extend previous coreos-assembler build with a new AWS region
cgwalters /
Last active Dec 17, 2019
fio RHCOS LUKS null cipher vs direct XFS
cgwalters / gist:5741d640f4c2af811f47c043de392c32
Created Dec 13, 2019
Overriding content in an old RHCOS AMI for testing
View gist:5741d640f4c2af811f47c043de392c32
First, given a build like:
Download the qemu image:
$ curl -L | gunzip > rhcos-43.81.201911081536.0-qemu.x86_64.qcow2
Download new RPM or other content you want, in this case let's assume it's a new hyperkube we want to drop in `/usr/bin`:
`$ curl -L http://example/openshift-hyperkube-4.3.0-201912131246.git.0.09a9468.el8.x86_64.rpm | rpm2cpio | cpio -div`
cgwalters / gist:4e5eb36bd439f5995928e9232d865f67
Last active Dec 13, 2019
Testing FCOS/RHCOS OSTree upgrades manually
View gist:4e5eb36bd439f5995928e9232d865f67
On host in your cosa build directory run e.g.:
$ cd /srv/walters/rhcos-4.4
$ python3 -m http.server
$ cosa run -d rhcos-4.2.0-qemu.qcow2
# ostree remote add --set=gpg-verify=false local
# while ! rpm-ostree rebase local:tmpref-rhcos; do sleep 0.1; done
# Automate an end-to-end run of coreos-installer with the metal image, which then
# boots and writes a success message to a virtio-serial port, which we read on the host.
set -euo pipefail
run_tmp_webserver() {
local statedir=$1
local dir=$1
View gist:77db117622337270f1d04315c8716044
walters@toolbox ~/s/g/c/coreos-assembler> git diff
diff --git a/src/ b/src/
index e9cd8596..76808b3e 100755
--- a/src/
+++ b/src/
@@ -10,6 +10,9 @@
# an issue and we can discuss configuration needs.
set -euo pipefail
View gist:32ef862585ac9a87cd974e5d1b9e0db4
# forked from
set -e
set -o pipefail
# Add user to k8s using service account, no RBAC (must create RBAC after this script)
if [[ -z "$1" ]] || [[ -z "$2" ]]; then
echo "usage: $0 <service_account_name> <namespace>"
exit 1
View gist:1a7ae148a983037b42b98d837419d962
From ffc795562602637a7c3bc57bad7f20fdad58fa33 Mon Sep 17 00:00:00 2001
From: Stephen Lowrie <>
Date: Thu, 3 Oct 2019 15:40:48 -0500
Subject: [PATCH] HACK: Manhole on failure
kola/cluster/cluster.go | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/kola/cluster/cluster.go b/kola/cluster/cluster.go
cgwalters /
Last active Aug 22, 2019
cosa unprivileged
cosa() {
   env | grep COREOS_ASSEMBLER
   id=$(id -u)
   set -x # so we can see what command gets run
   podman run --rm -ti --security-opt label:disable --privileged \
              --uidmap=${id}:0:1 --uidmap=0:1:${id} \
              -v ${PWD}:/srv/ -v /dev/kvm:/dev/kvm -v /dev/fuse:/dev/fuse --device /dev/kvm \
              --tmpfs /tmp --tmpfs /var/tmp --name cosa \
              ${COREOS_ASSEMBLER_CONFIG_GIT:+-v $COREOS_ASSEMBLER_CONFIG_GIT:/srv/src/config/:ro}   \
View gist:020e0a671f9fa02d155fcc604dc898b0
# Convert from a label to its containing block device
# see
device=$(realpath /dev/disk/by-label/${label})
major=$(echo $((0x$(stat -c '%t' "${device}"))))
minor=$(echo $((0x$(stat -c '%T' "${device}"))))
devpath=$(realpath "/sys/dev/block/$majmin")
You can’t perform that action at this time.