Skip to content

Instantly share code, notes, and snippets.

View shawnbutts's full-sized avatar

Shawn Butts shawnbutts

View GitHub Profile
@shawnbutts
shawnbutts / DND1.basic
Created November 24, 2023 14:43 — forked from bussiere/DND1.basic
The code source of DND1 by RIchard Garriott Copyright himself.
DND
-
1
1500 lines
(C)
1977
-
2014 Richard Garriott
79/02/28. 19.27.34.
@shawnbutts
shawnbutts / workspace.sh
Last active July 16, 2020 15:31 — forked from dixson3/workspace.sh
Create and manage a case-sensitive disk-image on OSX. This is great when you have a need to work with case-sensitive repos on a mac.
#!/bin/bash
# ---------------------------------------------------------
# Customizable Settings
# ---------------------------------------------------------
MOUNT_POINT="${CASE_SAFE_MOUNT_POINT:-${HOME}/casesafe}"
VOLUME_PATH="${CASE_SAFE_VOLUME_PATH:-${HOME}/.casesafe.dmg.sparsebundle}"
VOLUME_NAME="${CASE_SAFE_VOLUME_NAME:-casesafe}"
VOLUME_SIZE="${CASE_SAFE_VOLUME_SIZE:-60g}"
@shawnbutts
shawnbutts / pyenv+direnv on OSX.md
Created April 17, 2018 13:14 — forked from alexhayes/ pyenv+direnv on OSX.md
Awesomely easy virtualenvs on OSX using pyenv and direnv

Awesomely easy virtualenvs on OSX using pyenv and direnv

Never forget to activate that virtualenv or set that environment variable ever again...

Install

  1. Install pyenv

     brew install pyenv
    
@shawnbutts
shawnbutts / Vagrant-port-forward-to-host.md
Created January 24, 2018 15:23 — forked from radabass/Vagrant-port-forward-to-host.md
Vagrant port 80 443 forwarding to HOST machine OSX El Capitan

El Capitan OSX Vagrant port forwarding rules to use privileged ports 80 and 443

Due to the OSX limitations in ports below 1024, in order to use them without running as root the virtualbox headless you can do the following workaround, (remember the command ipfw is deprecated on El Capitan)

In the Vagrant file use ports over 1024, for instance change 80 and 443 to 8080 and 8043.

  # Apache
  config.vm.network "forwarded_port", guest: 80, host: 8080
@shawnbutts
shawnbutts / ranks
Last active October 16, 2017 00:40
1 Viewer
2 Recruit
4 Pilgrim
8 Apostle
16 Zealot
32 Trainee
64 Apprentice
80 Craftsman
96 Merchant
112 Clerk
@shawnbutts
shawnbutts / kubernetes_on_macOS.md
Created June 4, 2017 22:07 — forked from kevin-smets/1_kubernetes_on_macOS.md
Local Kubernetes setup on macOS with minikube on VirtualBox

Requirements

Minikube requires that VT-x/AMD-v virtualization is enabled in BIOS. To check that this is enabled on OSX / macOS run:

sysctl -a | grep machdep.cpu.features | grep VMX

If there's output, you're good!

Prerequisites

#!/bin/bash
# You need: curl, jq, and ipcalc to run this.
# You should already have cut, sort and uniq if you're on OS X or Linux.
RANGES=$(curl -s https://ip-ranges.amazonaws.com/ip-ranges.json | jq .prefixes | jq '.[] | select(.region=="us-east-1")' | jq 'select(.service=="EC2")' | jq .ip_prefix | cut -d '"' -f 2 | sort | uniq)
for range in $RANGES
do
MIN=$(ipcalc -bn $range | grep "HostMin" | cut -d ':' -f 2)
@shawnbutts
shawnbutts / startup.log
Last active October 5, 2016 08:18
fluentd-trace01
2016-10-04 18:31:34 +0000 [trace]: plugin/buffer.rb:165:add_metadata: adding metadata instance=9080200 metadata=#<struct Fluent::Plugin::Buffer::Metadata timekey=1475605380, tag=nil, variables=nil>
2016-10-04 18:31:34 +0000 [trace]: plugin/buffer.rb:188:write: writing events into buffer instance=9080200 metadata_size=1
2016-10-04 18:31:34 +0000 [trace]: plugin/buffer.rb:165:add_metadata: adding metadata instance=9080200 metadata=#<struct Fluent::Plugin::Buffer::Metadata timekey=1475605380, tag=nil, variables=nil>
2016-10-04 18:31:34 +0000 [trace]: plugin/buffer.rb:188:write: writing events into buffer instance=9080200 metadata_size=1
2016-10-04 18:31:34 +0000 [trace]: plugin/buffer.rb:165:add_metadata: adding metadata instance=9080200 metadata=#<struct Fluent::Plugin::Buffer::Metadata timekey=1475604360, tag=nil, variables=nil>
2016-10-04 18:31:34 +0000 [trace]: plugin/buffer.rb:165:add_metadata: adding metadata instance=9080200 metadata=#<struct Fluent::Plugin::Buffer::Metadata timekey=1475604360, tag=nil, v
### Keybase proof
I hereby claim:
* I am shawnbutts on github.
* I am shawnbutts (https://keybase.io/shawnbutts) on keybase.
* I have a public key ASDHWHAHABRNm_6TytWGh2d_6FlZFV_zk8EbqqKfgZga7Ao
To claim this, I am signing this object:
@shawnbutts
shawnbutts / backup-docker-cassandra.sh
Created July 5, 2016 10:56 — forked from tobert/backup-docker-cassandra.sh
Quick & dirty cassandra-in-docker backup script
#!/bin/bash
# A quick & dirty backup script for Cassandra running inside Docker.
# Assumes /var/lib/cassandra is mounted in the container as /var/lib/cassandra because
# docker inspect {{ .Volumes }} is not shell-friendly. (doable, but meh)
# Also assumes Cassandra was started with 'docker run --name cassandra'.
export PATH=$PATH:/home/atobey/bin:/usr/local/bin
set -e