Skip to content

Instantly share code, notes, and snippets.

+ [[ -n '' ]]
+ export 'PS4=+ ${BASH_SOURCE##${rvm_path:-}} : ${FUNCNAME[0]:+${FUNCNAME[0]}()} ${LINENO} > '
+ PS4='+ ${BASH_SOURCE##${rvm_path:-}} : ${FUNCNAME[0]:+${FUNCNAME[0]}()} ${LINENO} > '
+ /scripts/cli : __rvm_parse_args() 701 > [[ -z '' ]]
+ /scripts/cli : __rvm_parse_args() 701 > [[ -n '' ]]
+ /scripts/cli : __rvm_parse_args() 703 > [[ 0 -eq 1 ]]
+ /scripts/cli : __rvm_parse_args() 703 > [[ -n '' ]]
+ /scripts/cli : __rvm_parse_args() 18 > [[ -n --default ]]
+ /scripts/cli : __rvm_parse_args() 20 > rvm_token=--default
+ /scripts/cli : __rvm_parse_args() 22 > [[ 2 -gt 0 ]]
@hedgehog
hedgehog / chef_solo_patch.rb
Created June 28, 2011 02:12 — forked from timdiggins/chef_solo_patch.rb
Monkeypatch for chef solo to do basic data_bag manipulations
# save this in the library folder of a cookbook
# (e.g. ./coookbooks/vagrant/library/chef_solo_patch.rb)
# see also https://gist.github.com/867958 for vagrant patch
# based on http://lists.opscode.com/sympa/arc/chef/2011-02/msg00000.html
if Chef::Config[:solo]
class Chef
module Mixin
module Language
def data_bag(bag)
@hedgehog
hedgehog / chef-stacktrace.out
Created June 26, 2011 12:14
Chef server install via Chef-solo
Generated at 2011-06-26 11:49:03 +0000
Chef::Exceptions::Exec: service[chef-expander] (chef-server::rubygems-install line 142) had an error: /usr/bin/chpst -u root /usr/bin/sv restart /etc/service/chef-expander returned 1, expected 0
---- Begin output of /usr/bin/chpst -u root /usr/bin/sv restart /etc/service/chef-expander ----
STDOUT: timeout: run: /etc/service/chef-expander: (pid 8227) 130s, got TERMSTDERR:
---- End output of /usr/bin/chpst -u root /usr/bin/sv restart /etc/service/chef-expander ----
/usr/lib/ruby/gems/1.9.2-p180/gems/chef-0.10.0/lib/chef/mixin/command.rb:185:in `handle_command_failures'
/usr/lib/ruby/gems/1.9.2-p180/gems/chef-0.10.0/lib/chef/mixin/command.rb:132:in `run_command'
/usr/lib/ruby/gems/1.9.2-p180/gems/chef-0.10.0/lib/chef/provider/service/simple.rb:98:in `restart_service'
/usr/lib/ruby/gems/1.9.2-p180/gems/chef-0.10.0/lib/chef/provider/service/init.rb:51:in `restart_service'
@hedgehog
hedgehog / erl_crash.dump
Created June 26, 2011 05:34
Chef server 0.10.0 startup failure
=erl_crash_dump:0.1
Sun Jun 26 04:56:48 2011
Slogan: init terminating in do_boot ()
System version: Erlang R13B03 (erts-5.7.4) [source] [64-bit] [rq:1] [async-threads:30] [hipe] [kernel-poll:true]
Compiled: Tue Oct 5 13:43:51 2010
Atoms: 14174
=memory
total: 14646568
processes: 1458328
processes_used: 1427120
@hedgehog
hedgehog / pause_spec.rb
Created June 24, 2011 05:05
pause until timeout
describe "with arguments" do
before :all do
@url_stub = "http://not.there.com:88/"
end
context 'the web server is not running' do
it "should wait for the given URL to respond with the expected code" do
pause_for_url_response( 3, @stub_url, '200', 1).should raise_error Timeout::Error
end
end
context 'the web server is now running' do
@hedgehog
hedgehog / gist:1041668
Created June 23, 2011 01:01
chef-solo bootstrap of chef-server error: setup seemed fine after rerunning chef-solo -c /etc/chef/solo.rb -j /etc/chef/solo.json
We couldn’t find that file to show.
# Author:: Adam Jacob <adam@opscode.com>
# Author:: Joshua Timberman <joshua@opscode.com>
#
# Copyright 2009-2010, Opscode, Inc
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#!/bin/sh
# standard ubuntu gem pakage adds alternative for gem
# it should be removed first time
#
# update-alternatives --remove-all gem
update-alternatives --remove-all ruby
update-alternatives --install /usr/bin/ruby ruby /opt/ruby-enterprise/bin/ruby 600 \

GitHub OAuth Busy Developer's Guide

This is a quick guide to OAuth2 support in GitHub for developers. This is still experimental and could change at any moment. This Gist will serve as a living document until it becomes finalized at Develop.GitHub.com.

OAuth2 is a protocol that lets external apps request authorization to private details in your GitHub account without getting your password. All developers need to register their application before getting started.

Web Application Flow

  • Redirect to this link to request GitHub access:
@hedgehog
hedgehog / ubuntu10.04-ruby192.erb
Created June 15, 2011 06:03 — forked from czottmann/ubuntu10.04-ruby192.erb
Ubuntu 10.04 + Ruby 1.9.2p180 chef bootstrap file
bash -c '
if [ ! -f /usr/local/bin/chef-client ]; then
apt-get update
apt-get -y upgrade
apt-get install -y build-essential wget zlib1g-dev libssl-dev libffi-dev
cd /usr/src
wget ftp://ftp.ruby-lang.org//pub/ruby/1.9/ruby-1.9.2-p180.tar.bz2
tar xjf ruby-1.9.2-p180.tar.bz2
cd ruby-1.9.2-p180
./configure