Skip to content

Instantly share code, notes, and snippets.

Avatar
:shipit:

Wes Mason 1stvamp

:shipit:
View GitHub Profile
@1stvamp
1stvamp / jenv
Last active Mar 17, 2021
rbenv/jenv shims for use with asdf, specifically for exec support
View jenv
#!/usr/bin/env bash
set -e
if [ "$#" -gt 0 ] && [ "$1" = "shell" ]
then
shift
_SHIM_VERSION=${1:-$(asdf current ruby | awk '{print $1}')}
asdf sh-shell ruby "${_SHIM_VERSION}"
elif [ "$#" -gt 0 ] && [ "$1" = "version" ]
@1stvamp
1stvamp / mac-curl-ca-bundle.sh
Created Mar 22, 2012
Script to install cURL CA certificates on OS X without macports
View mac-curl-ca-bundle.sh
#!/bin/bash
mkdir /tmp/curl-ca-bundle
cd /tmp/curl-ca-bundle
wget http://curl.haxx.se/download/curl-7.22.0.tar.bz2
tar xzf curl-7.22.0.tar.bz2
cd curl-7.22.0/lib/
./mk-ca-bundle.pl
if [ ! -d /usr/share/curl/ ]; then
sudo mkdir -p /usr/share/curl/
else
@1stvamp
1stvamp / starship.toml
Last active Sep 18, 2020
My starship config
View starship.toml
prompt_order = [
"username",
"hostname",
"kubernetes",
"directory",
"git_branch",
"git_commit",
"git_state",
"git_status",
"hg_branch",
@1stvamp
1stvamp / whisper-back-fill.sh
Last active Apr 28, 2020
Recursive whisper data file back-fill script using carbonate::whisper-fill
View whisper-back-fill.sh
#!/bin/bash
set -eo pipefail
if [ "$#" -lt 2 ]
then
>&2 echo 'Usage: whisper-back-fill.sh SOURCE_BASE_DIR DESTINATION_BASE_DIR'
>&2 echo 'e.g. given './data/dal05': whisper-back-fill.sh ./data /data/graphite/storage/'
exit 1
fi
View connect-vpn.expect
#!/usr/bin/expect -f
set timeout -1
set pin [ lindex $argv 0 ]
set token [ lindex $argv 1 ]
spawn gotunl -c 1
expect "Enter the PIN:*"
@1stvamp
1stvamp / joke.sh
Last active Oct 16, 2019
cowsay joke
View joke.sh
#!/bin/bash
args=( '-e OO -T U' '-e ">o"' )
lines=( 'knock knock' "who\'s there?" 'moo' 'moo who?' "aww don\'t cry, it\'ll be alright" )
args_i=0
for line in "${lines[@]}"
do
eval cowsay "${args[$args_i]}" "$line"
@1stvamp
1stvamp / vpn-status.sh
Last active Oct 10, 2019
Script to checked the connected status output from the gotunl client for the pritunl vpn daemon
View vpn-status.sh
#!/usr/bin/env bash
while ! [[ $(gotunl -l) == *Connected* ]]
do
echo -n .
sleep 1
done
echo -e '\e[32mVPN connected!\e[0m'
@1stvamp
1stvamp / open-pull-request.sh
Last active Sep 23, 2019
Shortcut script to open a pull-request on Github from a local git repo
View open-pull-request.sh
#!/usr/bin/env bash
if [[ $(uname -s) == "Linux" ]]; then
browse="xdg-open"
else
browse="open"
fi
repo=$(git remote show -n origin 2>/dev/null|sed -e "/Push URL:*/!d; s/.*git@github.com:\(.*\).git/\1/; q")
branch=$(git branch --no-color 2>/dev/null|sed -e '/^[^*]/d' -e 's/* \(.*\)/\1/')
@1stvamp
1stvamp / Gemfile
Last active Sep 11, 2019
main entrypoint.js to use with a GitHub Action to run action written in ruby
View Gemfile
# .github/actions/my-action/Gemfile
# frozen_string_literal: true
source 'https://rubygems.org'
git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
gem 'json'
@1stvamp
1stvamp / user.js
Created Sep 4, 2019
Open GitHub issue description links in a new tab when rendering on app.zenhub.com
View user.js
var mutationObserver = new MutationObserver(function(mutations) {
mutations.forEach(function(mutation) {
Array.prototype.forEach.call(document.querySelectorAll('.zhc-markdown a'), function(el, i) {
el.setAttribute('target', '_blank')
})
})
})
mutationObserver.observe(document.documentElement, {
childList: true,