Skip to content

Instantly share code, notes, and snippets.

redbeard brianredbeard

View GitHub Profile
@brianredbeard
brianredbeard / Dockerfile-c
Last active May 16, 2020
Examples of name resolution (using gethostbyname() ) used in an explanation.
View Dockerfile-c
FROM scratch
ADD ghbn /ghbn
CMD ["/ghbn", "example.com"]
@brianredbeard
brianredbeard / sdc_raw_libaio_direct.fio
Created May 14, 2020 — forked from tcooper/sdc_raw_libaio_direct.fio
FIO test script for raw device, ioengine=libaio, oflag=direct
View sdc_raw_libaio_direct.fio
[global]
ioengine=libaio
invalidate=1
ramp_time=30
iodepth=1
runtime=180
time_based
direct=1
[write-sdc-4k-seq]
@brianredbeard
brianredbeard / install_golang.sh
Created Jan 9, 2020
Golang Installation script
View install_golang.sh
#!/usr/bin/env bash
# Golang Installation Script (c) Brian 'redbeard' Harrington, 2019
#
# I'm very about how Golang is installed on my system. I normally run through
# this entire process by hand, but realized that it's easier to just have this
# thing to do the needful. Funny enough, 1.13.6 was published in the middle of
# me working on it, so it is already useful.
#
# In the future, I may add a "VERSION" env variable to allow for arbitrary
# versions rather than the latest stable.
@brianredbeard
brianredbeard / os4-acme-certs.sh
Created Oct 29, 2019
Generate Let's Encrypt (ACME) Certs for OpenShift 4
View os4-acme-certs.sh
#!/bin/sh
EMAIL="${1}"
if [ "${#}" -ne 1 ]; then
echo "USAGE: os4-acme-certs.sh email@example.com"
echo "QUITTING"
exit 1
fi
OUT="$(env | grep ^AWS | wc -l)"
@brianredbeard
brianredbeard / alt-catalog.yaml
Created Sep 10, 2019
Alternative OpenShift Operator Catalog
View alt-catalog.yaml
# This is a sample config used to pull content in from Quay.io
# and present it as published content through the in cluster Operator Catalog
# atop OpenShift.
# https://github.com/operator-framework/operator-marketplace/blob/master/README.md
#
# To use this change:
# OperatorSource
# - metadata.name
# - spec.registryNamespace
# - spec.displayName
@brianredbeard
brianredbeard / pine64-battery.sh
Last active Aug 23, 2019 — forked from pfeerick/pine64-battery.sh
Colourful Battery Status script for Pine64 SOC board
View pine64-battery.sh
#!/bin/bash
SWITCH="\033["
NORMAL="${SWITCH}0m"
RED="${SWITCH}1;31m"
GREEN="${SWITCH}1;32m"
YELLOW="${SWITCH}1;33m"
PURPLE="${SWITCH}1;35m"
BLUE="${SWITCH}1;34m"
CYAN="${SWITCH}1;36m"
@brianredbeard
brianredbeard / rpm2mc.py
Created Jul 9, 2019
rpm2mc.py - a tool to convert RPMs to Kubernetes machine-configs
View rpm2mc.py
#!/usr/bin/env python3
#
# rpm2mc.py -- Generate a Kubernetes machine-config from an RPM
# Copyright (c) 2019 Brian 'redbeard' Harrington <redbeard@dead-city.org>
#
# This program is free software: you can redistribute it and/or modify it under
# the terms of the GNU Affero General Public License as published by the Free
# Software Foundation, either version 3 of the License, or (at your option) any
# later version.
#
@brianredbeard
brianredbeard / rhcos-urls.py
Created May 31, 2019
Generate URLs for Red Hat CoreOS Images
View rhcos-urls.py
#!/usr/bin/env python3
# requires the requests library:
# pip install requests
import requests
import json
RHCOS_BUILDS="https://raw.githubusercontent.com/openshift/installer/master/data/data/rhcos.json"
@brianredbeard
brianredbeard / quicknum.py
Created May 23, 2019
quicknum - a script to quickly convert/print binary, hex, and decimal numbers
View quicknum.py
#!/usr/bin/env python
import re
import sys
x=sys.argv[1]
# Check to see if the string is only binary
nonbin = re.search(r'[2-9A-Fa-f]', x)
# First, check to see if there were matches in binary, if not
@brianredbeard
brianredbeard / os4-acme-certs.sh
Last active Jul 23, 2019
Script to get Let's Encrypt public facing certs for an OpenShift v4 cluster
View os4-acme-certs.sh
#!/bin/sh
DOMAIN="${1}"
EMAIL="${2}"
if [ "${#}" -ne 2 ]; then
echo "USAGE: os4-acme-certs.sh clustername.basedomain.tld email@example.com"
echo "QUITTING"
exit 1
fi
You can’t perform that action at this time.