Skip to content

Instantly share code, notes, and snippets.

View bgulla's full-sized avatar
🦃
fast and loose is still fast.

Brandon bgulla

🦃
fast and loose is still fast.
  • Virginia
View GitHub Profile
@bgulla
bgulla / extended-cleanup-rancher2.sh
Created March 5, 2020 16:26 — forked from superseb/extended-cleanup-rancher2.sh
Extended Rancher 2 cleanup (backup your data, use at your own risk)
#!/bin/sh
# Backup your data
# Use at your own risk
# Usage ./extended-cleanup-rancher2.sh
# Include clearing all iptables: ./extended-cleanup-rancher2.sh flush
docker rm -f $(docker ps -qa)
docker rmi -f $(docker images -q)
docker volume rm $(docker volume ls -q)
for mount in $(mount | grep tmpfs | grep '/var/lib/kubelet' | awk '{ print $3 }') /var/lib/kubelet /var/lib/rancher; do umount $mount; done
cleanupdirs="/etc/ceph /etc/cni /etc/kubernetes /opt/cni /opt/rke /run/secrets/kubernetes.io /run/calico /run/flannel /var/lib/calico /var/lib/etcd /var/lib/cni /var/lib/kubelet /var/lib/rancher/rke/log /var/log/containers /var/log/pods /var/run/calico"
import json
import random
import time
import logging
import requests
from selenium import webdriver
from selenium.webdriver.common.desired_capabilities import DesiredCapabilities
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.support import expected_conditions as EC
@bgulla
bgulla / main.yml
Created January 13, 2020 17:33
Ansible-playbook to customize Proxmox installs
# _ _
# _ ____ _____ _ __ __ _| |_ ___| |__
# | '_ \ \ / / _ \_____| '_ \ / _` | __/ __| '_ \
# | |_) \ V / __/_____| |_) | (_| | || (__| | | |
# | .__/ \_/ \___| | .__/ \__,_|\__\___|_| |_|
# |_| |_|
#############
# TODO
@bgulla
bgulla / Jenkinsfile
Created January 13, 2020 16:07
Multi-architecture Jenkins Docker Builds with Docker manifest support
pipeline {
environment {
registryCredential = 'harbor-lol-jenk-robot'
DOCKER_IMAGE = sh 'echo ${JOB_NAME} | sed "s/gitea-larkspur//g" | sed "s/master//g"'
registry = "" /*be sure to include trailing slash*/
docker_image_name = "bgulla/rtl-tcp"
docker_img = "${registry}${docker_image_name}"
/* */
push_to_local_registry = true
{
"annotations": {
"list": [
{
"builtIn": 1,
"datasource": "-- Grafana --",
"enable": true,
"hide": true,
"iconColor": "rgba(0, 211, 255, 1)",
"name": "Annotations & Alerts",
pipeline {
environment {
registryCredential = 'harbor-lol-jenk-robot'
DOCKER_IMAGE = sh 'echo ${JOB_NAME} | sed "s/gitea-larkspur//g" | sed "s/master//g"'
registry = "" /*be sure to include trailing slash*/
docker_image_name = "bgulla/k8s757-flask"
docker_img = "${registry}${docker_image_name}"
/* */
push_to_local_registry = true
@bgulla
bgulla / kickstart.cfg
Last active November 12, 2019 15:44
Kickstarting a CentOS server
#####
# On the host that you want to run your kickstart server (in the folder containing kickstart.cfg):
# docker run --restart=always -p 9999:80 -v ${PWD}/kickstart.cfg:/var/www/html/kickstart.cfg nginx
#####
# Instructions:
# - Boot into a fresh CentOS box. When you get presented with the ASCII menu, press tab then type:
# ks=http://<IP_OF_KICKSTART_BOX>:9999/kickstart.cfg . Then press enter.
## kickstart.cfg
#####
@bgulla
bgulla / rancherOnProx.md
Last active June 17, 2020 16:35
Rancher Install Guide for n00bs

Greenfield Rancher install

Pre-Rancher Steps

Kubernetes Persistent Storage

Head to your synology/freenas and setup a new NFS share just for your kubernetes persistent storage. Make sure to turn off authentication.

Networking - Create a vlan just for your VMs

  1. Create a vlan (10.0.X.1 or 192.168.X.1) just for your VMs in your Unifi Controller, dont worry about firewall or traffic shaping. What I typically do is once I have created the vlan, I go to the Unifi Switch configuration area, and assign the port that the server is being plugged-into as being mapped to my VM-VLAN.
  2. Create a vlan for your Ingress Controller/Metallb. Just create the vlan and we'll worry about the rest later.
@bgulla
bgulla / meterears-preview.py
Created August 14, 2019 12:49
Reading electric meters using a usb-sdr
#!/usr/bin/python
import sys
import os
import platform
import time
import subprocess
import json
import socket
import logging
from influxdb import InfluxDBClient
@bgulla
bgulla / oc-cli-arm64.md
Last active November 18, 2021 03:10
Installing oc-cli on Jetson Nano

Building oc-cli for ARM Architectures

ARM64/AARCH64 (Jetson Nano) or RPi 4

cd $GOPATH
git clone -b release-3.11 https://github.com/openshift/origin.git
sudo apt install libgpgme-dev -y 
mkdir -p src/github.com/openshift
mv origin src/github.com/openshift/
go build -v github.com/openshift/origin/cmd/oc