Skip to content

Instantly share code, notes, and snippets.

View brandocorp's full-sized avatar

Brandon Raabe brandocorp

View GitHub Profile
terraform {
backend "local" {}
required_providers {
aws = {
source = "hashicorp/aws"
}
}
}
@brandocorp
brandocorp / setup.sh
Created October 19, 2021 00:48
Setup local Kubernetes cluster with ingress-nginx
#!/bin/bash -e
# Dependencies:
# - k3d (github.com/rancher/k3d)
# - kubectl (github.com/kubernetes/kubectl)
# - jq (github.com/stedolan/jq)
setup_cluster() {
k3d cluster create dev \
--agents 1 \
@brandocorp
brandocorp / sketch.cpp
Created August 2, 2020 18:30
Arduino Servo Motor and Photo Resistor Sensor
// http://www.bajdi.com/continuous-rotation-servos-and-arduino/
// Continuous Servo controls
// Counter clock-wise rotation is achieved using values from 45-89, fastest to slowest speed.
// Clock-wise rotation is achieved using values from 91-135, slowest to fastest speed.
// Servo Library
// https://www.arduino.cc/reference/en/libraries/servo/
#include <Servo.h>
Servo servo;
@brandocorp
brandocorp / setup.md
Last active October 22, 2018 15:55
_kenesis_kb800PB-BT.md
sudo rfkill list
sudo bluetoothctl -a
sudo bluetoothctl
@brandocorp
brandocorp / linux.rb
Last active September 5, 2018 02:21
Workstation Setup
#
# 1) Install the ChefDK first
# * curl -L https://omnitruck.chef.io/install.sh | sudo bash -s -- -P chefdk
# 2) Execute this recipe with chef-client
# * chef-client -z linux.rb
#
directory "#{ENV['HOME']}/bin"
directory "#{ENV['HOME']}/go"
directory "#{ENV['HOME']}/src"
@brandocorp
brandocorp / _cleanup.sh
Created April 21, 2017 22:24
Uninstall Chef Server 12
#!/bin/bash -e
chef-server-ctl stop || chef-server-ctl kill
killall -9 -u opscode
killall -9 runsvdir
killall -9 rabbitmq
killall -9 nginx
chef-server-ctl uninstall
@brandocorp
brandocorp / usr.sbin.sshd
Created October 24, 2016 22:19
SSH Apparmor
usr.sbin.sshd
# Last Modified: Mon Oct 24 22:15:48 2016
#include <tunables/global>
/usr/sbin/sshd flags=(complain) {
#include <abstractions/base>
#include <abstractions/consoles>
#include <abstractions/nameservice>
#include <abstractions/openssl>
@brandocorp
brandocorp / libraries_debug.rb
Last active October 17, 2016 19:32
chef-resource-and-attribute-debugging
require 'pp'
class Chef
class Node
attr_accessor :chef_callers
def cumulative_callers
@chef_callers ||= {
'accessor' => [],
'normal' => [],
'default' => []
node.default['lita']['plugins'] = {'lita-flowdock' => '0.1.2', 'lita-wolfram-alpha' => '2.0.0' }
node['lita']['plugins'].each do |name, ver|
chef_gem name do
version ver
compile_time true
action :install
end
end
@brandocorp
brandocorp / default.yml
Created July 4, 2016 18:24
LXD Profiles
name: default
config:
user.user-data: |
#cloud-config
users:
- name: admin
groups: sudo
sudo: ALL=(ALL) NOPASSWD:ALL
shell: /bin/bash
gecos: Local Admin