Skip to content

Instantly share code, notes, and snippets.

View jschairb's full-sized avatar

Josh Schairbaum jschairb

View GitHub Profile
@jschairb
jschairb / install-minecraft.sh
Created August 2, 2011 15:17
Bootstrap Minecraft on Ubuntu
#!/usr/bin sh
apt-get install python-software-properties screen -y
add-apt-repository "deb http://archive.canonical.com/ubuntu natty partner"
apt-get update
apt-get install sun-java6-jre sun-java6-plugin
apt-get upgrade -y
update-alternatives --config java
java -version
#
# = Capistrano database.yml task
#
# Provides a couple of tasks for creating the database.yml
# configuration file dynamically when deploy:setup is run.
#
# Category:: Capistrano
# Package:: Database
# Author:: Simone Carletti <weppos@weppos.net>
# Copyright:: 2007-2010 The Authors
describe Example do
it "integrates with API Services" do
pending("[123456] Integrate with API Services") do
# (...)
end
end
end
#!/bin/sh
aptitude update
aptitude safe-upgrade -y
apitude install ruby-full git-core mysql-server mysql-client apache2-mpm-worker libmysql-ruby -y
wget http://production.cf.rubygems.org/rubygems/rubygems-1.3.7.tgz
tar xzvf rubygems-1.3.7.tgz
cd rubygems-1.3.7
@jschairb
jschairb / pivotmine.rb
Created October 15, 2010 19:39
Simple script to paginate issues in Redmine and load them into Pivotal Tracker.
#!/usr/bin/env ruby
require 'rubygems'
require 'active_resource'
require 'redmine_client'
require 'pivotal-tracker'
require 'yaml'
ActiveResource::Base.logger = Logger.new(STDOUT)
ActiveResource::Base.logger.level = Logger::DEBUG
# I know there are 80 issues associated with this project
page_one = RedmineClient::Issue.find(:all, :params => { :project_id => @project_id, :page => 1 } )
# returns 1st 25 records
page_five = RedmineClient::Issue.find(:all, :params => { :project_id => @project_id, :page => 5 })
# returns 1st 25 records
@jschairb
jschairb / 0what.md
Created August 30, 2009 20:20 — forked from defunkt/0what.md

Poor Man's Deploy

  • Start a Sinatra server on port 4000
  • GET / to that server triggers a git pull and mod_rails restart
  • Hit port 4000 locally after pushing

Why?

# http://www.jamesbritt.com/2007/12/18/sending-mail-through-gmail-with-ruby-s-net-smtp
# http://d.hatena.ne.jp/zorio/20060416
require "openssl"
require "net/smtp"
Net::SMTP.class_eval do
private
def do_start(helodomain, user, secret, authtype)
raise IOError, 'SMTP session already started' if @started
@jschairb
jschairb / httpdump
Created April 4, 2009 16:36 — forked from peterc/httpdump
# Monitor HTTP requests being made from your machine with a one-liner..
# Replace "en1" below with your network interface's name (usually en0 or en1)
sudo tcpdump -i en1 -n -s 0 -w - | grep -a -o -E "Host\: .*|GET \/.*"
# OR.. to be able to use as "httpdump" from anywhere, drop this into ~/.bash_profile:
# (again replace "en1" with correct network interface name)
alias httpdump="sudo tcpdump -i en1 -n -s 0 -w - | grep -a -o -E "Host\: .*|GET \/.*""
# All the above tested only on OS X.
# this goes in the $HOME dir
# needs mislav-rspactor v0.3.2 and RSpec 1.2
Rspactor::Runner.class_eval do
class << self
alias old_formatter_opts formatter_opts
def formatter_opts
# update this path to where you saved unicode_formatter.rb
old_formatter_opts + " -r /Users/mislav/Projects/unicode_formatter -f UnicodeFormatter"
end