Skip to content

Instantly share code, notes, and snippets.

Avatar

Braxton Beyer kidbrax

View GitHub Profile
@kidbrax
kidbrax / kit.sh
Last active Dec 11, 2019
kitchen alias to keep from retyping regex
View kit.sh
# Provides an alias for the kitchen cli - https://docs.chef.io/ctl_kitchen.html
# place the following into your ~/.bashrc or similar
kitchen_specific_instances() {
if [ -z "$WORKING_INSTANCES" ]
then
echo "\$WORKING_INSTANCES is empty"
else
echo "\$WORKING_INSTANCES=$WORKING_INSTANCES"
fi
@kidbrax
kidbrax / create-qr.sh
Last active Nov 15, 2019
Creates a QR code simulating Symantec's VIP Access that you can then use in your preferred authenticator
View create-qr.sh
# First install python-vipacess
pip3 install python-vipaccess
# the run it using the defaults
vipaccess provision
# then read the necessary info from the .vipaccess file
CREDENTIAL_ID=$(cat ~/.vipaccess | grep id | awk '{ print $2 }')
CREDENTIAL_SECRET=$(cat ~/.vipaccess | grep secret | awk '{ print $2 }')
View keybase.md

Keybase proof

I hereby claim:

  • I am kidbrax on github.
  • I am kidbrax (https://keybase.io/kidbrax) on keybase.
  • I have a public key ASBd14DMFzdIWToaKf0M_jFRpPyQw_Jr6XEfa6tlY2O1oAo

To claim this, I am signing this object:

@kidbrax
kidbrax / get-totp.sh
Created Jul 18, 2019
get TOTP using 1Password #shell
View get-totp.sh
# This uses the 1Passowrd CLI - https://support.1password.com/command-line/
# taken from https://discussions.agilebits.com/discussion/comment/502729/#Comment_502729
# this is a command to get a TOTP, (MFA token)
op get item <item_uuid_or_name> | jq '.details.sections[1].fields[0].v' | awk -F'[=&]' '{print $2}'
View keybase.md

Keybase proof

I hereby claim:

  • I am kidbrax on github.
  • I am bbeyer (https://keybase.io/bbeyer) on keybase.
  • I have a public key ASDAdmReJbJja-iI_niEPUZTiexJpZN7Y9GSmqhcyYXsUgo

To claim this, I am signing this object:

View migrate-repo.sh
set -e
set -x
# 1. first, mark old repo as read-only so no new changes are added during transition
# we could script this too through github api. Note, do not lock repo here, since
# git clone will not work if you do.
# Make sure Repo doesn't have any active PRs. DO NOT migrate a repo with active Pull Requests.
# 2. change this. this is the name from <short_name>.git
@kidbrax
kidbrax / github-api.sh
Created Jan 26, 2018
useful commands for getting info from Github using their API
View github-api.sh
# get all private repos whose default branch is master (note pagination)
curl -H "Authorization: token <auth-token>" \
https://api.github.com/orgs/arthrex/repos?type=private \
| jq '.[] | select(.default_branch | contains("master")) | .name, .default_branch'
@kidbrax
kidbrax / get-ami.sh
Created Jan 24, 2018
Get ID of AMI created using Packer
View get-ami.sh
# assuming you use a manifest file such as:
# "post-processors": [
# {
# "type": "manifest",
# "output": "manifest.json",
# "strip_path": true
# }
# ]
new_ami_id=$(cat manifest.json | jq -r '.builds | .[length-1].artifact_id' | cut -d ':' -f 2)
@kidbrax
kidbrax / demo.coffee
Last active Apr 27, 2020
demo http server #coffee
View demo.coffee
http = require("http")
PORT = process.env.PORT or 3000
http.createServer((req, res) ->
console.log "%d request received", process.pid
res.writeHead 200,
"Content-Type": "text/plain"
res.end "Hello world!\n"
return
@kidbrax
kidbrax / gist:3409263
Created Aug 20, 2012
error installing librets with homebrew
View gist:3409263
~$ brew install librets
==> Downloading http://www.crt.realtors.org/projects/rets/librets/files/librets-1.5.3.tar.gz
Already downloaded: /Library/Caches/Homebrew/librets-1.5.3.tar.gz
==> ./configure --disable-debug --enable-shared_dependencies --prefix=/usr/local/Cellar/librets/1.5.3 --disable-dotnet --disable-java --disable-perl --disable-php --disable-python
==> make install
/usr/bin/clang++ -Os -w -pipe -march=native -Qunused-arguments -mmacosx-version-min=10.8 -fPIC -DHAVE_CONFIG_H -DTARGET_UNIX -DLIBRETS_VERSION='"1.5.3"' -isystem /usr/local/include -I/usr/include -I/usr/local/include -I./project/librets/include -c project/librets/src/AndCriterion.cpp -o build/librets/objects/AndCriterion.o
/usr/bin/clang++ -Os -w -pipe -march=native -Qunused-arguments -mmacosx-version-min=10.8 -fPIC -DHAVE_CONFIG_H -DTARGET_UNIX -DLIBRETS_VERSION='"1.5.3"' -isystem /usr/local/include -I/usr/include -I/usr/local/include -I./project/librets/include -c project/librets/src/BinaryData.cpp -o build/librets/objects/Bin
You can’t perform that action at this time.