Skip to content

Instantly share code, notes, and snippets.

View mostlyobvious's full-sized avatar

Paweł Pacana mostlyobvious

View GitHub Profile
@mostlyobvious
mostlyobvious / osx_rails_env_setup_in_all_steps.md
Created October 1, 2012 23:29 — forked from solnic/osx_rails_env_setup_in_6_steps.md
Steps to get up'n'running with Rails on OS X and Ubuntu

Steps to set up a Rails development environment on OS X:

  • install Apple Command Line Tools
  • install homebrew[1]: ruby -e "$(curl -fsSkL raw.github.com/mxcl/homebrew/go)"
  • install rvm: curl -L https://get.rvm.io | bash -s stable
  • source $HOME/.rvm/scripts/rvm
  • rvm install --disable-binary 1.9.3
  • rvm use --default 1.9.3
#!/bin/sh
curl -L http://mongrel2.org/static/downloads/mongrel2-1.7.5.tar.bz2 -o - |tar -jxvf -
cd mongrel2-1.7.5
make PREFIX=/opt/mongrel2-1.7.5
sudo make install PREFIX=/opt/mongrel2-1.7.5
cd ..
mkdir mongrel2-1.8.0
curl -L https://github.com/zedshaw/mongrel2/tarball/v1.8.0 -o - |tar --strip-components=1 -C mongrel2-1.8.0 -zxvf -
cd mongrel2-1.8.0
Format: 1.0
Source: mongrel2
Binary: mongrel2
Architecture: any
Version: 1.7.5-1
Maintainer: Paweł Pacana <[email protected]>
Homepage: http://mongrel2.org
Standards-Version: 3.9.2
Build-Depends: debhelper (>= 8.0.0), sqlite3, libsqlite3-dev, libzmq-dev
Depends: libzmq1, sqlite3
# Make sure Udev doesn't block our network
# http://6.ptmc.org/?p=164
echo "cleaning up udev rules"
rm /etc/udev/rules.d/70-persistent-net.rules
mkdir /etc/udev/rules.d/70-persistent-net.rules
rm -rf /dev/.udev/
rm /lib/udev/rules.d/75-persistent-net-generator.rules
${1:-hostname}
sudo virsh -c lxc:/// start template
ssh -i template.key [email protected] $1
sudo virsh -c lxc:/// destroy template
#!/bin/sh
# Mostly deboostrap, but also changes hostname and configures networking
# for guest. Intended to use with lxc and bridged networks with dnsmasq.
PACKAGES=avahi-daemon,openssh-server
USER_NAME=squeeze
DISTRIBUTION=precise
VM_PATH=${1-template}
VM_NAME=$(basename $VM_PATH)
require 'test/unit'
class AssertMatchTest < Test::Unit::TestCase
def test_assertion_count
assert_match /abc/, 'abc'
end
end
# 1.9.3
#
import XMonad
import XMonad.Config.Gnome
import XMonad.Hooks.DynamicLog
import XMonad.Hooks.ManageDocks
import XMonad.Hooks.ManageHelpers
import XMonad.Actions.CycleWS
import XMonad.Actions.WindowGo
import XMonad.Util.WindowProperties
import XMonad.Util.EZConfig
import XMonad.Layout.Named
longer_build_script = <<END
export WEIRD_VAR=3
export GIT_SSH=ssh-with-another-identity-hack
git clone strange_dependency_repo.git somewhere
bundle exec rake test
END
Citrus::Config.new do |c|
# how many isolated VMs to start for each build step,
# $ curl -i -H 'Accept: application/vnd.helloapp-v2+json' http://localhost:8080/hello/prug
#
# HTTP/1.1 200 OK
# Content-Type: application/vnd.helloapp-v2+json
# Vary: Accept
# Content-Length: 11
# Server: Webmachine-Ruby/0.3.0 WEBrick/1.3.1 (Ruby/1.9.2/2011-07-09)
# Date: Thu, 26 Jan 2012 15:27:09 GMT
# Connection: Keep-Alive
#