Skip to content

Instantly share code, notes, and snippets.

View clcollins's full-sized avatar

Christopher Collins clcollins

View GitHub Profile
@clcollins
clcollins / restrictive_allowedSourceRanges.json
Last active April 1, 2024 20:55
Generic allowedSourceRanges ServiceLog
{
"severity": "Error",
"service_name": "SREManualAction",
"log_type": "cluster-configuration",
"summary":"Action required: Network misconfiguration",
"description": "Your cluster requires rou to take action. SRE has observed that there have been changes made to network configuration which impact normal working of the cluster: Default Ingress Controller allowedSourceRanges have been modified to exclude the IP(s) of the default router, ${IP}, causing the Console and OAuth routes to become inaccessible. Please allow the IP of service 'router-default' in namespace 'openshift-ingress' in the default Ingress Controller's allowedSourceRanges field.",
"internal_only": false
}
@clcollins
clcollins / proxy.txt
Last active November 22, 2023 21:01
Proxy Conditions
[SwitchyOmega Conditions]
; Require: SwitchyOmega >= 2.3.2
; Date: 3/7/2023
; Usage: https://github.com/FelisCatus/SwitchyOmega/wiki/RuleListUsage
!cloudfront.net
!*.cloudfront.net
*.console.aws.amazon.com
console.aws.amazon.com
amazonaws.com
*.amazonaws.com
@clcollins
clcollins / run-docker-container.sh
Last active December 19, 2022 09:04
Bash script to easily setup and run Docker containers to test any given project
#!/bin/bash
# Set to true to just see what command
# would be run
DRY_RUN=false
TITLE='MY-TEST-CONTAINER'
IMAGE='MY-IMAGE'
# Local volume to be mapped into the container any time you run it
# usually with config files or whatnot
@clcollins
clcollins / bashrc_snippet.sh
Created December 9, 2019 14:55
Print all or an index of $GOPATH
# Without an argument, prints the current gopath
# With a integer argument, prints the directory at the index of a multi-directory GOPATH
gopath ()
{
if [ -z "$GOPATH" ]; then
echo "GOPATH not set...";
exit 1;
fi;
local gopath="${GOPATH}";
@clcollins
clcollins / kube-verify.yaml
Last active April 20, 2021 23:01
Kube Verify deployment
---
apiVersion: v1
kind: Namespace
metadata:
labels:
kubernetes.io/metadata.name: kube-verify
name: kube-verify
spec:
---
apiVersion: apps/v1
@clcollins
clcollins / fio.yaml
Created April 5, 2021 18:30
Deploy Openshift File Integrity Operator
---
apiVersion: v1
kind: Namespace
metadata:
name: openshift-file-integrity
---
apiVersion: operators.coreos.com/v1
kind: OperatorGroup
metadata:
@clcollins
clcollins / piday_countdown_changes.md
Last active March 16, 2021 19:54
PiDay Countdown Article Changes

In the section "Countdown Logic", replace the code example with this:

def countdown(now):
    piday = datetime(now.year, 3, 14)

    # Add a year if we're past PiDay
    if piday < now:
        piday = datetime((now.year + 1), 3, 14)
@clcollins
clcollins / manual_account_cleanup.py
Last active July 13, 2020 17:40
AWS Account Cleanup
#!/usr/bin/env python3
#
# This script written for python3.7
# If running on hive, you will need a virtualenv.
#
# $ virtualenv venv -p python3.7
# $ pip install boto3
#
# Then you should be able to run this script.
@clcollins
clcollins / rpidentify.sh
Created June 26, 2020 15:48
Raspberry Pi LED Identifier
#!/bin/bash
set -o errexit
set -o nounset
trap quit INT TERM
COUNT=0
if ! [ $(id -u) = 0 ]; then
@clcollins
clcollins / dmesg.log
Created May 13, 2020 13:36
RPi 4 Raspbian dmesg log
[ 0.000000] Booting Linux on physical CPU 0x0
[ 0.000000] Linux version 4.19.97-v7l+ (dom@buildbot) (gcc version 4.9.3 (crosstool-NG crosstool-ng-1.22.0-88-g8460611)) #1294 SMP Thu Jan 30 13:21:14 GMT 2020
[ 0.000000] CPU: ARMv7 Processor [410fd083] revision 3 (ARMv7), cr=30c5383d
[ 0.000000] CPU: div instructions available: patching division code
[ 0.000000] CPU: PIPT / VIPT nonaliasing data cache, PIPT instruction cache
[ 0.000000] OF: fdt: Machine model: Raspberry Pi 4 Model B Rev 1.1
[ 0.000000] Memory policy: Data cache writealloc
[ 0.000000] cma: Reserved 256 MiB at 0x000000001ec00000
[ 0.000000] On node 0 totalpages: 1012736
[ 0.000000] DMA zone: 1728 pages used for memmap