Skip to content

Instantly share code, notes, and snippets.

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

Orangutan-Roasters

Some background here

@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 "---"
@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 / 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 / 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 / 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 / easy_install-offline.md
Created August 2, 2017 03:30
(┛◉Д◉)┛彡┻━┻

pip install sometimes calls setup.py, which makes it ignore the offline params you specified for pip. To get around that, you need to create a file ~/.pydistutils.cfg

This will create said file:

echo -e '[easy_install]\nallow_hosts = 10.10.120.20\nfind_links = http://10.10.120.20/pypi/simple\nindex-url = http://10.10.120.20/pypi/simple' | tee ~/.pydistutils.cfg

The file looks like this:

@bunchc
bunchc / userdata-hardening-ufw
Created August 20, 2017 15:40
UserData Hardening script with UFW
#!/bin/bash
# user-data-hardening.sh
# Authors: Cody Bunch (bunchc@gmail.com)
#
# Script intended to be supplied as userdata to a cloud of some flavor.
# Enables some sane sysctl defaults, turns up iptables, and
# installs a HIDS / NIDS package
# Supply your email here
email_address="userdata@mailinator.com"
@bunchc
bunchc / create_ssh_tunnel.sh
Created August 20, 2017 16:32
Script to create reverse SSH tunnel
#!/bin/bash
createTunnel() {
/usr/bin/ssh -N -R 2222:localhost:22 root@remoteaccess.isa.fuckingasshat.com
if [[ $? -eq 0 ]]; then
echo "Tunnel up!"
else
echo "No such luck, Mario. Princess is $?"
fi
}
@bunchc
bunchc / Do-TerribleThings.ps1
Last active May 26, 2018 14:08
Does terribad things to AD
$NewDomainName = "orangutan.local"
$NewDomainNetBios = "orangutan"
$NumRandomGroups = 12000
$NumRandomUsers = 24000
Set-ExplorerOptions -showHiddenFilesFoldersDrives -showProtectedOSFiles -showFileExtensions
Enable-RemoteDesktop
# Install chocolatey
Set-ExecutionPolicy AllSigned; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))