Skip to content

Instantly share code, notes, and snippets.

View bunchc's full-sized avatar

Cody Bunch bunchc

View GitHub Profile
@bunchc
bunchc / Dockerfile
Last active July 14, 2017 22:37
Dockerfile for Fan Control
FROM arm32v6/alpine:3.6
RUN apk --no-cache add bash python python-dev py-pip build-base curl
RUN pip install RPi.GPIO Flask flask_restful
COPY ./fan.py /fan.py
EXPOSE 80
@bunchc
bunchc / fan.py
Last active July 14, 2017 22:42
Fan API
import RPi.GPIO as io
from flask import Flask, jsonify
from flask_restful import Resource, Api
# Set our initial state
power_pin = 21
fan_status = False
# Initialize GPIO, and ensure fan is off
io.setmode(io.BCM)
@bunchc
bunchc / damnit_fusion.sh
Last active May 31, 2017 03:22
Script to reset VMware Fusion networking for 7.x and 8.x releases
#!/bin/bash
#
# @script damnit_fusion.sh
# @description Fusion Networking hates me
#
# $ ~/damnit_fusion.sh
#
# Be default will perform a gentle restart of VMware Fusion networking.
# When that is not enough set FROM_ORBIT to true and try again.
#
@bunchc
bunchc / script_custom.ps1
Last active December 10, 2021 18:47
Windows 10 customization script
# Install chocolatey & boxstarter
Set-ExecutionPolicy AllSigned; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
. { iwr -useb http://boxstarter.org/bootstrapper.ps1 } | iex; get-boxstarter -Force
# Basic setup
Write-Host "Setting execution policy"
Update-ExecutionPolicy Unrestricted
###########################################
# Update Windows and reboot if necessary #
@bunchc
bunchc / Rakefile
Created April 17, 2017 18:11
Rakefile for notes and blogs
require 'fileutils'
task :post do
title = ENV['title'] || "new-post"
tags = ENV['tags'] || ''
layout = ENV['layout'] || 'post'
make_img_dir = ENV['imgdir'] || false
date = (ENV['date'] ? Time.parse(ENV['date']) : Time.now).strftime('%Y-%m-%d')
filename = File.join('/paht/to/drafts/', "#{Time.now.strftime('%Y-%m-%d')}-#{title.strip.gsub(' ', '-').gsub(/[^\w-]/, '')}.md")
open(filename, 'w') do |post|
post.puts "---"

Customer: Orangutan-Roasters Project: Burundai Tasting Author: Cody Bunch Date: 2017-04-17 categories:

Orangutan-Roasters

Some background here

@bunchc
bunchc / CSV.zip
Last active April 12, 2017 02:48
Build and Populate Windows AD
@bunchc
bunchc / domain_controller.ps1
Last active April 10, 2017 17:11
BoxStarter to bootstrap a simple Windows DC
$newDomainName="orangutan.local"
$newDomainNetBios="orangutan"
Set-ExplorerOptions -showHiddenFilesFoldersDrives -showProtectedOSFiles -showFileExtensions
Enable-RemoteDesktop
# Install some useful packages
cinst git
cinst git-credential-winstore
cinst console-devel
@bunchc
bunchc / gpg-import-and-export-instructions.md
Created April 5, 2017 14:36 — forked from chrisroos/gpg-import-and-export-instructions.md
Instructions for exporting/importing (backup/restore) GPG keys

Every so often I have to restore my gpg keys and I'm never sure how best to do it. So, I've spent some time playing around with the various ways to export/import (backup/restore) keys.

Method 1

Backup the public and secret keyrings and trust database

cp ~/.gnupg/pubring.gpg /path/to/backups/
cp ~/.gnupg/secring.gpg /path/to/backups/
cp ~/.gnupg/trustdb.gpg /path/to/backups/

or, instead of backing up trustdb...

#The command to run, built from the raw link of this gist
#START http://boxstarter.org/package/url?https://gist.github.com/bunchc/44e380258384505758b6244e615e75ed/raw/d648fffc21cb3cc7df79e50be6c05b05d29c79cc/0-SystemConfiguration.txt
#########################################
# Set Execution Policy #
#########################################
# Boxstarter options
$Boxstarter.RebootOk=$true # Allow reboots?
$Boxstarter.NoPassword=$false # Is this a machine with no login password?