This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
input { | |
redis { | |
host => "127.0.0.1" | |
type => "redis-input" | |
# these settings should match the output of the agent | |
data_type => "list" | |
key => "logstash" | |
# We use json_event here since the sender is a logstash agent | |
message_format => "json_event" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -x | |
set -e | |
# Setup a new ubuntu 12.04 server | |
# this file can be used as the userdata file for a new instance. | |
# It should set any environments variables needed, and select which setup functions to run, in what order. | |
USERNAME=${1:-deploy} | |
APPNAME=${2:-deploy} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "rubygems" | |
require "em-synchrony" | |
require "em-synchrony/em-http" | |
require 'faraday' | |
class Kiss | |
# post event data to kiss_metrics API | |
def self.send(data) | |
@conn ||= Faraday.new(:url => 'https://trk.kissmetrics.com/', :ssl => {:ca_path => "/usr/lib/ssl/certs"}) do |builder| | |
builder.response :logger |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cd ~ | |
sudo apt-get install unzip | |
sudo apt-get install python-software-properties -y | |
sudo add-apt-repository "deb http://archive.canonical.com/ lucid partner" | |
sudo apt-get update | |
sudo apt-get install sun-java6-jre sun-java6-plugin -y | |
wget https://github.com/downloads/elasticsearch/elasticsearch/elasticsearch-0.18.7.tar.gz -O elasticsearch.tar.gz | |
tar -xf elasticsearch.tar.gz |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# merge a hash, only updating the first hash with values from the second where the first already has an exisitng key | |
# for example, | |
# a= {"a"=>1, "b"=>2, "z"=>3} | |
# b= {"x"=>99, "y"=>88, "z"=>77} | |
# will result in {"a"=>1, "b"=>2, "z"=>77} | |
def update_existing(a, b) | |
a.inject({}){|sum, el| (b.has_key?(el.first) && b[el.first]) ? sum.update(el.first=>b[el.first]) : sum[el.first]=a[el.first]; sum} | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
source :rubygems | |
gem 'sinatra' | |
gem 'json' | |
gem 'omniauth' | |
gem 'omniauth-oauth2' | |
gem 'omniauth-github' | |
# gem 'omniauth-att', :path => File.expand_path("./../../omniauth-att", __FILE__) | |
gem 'thin' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@@ layout | |
%html | |
%head | |
%link(rel="stylesheet" href="http://twitter.github.com/bootstrap/1.4.0/bootstrap.min.css") | |
%body | |
.container | |
.content | |
= yield |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require 'pry' | |
require 'ticketmaster' | |
require 'ticketmaster-redmine' | |
require 'ticketmaster-kanbanpad' | |
def redmine(opts={}) | |
@redmine ||= TicketMaster.new(:redmine, {:username => "fairchild", :password => "me", :server => "https://tracker.tfoundry.com/"}) | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Prepare a node to run chef-client | |
# Apt-install various things necessary for Ruby, guest additions, | |
# etc., and remove optional things to trim down the machine. | |
apt-get -y update | |
apt-get -y upgrade | |
apt-get -y install | |
# Install build requirements for common ruby packages | |
apt-get -y install build-essential zlib1g-dev libssl-dev libreadline-gplv2-dev libxml2-dev libxslt1-dev |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/ruby | |
# apt-get install freeipmi-tools ruby rubygems | |
# gem install gmetric | |
require 'rubygems' | |
require 'gmetric' | |
require "socket" |