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
# First allow pushing to the checked-out branch on the remote repo: | |
# git config receive.denyCurrentBranch ignore | |
# Then add this to sync the working dir to the repo on receive: | |
GIT_WORK_TREE=/opt/titan GIT_DIR=/opt/titan/.git git reset --hard | |
# Then, on the local working dir, add the remote: | |
# git remote add test [email protected]:/opt/titan |
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
<?php | |
// Tweak #1 | |
// Load database settings from PRESSFLOW_SETTINGS environment variable... | |
$pressflow_settings = json_decode($_SERVER['PRESSFLOW_SETTINGS'], TRUE); | |
$database_settings = $pressflow_settings['databases']['default']['default']; | |
/** MySQL configs */ | |
define('DB_NAME', $database_settings['database']); | |
define('DB_USER', $database_settings['username']); | |
define('DB_PASSWORD', $database_settings['password']); |
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 | |
# Check on the load times for Ohai plugins. | |
# To disable from chef-solo and chef-client runs see | |
# http://wiki.opscode.com/display/chef/Disabling+Ohai+Plugins | |
require 'benchmark' | |
require 'rubygems' | |
require 'ohai' |
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
{ | |
"node": { | |
"provider_id": 999, | |
"name": "i-12345678", | |
"state": 2, | |
"details": { | |
"status": ["running"], | |
"productcode": ["[]"], | |
"instanceId": ["i-12345678"], | |
"dns_name": ["ec2-174-123-210-12.compute-1.amazonaws.com"], |
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
knife node configure my_node.example.com |
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:: jenkins | |
# Recipe:: default | |
# | |
# https://wiki.jenkins-ci.org/display/JENKINS/Installing+Jenkins+on+Ubuntu | |
# This is super-simple, compared to the other Chef cookbook I found | |
# for Jenkins (https://github.com/fnichol/chef-jenkins). | |
# | |
# This doesn't include Chef libraries for adding Jenkin's jobs via |
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
# Send a metric to statsd from bash | |
# | |
# Useful for: | |
# deploy scripts (http://codeascraft.etsy.com/2010/12/08/track-every-release/) | |
# init scripts | |
# sending metrics via crontab one-liners | |
# sprinkling in existing bash scripts. | |
# | |
# netcat options: | |
# -w timeout If a connection and stdin are idle for more than timeout seconds, then the connection is silently closed. |
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
Nick-Stielaus-MacBook-Pro:chef-repo nstielau$ knife node log nstielau_vagrantup.com | |
Time Recipe Action Resource Type Resource | |
Tue May 10 10:25:20 -0700 2011 nginx::source create template proxy.conf | |
Tue May 10 10:25:20 -0700 2011 nginx::source enable service nginx | |
Tue May 10 09:50:42 -0700 2011 nginx::source create template /etc/init.d/nginx |
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
## Knife plugin to set node environment | |
# See http://wiki.opscode.com/display/chef/Environments | |
# | |
## Install | |
# Place in .chef/plugins/knife/set_environment.rb | |
# | |
## Usage | |
# Nick-Stielaus-MacBook-Pro:chef-repo nstielau$ knife node set_environment mynode.net my_env | |
# Looking for mynode.net | |
# Setting environment to my_env |
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 Mongoid | |
module Processable | |
extend ActiveSupport::Concern | |
included do | |
@action = :process | |
@timeout = 60 | |
@query = {} | |
field :processable, :type => Hash, :default => {:processable => {:locked_by => nil, :locked_at => nil, :last_error => nil}} | |
end |