Skip to content

Instantly share code, notes, and snippets.

Avatar

redbeard brianredbeard

View GitHub Profile
@brianredbeard
brianredbeard / CopyOCPAMI.py
Created Nov 5, 2020
CopyOCPAMI.py - A utility to copy a RHEL CoreOS AMI Image to a different region/account.
View CopyOCPAMI.py
#!/usr/bin/env python
"""CopyOCPAMI.py - A utility to copy OpenShift Amazon Machine Images
Copyright (C) 2020 Brian 'redbeard' Harrington
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 / .config
Last active Oct 15, 2020
buildroot config for node.js
View .config
BR2_HAVE_DOT_CONFIG=y
BR2_ARCH_IS_64=y
BR2_x86_64=y
BR2_ARCH="x86_64"
BR2_ENDIAN="LITTLE"
BR2_GCC_TARGET_ARCH="nocona"
BR2_ARCH_HAS_ATOMICS=y
BR2_X86_CPU_HAS_MMX=y
BR2_X86_CPU_HAS_SSE=y
BR2_X86_CPU_HAS_SSE2=y
@brianredbeard
brianredbeard / mpris.py
Created Sep 21, 2020 — forked from FergusInLondon/mpris.py
Retrieve data from a Media Player in Linux, via dbus. (Uses Python)
View mpris.py
import dbus
class MediaPlayer:
"""Recieves state from a MediaPlayer using dbus."""
player_properties = False
def __init__(self, player_name):
# Get an instance of the dbus session bus, and retrieve
# a proxy object for accessing the MediaPlayer
@brianredbeard
brianredbeard / Translate.sh
Created Jul 30, 2020
BASH example of translation using the AWS CLI
View Translate.sh
#!/bin/bash
# Bourne Again Shell example of translation services using the AWS Translate
# service. Requires the AWS CLI tool and JQ to be present in the path.
#
# Directions, edit "langlist.txt" to include the desired languages from the
# following site: https://docs.aws.amazon.com/translate/latest/dg/what-is.html
#
# Next: Edit the "--text" option to include your text to be translated and
# the JQ filter to format the output. In the example below we are translating
# a string for use in translating the description of an application for use in
@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 / 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 / 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 / delete_vpc.py
Created Aug 28, 2017
Trying out something to delete annoying VPCs
View delete_vpc.py
#!/usr/bin/env python
import boto3
import logging
import sys
from pprint import pprint
from time import sleep
import botocore.exceptions
@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