Skip to content

Instantly share code, notes, and snippets.

@benders
benders / new-employee-setup.txt
Last active December 17, 2015 11:29
New Employee setup
Repair Homebrew permissions
sudo chmod g+w /usr/local/
Put Chrome and Firefox on dock
Download and Install
TextMate
GitX
Run TextMate and setup terminal helper in /usr/local/bin
@benders
benders / git-setup.sh
Last active July 27, 2016 09:51
New Employee git setup
FULLNAME=`finger "$USER" | awk -F: '{ print $3 }' | head -n1 | sed 's/^ //'`
# Git needs to know who you are!
git config --global user.name "${FULLNAME}"
git config --global user.email "${USER}@newrelic.com"
# SVN style shortcuts
git config --global alias.st status
git config --global alias.ci commit
git config --global alias.co checkout
@benders
benders / cisco-asa-config.txt
Last active November 23, 2021 05:01
Getting Amazon VPC up and running with Cisco ASAs can be a pain. This is the config that we used to make it work.
! --------------------------------------------------------------------------------
! This example configuration shows what WE did to get Amazon VPC working with our
! ASAs. We use version 8.3(1). This config has not been reviewed or otherwise
! blessed in any way by anyone at Amazon. YMMV.
!
! It differs from Amazon's supplied config by using two different sets of
! crypto maps and ACLs, so it brings both tunnels up simultaneously.
!
! For the purposes of the example, the physical datacenter network is 172.16.1.0/24
! and the VPC is 10.0.0.0/16.
@benders
benders / reflate.rb
Created February 7, 2013 01:52
Display the contents of a DEFLATE compressed file (like an HTTP POST body)
#!/usr/bin/env ruby
require 'zlib'
print Zlib::Inflate.new.inflate($<.read)
@benders
benders / .bashrc
Created January 16, 2013 20:16
bashrc voodoo for consistently connecting to ssh-agent
# ssh-agent needs to be running and we need to export the SSH_AUTH_SOCK
# environment variable to point to its location in /tmp/ssh-something/agent.PID
# so, find the ssh-agent PID and derive the socket filename from it, and then
# find that file in its randomly-named directory in /tmp and export that for
# ssh to use.
set -x
SSH_AGENT_PID=`pgrep -n -u $USER ssh-agent`
if [ -n "$SSH_AGENT_PID" ]; then
guessed_ppid=`expr $SSH_AGENT_PID - 1`
@benders
benders / create-database-system.sh
Created September 11, 2012 22:38
Cobbler provisioning helpers
#!/bin/bash
if [ $# -ne 5 ]; then
prog=`basename $0`
echo "Usage $prog <short-hostname> <eth0> <eth1> <eth2> <eth3>" >&2
exit -1
fi
set -xe
@benders
benders / README
Created July 4, 2012 01:17
Using Vagrant and puppet-rbenv
yourproject/
- Vagrantfile
- manifests/
- centos62-64.pp
- modules/
- rbenv/ <-- git submodule of https://github.com/alup/puppet-rbenv
@benders
benders / slice_guard.rb
Created January 4, 2012 03:11
Prevent accidentally calling #[] on a number
# Prevent accidentally calling #[] on a number, we don't bit-slice in this house
[Fixnum, Bignum].each do |k|
k.class_eval do
def [](*args)
raise NoMethodError, "Calling #[] on numbers is wrong. Don't do it."
end
end
end
@benders
benders / nrsysmond.cfg
Created November 8, 2011 19:06
Simple New Relic server monitoring manifest for Puppet
#
# New Relic Server Monitor configuration file.
#
# Lines that begin with a # are comment lines and are ignored by the server
# monitor. For those options that have command line equivalents, if the
# option is specified on the command line it will over-ride any value set
# in this file.
#
#
@benders
benders / chef-nrsysmond.rb
Created November 8, 2011 18:54
Simple New Relic server monitoring recipe for Chef
#
# Thanks to Eron Nicholson at 37 Signals for providing this,
# send thanks to him and blame to me. -Nic Benders
#
template "/etc/apt/sources.list.d/newrelic.list" do
source "newrelic.list.erb"
owner "root"
group "root"
mode 0640