Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View papaben's full-sized avatar

Benjamin VanEvery papaben

View GitHub Profile
#! /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 / idid.sh
Last active February 18, 2021 11:31
Run the git command you intended, `idid !!`
##
# "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'
<script>alert("hello");</script>
@papaben
papaben / get_log_traceback.py
Created November 6, 2018 16:31
Figure out who disabled your logger
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
@papaben
papaben / add-host-to-known_hosts.sh
Created January 11, 2016 22:24
Automatically add several hosts to known_hosts
#! /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=
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 / dig-dependencies.py
Last active September 14, 2016 21:27
Figure out which of your pip requirements depend on another
#! /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 August 26, 2016 18:53
copied for security
#! /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 / .my.cnf
Created May 3, 2016 22:22
My MySQL configuration file. Gives me useful debugging info
[mysql]
prompt="[\\u@\\h \\D]\\n[mysql-\\d \\c]>"
@papaben
papaben / log-levels.sh
Last active April 7, 2016 23:33
Small library exposing logging methods to bash scripts. Output is only written based on log level set by consumer, defaults to all off
##
# 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