This file contains hidden or 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
| #!/usr/bin/env ruby | |
| # Save this somewhere, chmod 755 it, then add | |
| # complete -C path/to/this/script -o default rake | |
| # to your ~/.bashrc | |
| # | |
| # If you update your tasks, just $ rm ~/.raketabs* | |
| # | |
| # Adapted from | |
| # http://onrails.org/articles/2006/08/30/namespaces-and-rake-command-completion |
This file contains hidden or 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 a short collection of resources I have used in packaging Chef for Debian. | |
| Good starting point, links to some of the other pages here: | |
| * http://www.xs4all.nl/~carlo17/howto/debian.html | |
| Debian New Maintainers guide: | |
| * http://www.debian.org/doc/maint-guide/ |
This file contains hidden or 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
| #!/usr/bin/sh | |
| ARCHFLAGS='-arch i386 -arch x86_64' rvm install 1.8.6 --debug --reconfigure -C --enable-shared=yes | |
| wget http://sourceforge.net/projects/rubycocoa/files/RubyCocoa/1.0.1/RubyCocoa-1.0.1.tar.gz/download && \ | |
| tar xzf RubyCocoa-1.0.1.tar.gz && \ | |
| rm RubyCocoa-1.0.1.tar.gz && \ | |
| cd RubyCocoa-1.0.1 && \ | |
| ruby install.rb config \ | |
| ruby install.rb setup && \ |
This file contains hidden or 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
| #!/usr/bin/env ruby | |
| require 'rubygems' | |
| require 'active_support' | |
| require 'ri_cal' | |
| def create_calendar(options={:all_events => false, :dtstamp => false}) | |
| Time.zone = "Eastern Time (US & Canada)" | |
| calendar = RiCal.Calendar do |cal| | |
| cal.event do |event| |
This file contains hidden or 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
| # | |
| # Cookbook Name:: delayed_job | |
| # Recipe:: default | |
| # | |
| if ['solo', 'app', 'app_master'].include?(node[:instance_role]) | |
| # be sure to replace "app_name" with the name of your application. | |
| run_for_app("maloca") do |app_name, data| | |
This file contains hidden or 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
| module Jobs | |
| class HelloWorld < Struct.new(:text) | |
| def perform | |
| Rails.logger.debug text | |
| Rails.logger.debug "sleeping for 7 seconds" | |
| sleep(7) | |
| end | |
| end | |
This file contains hidden or 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
| #!/bin/sh | |
| # Demo how your can merge opscode chef-repo & cookbooks | |
| # and perm. keep up to date with opscode cookbooks (the last "git" cmd) | |
| % git clone git://github.com/opscode/chef-repo.git | |
| Initialized empty Git repository in /home/tim/src/chef-repo/.git/ | |
| remote: Counting objects: 107, done. | |
| remote: Compressing objects: 100% (99/99), done. | |
| remote: Total 107 (delta 45), reused 0 (delta 0) | |
| Receiving objects: 100% (107/107), 16.14 KiB, done. | |
| Resolving deltas: 100% (45/45), done. |
This file contains hidden or 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
| task :production do | |
| set :rails_env, "production" | |
| role :app, "example.com", :master => true | |
| role(:app) { |opts| compute_ec2_addresses(:app, opts) } | |
| role(:db, :master => true) { |opts| compute_ec2_addresses(:db, opts) } | |
| end | |
| task :staging do | |
| set :rails_env, "staging" | |
| role :app, "staging.example.com", :master => true |
This file contains hidden or 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
| on handle_string(logentry) | |
| do shell script "~/.bin/worklog '" & logentry & "'" | |
| end handle_string |
This file contains hidden or 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 | |
| module Mixin | |
| module Language | |
| # esearch(:node, 'role\[admin\]') | |
| # recursively search for this role/recipe in all roles | |
| def esearch(context, search) | |
| if context == :role | |
| ret = [] | |
| # First solve all roles: | |
| roles = search(:role, search) |