Skip to content

Instantly share code, notes, and snippets.

View barinek's full-sized avatar

Barinek barinek

  • Initial Capacity
  • Boulder, CO
View GitHub Profile
@barinek
barinek / nagios xmpp check
Created January 7, 2010 02:18
nagios xmpp check
#! /usr/bin/env ruby
require 'rubygems'
require 'main'
require 'xmpp4r'
require File.dirname(__FILE__) + "/nagios_helpers"
class NoErrorsFoundInLogs < Exception;
end
@barinek
barinek / nginx with thin and monk
Created January 6, 2010 16:14
nginx with thin and monk
#!/bin/bash
source /etc/profile
for ruby_package in ruby-ri-1.8.5 ruby-rdoc-1.8.5 ruby-irb-1.8.5 ruby-docs-1.8.5 ruby-tcltk-1.8.5 ruby-1.8.5 ruby-mode-1.8.5 rrdtool-ruby-1.2.27 ruby-devel-1.8.5.x86_64 ruby-devel-1.8.5.i386 ruby-libs-1.8.5.x86_64 ruby-libs-1.8.5.i386
do
if rpm -q $ruby_package >/dev/null; then
echo $ruby_package
rpm -e $ruby_package;
fi
@barinek
barinek / nginx with passenger and rails
Created January 6, 2010 16:13
nginx with passenger and rails
#!/bin/bash
source /etc/profile
for ruby_package in ruby-ri-1.8.5 ruby-rdoc-1.8.5 ruby-irb-1.8.5 ruby-docs-1.8.5 ruby-tcltk-1.8.5 ruby-1.8.5 ruby-mode-1.8.5 rrdtool-ruby-1.2.27 ruby-devel-1.8.5.x86_64 ruby-devel-1.8.5.i386 ruby-libs-1.8.5.x86_64 ruby-libs-1.8.5.i386
do
if rpm -q $ruby_package >/dev/null; then
echo $ruby_package
rpm -e $ruby_package;
fi
@barinek
barinek / aws snapshots with capistrano
Created January 5, 2010 18:30
aws snapshots with capistrano
require 'aws'
namespace :aws do
task :create_snapshot do
instances.each do |instance|
ec2 = ec2_connect
volume_ids = find_volume_ids_for_instance(instance)
if volume_ids
volume_ids.each do |volume_id|
@barinek
barinek / aws base package
Created December 29, 2009 17:52
aws base package
#!/bin/sh
yum install -y wget ntp
source "/var/spool/ec2/meta-data.sh"
echo "$EC2_LOCAL_IPV4 $HOST_NAME" >> /etc/hosts
hostname $HOST_NAME
echo "HOSTNAME=$HOST_NAME" >> /etc/sysconfig/network
@barinek
barinek / ohm task queue
Created December 26, 2009 19:10
ohm task queue
class Task < Ohm::Model
include Comparable
attribute :url
attribute :eta
attribute :params
attribute :queue_name
index :url
index :eta