Skip to content

Instantly share code, notes, and snippets.

View warwickp's full-sized avatar
🏠
Working from home

Warwick Poole warwickp

🏠
Working from home
View GitHub Profile
@oroce
oroce / nginx.conf
Created January 31, 2014 20:40
nginx config for using grafana, elasticsearch and graphite with authentication.
user www-data;
worker_processes 1;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
}
http {
sendfile on;
@prsimp
prsimp / README.md
Last active December 11, 2015 07:38
Upgrading Ruby and rbenv: A guide to upgrading Ruby and rbenv

Assumptions

  1. You installed rbenv and ruby-build via homebrew.
  2. (Optional) You are listening to Ke$ha.

Simple Upgrade

  1. Open a terminal.
  2. curl https://gist.githubusercontent.com/prsimp/4567288/raw/upgrade_it.sh | sh
  3. Drink some coffee or do something while Ruby compiles.
$ wget http://download.savannah.gnu.org/releases/libunwind/libunwind-1.0.1.tar.gz
$ wget http://gperftools.googlecode.com/files/gperftools-2.0.tar.gz
$ tar zxvf libunwind-1.0.1.tar.gz && cd libunwind-1.0.1
$ CFLAGS=-fPIC ./configure
$ make CFLAGS=-fPIC
$ sudo make CFLAGS=-fPIC install
$ cd ..
$ tar zxvf gperftools-2.0.tar.gz
@bhenerey
bhenerey / ideal ops.md
Created May 23, 2012 19:40
ideal ops checklist

In a perfect world, where things are done well, not just quickly, I would expect to find the following when joining the company:

Documentation

  • Accurate / up-to-date systems architecture diagram

  • Accurate / up-to-date network diagram

  • Out-of-hours support plan

  • Incident management plan

@r38y
r38y / cunt.rb
Created October 31, 2011 19:59
Help prevent typos
class Object
def cunt
"I'm guessing you meant 'count'?"
end
end
@nstielau
nstielau / set_environment.rb
Created May 9, 2011 00:04
A Knife plugin to set node environment
## Knife plugin to set node environment
# See http://wiki.opscode.com/display/chef/Environments
#
## Install
# Place in .chef/plugins/knife/set_environment.rb
#
## Usage
# Nick-Stielaus-MacBook-Pro:chef-repo nstielau$ knife node set_environment mynode.net my_env
# Looking for mynode.net
# Setting environment to my_env
@karmi
karmi / ElasticSearch.org.Website.Search.FieldNotes.markdown
Created April 8, 2011 17:15
Field notes gathered during installing and configuring ElasticSearch for http://elasticsearch.org

ElasticSearch.org Website Search: Field Notes

These are field notes gathered during installation of website search facility for the ElasticSearch website.

You may re-use it to put a similar system in place.

The following assumes:

Setup a Three Server HAPROXY/APACHE2 Setup

Demo Part One (Launch an Apache Server)

Start the demo by launching three EC2 instances then tell the audience that this will take about 3 minutes. Also explain that we not only starting the instances we are also bootstrapping it with the Chef client (Easy Peasy)...

./setupDemo.sh 

Sample Script

@jtimberman
jtimberman / gist:639638
Created October 21, 2010 23:56 — forked from btm/gist:639581
different ways to get interface IPs
$ grep 'node\[:network\]\[:interfaces\].' \#chef.log
10:15 < mkent_> node[:network][:interfaces][:eth1][:addresses]
22:24 <+Damm> msf, just pulling in the node[:network][:interfaces] attributes
20:44 < randybias> node[:network][:interfaces][:eth0][:addresses]
09:13 < sinBot> so fujin if I wanted to use that in an erb template, it'd be <%= @node[:network][:interfaces]["en1"]["addresses"].select{address}.flatten.to_str %> ?
12:27 < cwj> if i have an ipv4 ip address set on eth0, will it always be in @node[:network][:interfaces][:eth0][1] ?
02:19 < pluesch0r> however, i don't seem to be able to access @node[:network][:interfaces]... from inside the attributes file.
19:52 <@jtimberman> or node[:network][:interfaces][:eth0][:addresses][0]
20:09 < seryl> well, it's searchable. I'm trying the @node[:network][:interfaces][:eth0][:addresses][0] route, but getting blanks right now, playing around with it in chef solo
20:29 < kallistec> pp node[:network][:interfaces].current_attribute
@jqr
jqr / nginx.conf
Created March 26, 2009 19:52
Nginx cache busting rewriter
# Nginx cache busting rewriter, best used on assets that have long-lived expires.
#
# Rewrites like so:
# blah.com/release_ab2ea212312.../file.css => blah.com/file.css
#
location ~ ^/release_(.*?)/ {
rewrite ^/release_(.*?)/(.*)$ /$2 last;
}