Skip to content

Instantly share code, notes, and snippets.

@crofty
crofty / CouchDB setup on slicehost
Created September 9, 2009 15:22
CouchDB setup on Slicehost
sudo apt-get update
sudo aptitude install build-essential
sudo apt-get install libmozjs-dev libicu-dev libcurl4-openssl-dev erlang
mkdir ~/src
cd ~/src
wget http://apache.mirror.anlx.net/couchdb/0.9.1/apache-couchdb-0.9.1.tar.gz
tar zxvf apache-couchdb-0.9.1.tar.gz
cd apache-couchdb-0.9.1
./configure && make && sudo make install
@crofty
crofty / jruby_setup_on_slicehost.sh
Created November 3, 2009 15:31
jruby setup on slicehost
sudo vi /etc/apt/sources.list
# Add multiverse to the end of each of the strings
sudo apt-get update
sudo apt-get install sun-java6-jdk
java -version
#java version "1.6.0_06"
#Java(TM) SE Runtime Environment (build 1.6.0_06-b02)
#Java HotSpot(TM) 64-Bit Server VM (build 10.0-b22, mixed mode)
@crofty
crofty / Integrity_ci_setup_on_slicehost.sh
Created November 3, 2009 17:37
Integrity CI setup on slicehost
# Integrity CI setup on slicehost
useradd -m ci
sudo passwd ci
su ci
bash
gem install bundler
git clone git://github.com/integrity/integrity
cd integrity
git checkout -b deploy v0.2.0
@crofty
crofty / projects_controller.rb
Created November 5, 2009 14:36
Standard Rails REST resource
class ProjectsController < ApplicationController
# GET /projects
# GET /projects.xml
def index
@projects = Project.all
respond_to do |format|
format.html # index.html.erb
format.xml { render :xml => @projects }
end
@crofty
crofty / postgres setup ubuntu
Created December 2, 2009 21:34
Postgres setup
# Postgres install on ubuntu
sudo apt-get install postgresql
# Log in with
sudo -u postgres psql postgres
# change password by issuing
\password postgres
# create databases with
chsh -s /bin/bash
@crofty
crofty / See network traffic
Created February 12, 2010 09:09
see netork traffic
sudo tcpdump -i en1 -n -s 0 -w - | grep -a -o -E "Host\: .*|GET \/.*"
// Standard jQuery plugin pattern
(function($){
$.fn.pluginName = function(options) {
var options = $.extend({},$.fn.pluginName.defaults,options)
return this.each(function() {
// Code goes here
// $(this) //DOM element
//
# Snow Leopard
ARCHFLAGS="-arch x86_64" gem install mysql -v=2.7 -- --with-mysql-config=/usr/local/bin/mysql_config
# Leopard
env ARCHFLAGS="-arch i386" gem install mysql -- --with-mysql-dir=/usr/local/mysql --with-mysql-lib=/usr/local/mysql/lib --with-mysql-include=/usr/local/mysql/include
history 1000 | awk '{a[$2]++}END{for(i in a){print a[i] " " i}}' | sort -rn | head