Skip to content

Instantly share code, notes, and snippets.

View xmas-lights-1.ino
#include <FastLED.h>
#include <MicroView.h>
#include <RBD_Timer.h>
#include <RBD_Button.h>
FASTLED_USING_NAMESPACE
// FastLED "100-lines-of-code" demo reel, showing just a few
// of the kinds of animation patterns you can quickly and easily
// compose using FastLED.
@benders
benders / squid.conf
Last active Mar 26, 2017
QNAP squid.conf
View squid.conf
# The user name and group name Squid will operate as
cache_effective_user httpdusr
cache_effective_group everyone
#
# Recommended minimum configuration:
#
# Auth Method
#auth_param basic program /share/MD0_DATA/.qpkg/Squid/opt/libexec/squid/ncsa_auth /etc/shadow
#auth_param basic children 5
@benders
benders / iscsi-removal.txt
Created Jan 17, 2014
isci removal example
View iscsi-removal.txt
df ; echo ; pvs
vgchange --available n VolGroupBackUps
multipath -ll
multipath -f mpath2
/etc/init.d/multipathd stop
chkconfig multipathd off
iscsiadm -m node
View ubuntu-fixup.sh
#!/bin/bash
set -ex
wget -O /etc/apt/sources.list https://gist.github.com/benders/8426266/raw/b4969acb524ba727b64cf8eaee7a6a31be8ae6fb/precise-sources.list
apt-get update
wget -O /tmp/pe3-install.sh https://gist.github.com/benders/8426266/raw/b1d4c9b6ea41839b74842f05f2ae9efba7a10394/ubuntu-pe-3-install.sh
@benders
benders / delayed_job_classifier.sql
Last active Dec 27, 2015
Figure out WTF is in our delayed_job queue
View delayed_job_classifier.sql
SELECT
count(*) as count, priority, object, method from (
SELECT
@load_start := LOCATE('object: LOAD;', handler),
@method_start := LOCATE('method: ', handler) + 9,
@method_end := LOCATE('args:', handler) - 1,
IF(@load_start,
@object_start := @load_start + 13,
@object_start := LOCATE('object: !ruby/object:', handler) + 21
),
@benders
benders / config.ru
Created Oct 19, 2013
Get some New Relic on a Puppet Master server (version 2.7)
View config.ru
# Oh ho ho, let's see if we can have some fun with the Ruby Agent - Nic 2013-10-18
require 'rubygems'
require 'newrelic_rpm'
require 'new_relic/agent/instrumentation/rack'
# END monkey-business
# A "config.ru", for use with every Rack-compatible webserver.
# SSL needs to be handled outside this, though.
$0 = "master"
@benders
benders / new-employee-setup.txt
Last active Dec 17, 2015
New Employee setup
View new-employee-setup.txt
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 Jul 27, 2016
New Employee git setup
View git-setup.sh
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 Nov 23, 2021
Getting Amazon VPC up and running with Cisco ASAs can be a pain. This is the config that we used to make it work.
View cisco-asa-config.txt
! --------------------------------------------------------------------------------
! 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 Feb 7, 2013
Display the contents of a DEFLATE compressed file (like an HTTP POST body)
View reflate.rb
#!/usr/bin/env ruby
require 'zlib'
print Zlib::Inflate.new.inflate($<.read)