Skip to content

Instantly share code, notes, and snippets.

Avatar

Michael Fairchild fairchild

  • Procore
  • California
View GitHub Profile
@fairchild
fairchild / setup_elastic_search.sh
Created Dec 16, 2012 — forked from johnvilsack/es.sh
installs elasticsearch on ubuntu 12.04 and 12.10
View setup_elastic_search.sh
# installs elasticsearch on ubuntu 12.04 and 12.10
wget http://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-0.20.1.deb
sudo dpkg -i elasticsearch-0.20.1.deb
@fairchild
fairchild / fix_nokogiri_libxml_mismatch_on_mavericks.sh
Last active Nov 4, 2015 — forked from devpuppy/nokogiri libxml homebrew lion
eliminate the annoying nokogiri LibXML version mismatch on OSX
View fix_nokogiri_libxml_mismatch_on_mavericks.sh
#!/bin/bash
# FIXME:
# WARNING: Nokogiri was built against LibXML version 2.9.0, but has dynamically loaded 2.8.0
NOKOGIRIR_VERSION=${1:-1.6.1}
LIBXML_VERSION=${2:-2.9.1}
LIBXSLT_VERSION=${3:-1.1.28}
gem uninstall nokogiri libxml-ruby
View foo.rb
#!/usr/bin/ruby
require 'net/http'
META_BASE = "/2008-02-01/meta-data"
def server
@server ||= Net::HTTP.new("169.254.169.254")
end
@fairchild
fairchild / es.sh
Created May 20, 2012 — forked from shaneog/es.sh
Install ElasticSearch on Ubuntu 11.04
View es.sh
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
View pitoval_import.rake
begin
require 'ruport'
rescue LoadError => err
warn "Couldn't load ruport gem: #{err}"
end
namespace :import do
desc 'Import tickets from CSV File'
task :csv => :environment do
View etherpad-batch-import.rb
#!/usr/bin/env ruby
# lib/etherpad.rb
#
# mechanize => 1.0.0
%w{rubygems nokogiri mechanize json logger}.each {|l| require l }
class Etherpad
def initialize(base_url, username, password)
@@base_url = base_url
@@username = username
View vboxfwd
#!/bin/sh
if [ $# != 5 ]; then
echo "Utility for setting up NAT forwarding to VBox guests"
echo "Usage: $0 GUEST SERVICE PROTOCOL GUESTPORT HOSTPORT"
echo "E.g. $0 \"Linux Guest\" guestssh TCP 22 2222"
echo "NOTE: Port forwarding will only affect stopped VMs"
exit 1
fi
guest=$1
View ks-cloud.cfg.txt
install
url --url http://10.15.0.50/centos/5/os/x86_64/
lang en_US.UTF-8
rootpw --iscrypted $1$Hi/9xDlZ$nrLa2780lRFXv4QPEK./I0
firewall --disabled
authconfig --enableshadow --enablemd5
selinux --permissive
timezone America/Los_Angeles
bootloader --location=mbr --driveorder=xvda --append="console=xvc0"
clearpart --all --initlabel
View gist:277752
pool :sandbox do
cloud :hello do
instances 1..1
using :ec2
end
end
View backup-delicious.sh
#!/bin/bash
# backup your delicious bookmarks
curl -k --user `cat password.txt` -o backup.xml -O 'https://api.del.icio.us/v1/posts/all'
You can’t perform that action at this time.