This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
from fabric.api import env, task, roles, run | |
from fabric.utils import abort | |
from chef import ChefAPI, autoconfigure | |
from chef.fabric import chef_roledefs | |
if 'OC_USER' in os.environ: | |
env.user = os.environ['OC_USER'] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
desc "Run librarian" | |
task :librarian do | |
puts "** Syncing with Cheffile" | |
system("librarian-chef install") | |
end | |
# Extend the existing task to also call librarian | |
task :update do | |
Rake::Task[:librarian].invoke | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Chef | |
class Recipe | |
def new_name(*args, &block) | |
method_missing(:old_name, *args, &block) | |
end | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'octokit' | |
c = Octokit::Client.new(:login => "...", :password => "...") | |
conn = c.instance_exec{connection} | |
c.repos.each do |r| | |
puts "Trying to unsub #{r.name}" | |
begin | |
conn.get("/repos/#{c.login}/#{r.name}/hooks").body.each do |hook| |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Chunked < FaradayMiddleware::ResponseMiddleware | |
define_parser { |body| | |
return if body.empty? | |
raw_body = body | |
decoded_body = [] | |
until raw_body.empty? | |
chunk_len, raw_body = raw_body.split("\r\n", 2) | |
chunk_len = chunk_len.split(';',2).first.hex | |
break if chunk_len == 0 | |
decoded_body << raw_body[0, chunk_len] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@import "susy"; | |
$grid-info-stack: (); | |
@function _stack_push($list, $item) { | |
@return join($item, $list); | |
} | |
@function _stack_top($list) { | |
@return nth($list, 1); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Install to ~/.chef/bootstrap/ubuntu10.04-gems-debug.erb and then add "-d ubuntu10.04-gems-debug" to the end of your bootstrap or server create command. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# This is the template file | |
# | |
<Port <%= @port %> > | |
# bla bla bla | |
</Port> | |
# | |
# The problem is I get several files; port_80.conf port_8080.conf, ... port_8888.conf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
r = gem_package "amazon-ec2" do | |
version "0.9.17" | |
end | |
r.run_action(:install) | |
require 'rubygems' | |
Gem.clear_paths | |
require 'AWS' | |
ruby_block "register_with_elb" do |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django import forms | |
from django.core.exceptions import ValidationError | |
from commis.api.cookbook.models import CookbookRecipe | |
from commis.api.node.models import Node | |
from commis.api.role.models import Role | |
class MultipleChoiceAnyField(forms.MultipleChoiceField): | |
"""A MultipleChoiceField with no validation.""" |