Skip to content

Instantly share code, notes, and snippets.

Benjamin VanEvery papaben

View GitHub Profile
View market research.html
gotoresearch, a leading research and design firm, is conducting a study of people who work in IT, DevOps, networking infrastructure.
We are looking for people who can participate in a 45 minute remote interview next week. Individuals who complete the interview will receive $150 for their time.
In order to help us identify a diverse group of participants, please click the link below and complete a short survey about yourself. This should take less than 3 minutes to complete.
Link for the survey: https://www.surveymonkey.com/r/MVDK75K
If you initially qualify to participate, we will contact you to discuss the study. You will be contacted ONLY if you initially qualify. Please do not contact gotoresearch directly.
@papaben
papaben / get_log_traceback.py
Created Nov 6, 2018
Figure out who disabled your logger
View get_log_traceback.py
def _get_trace():
trace = u''
depth = 2 # skip call to this function
while True:
try:
frame = sys._getframe(depth)
trace = u'%s:%s\n%s' % (
frame.f_code.co_filename, frame.f_lineno, trace
)
depth += 1
View install-rocksdb-aws-linux2.sh
#! /usr/bin/env bash
# Installs RocksDB
# https://github.com/facebook/rocksdb/blob/master/INSTALL.md
# http://pyrocksdb.readthedocs.io/en/v0.4/installation.html
##
set -e
set -x
sudo yum groupinstall -y "Development Tools"
@papaben
papaben / dig-dependencies.py
Last active Sep 14, 2016
Figure out which of your pip requirements depend on another
View dig-dependencies.py
#! /usr/bin/env python
# Be sure to execute this with your virtualenv activated
from pip._vendor import pkg_resources
import sys
# The name of the pip package
# TODO error checking (when this is no longer a gist)
dependency = sys.argv[1]
@papaben
papaben / supervisord.sh
Last active Aug 26, 2016
copied for security
View supervisord.sh
#! /bin/bash
### BEGIN INIT INFO
# Provides: supervisord
# Required-Start: $remote_fs
# Required-Stop: $remote_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Example initscript
# Description: This file should be used to construct scripts to be
# placed in /etc/init.d.
@papaben
papaben / idid.sh
Last active Oct 31, 2018
Run the git command you intended, `idid !!`
View idid.sh
##
# "I did [mean that]"
# Re-run the suggested git command
# Intended to be run as 'idid "!!"'
# Place this file in your $PATH
# TODO create this as a brew script
##
declare last=''
declare selection_ordinal='1'
@papaben
papaben / .my.cnf
Created May 3, 2016
My MySQL configuration file. Gives me useful debugging info
View .my.cnf
[mysql]
prompt="[\\u@\\h \\D]\\n[mysql-\\d \\c]>"
@papaben
papaben / log-levels.sh
Last active Apr 7, 2016
Small library exposing logging methods to bash scripts. Output is only written based on log level set by consumer, defaults to all off
View log-levels.sh
##
# Log levels for bash scripts
# vim: set ft=sh :
##
# Date format for logging
declare -r DATE_FORMAT='+%Y-%m-%d:%H:%M:%S:%:z'
##
# These are the "methods" that your script will use to do the logging
@papaben
papaben / add-host-to-known_hosts.sh
Created Jan 11, 2016
Automatically add several hosts to known_hosts
View add-host-to-known_hosts.sh
#! /usr/bin/env bash
#
# In a situation in which you are ssh'ing into a set of servers, and you are
# confident about their trustability, but the current server doesn't "know"
# them yet. This script will add their signatures into your known_hosts file
# if it is not yet there.
##
declare KNOWN_HOSTS_FILE="$HOME/.ssh/known_hosts"
declare server_ip=
@papaben
papaben / git.sh
Created Apr 18, 2014
My typical answer when git asks, "Did you mean?"
View git.sh
##
# "I did [mean that]"
# Re-run the suggested git command
# Intended to be run as 'idid !!'
##
function idid() {
declare last=''
while [[ $# > 0 ]]; do
last="$last $1"
You can’t perform that action at this time.