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
# | |
# Need to move your initial ~/.chef to ~/.chef-ENV | |
# | |
alias prod="rm ~/.chef; ln -sf ~/.chef-prod ~/.chef; export CHEF_ENV=prod" | |
alias dev="rm ~/.chef; ln -sf ~/.chef-dev ~/.chef; export CHEF_ENV=dev" | |
function knife_env { | |
if [ -e ~/.chef ] ; then | |
# gls on osx/homebrew assumes you have installed gnu fileutils. change to ls on linux | |
echo `gls -dl --indicator-style=none ~/.chef | awk -F- '{print $5}'` |
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
ec2-23-20-198-99.compute-1.amazonaws.com [Fri, 20 Jul 2012 05:22:24 +0000] INFO: Chef Run complete in 477.254228577 seconds | |
ec2-23-20-198-99.compute-1.amazonaws.com [Fri, 20 Jul 2012 05:22:24 +0000] INFO: Running report handlers | |
ec2-23-20-198-99.compute-1.amazonaws.com [Fri, 20 Jul 2012 05:22:24 +0000] ERROR: Report handler MailHandler raised #<Gem::LoadError: Could not find highline (>= 1.6.9) amongst [god-0.12.1]> | |
ec2-23-20-198-99.compute-1.amazonaws.com [Fri, 20 Jul 2012 05:22:24 +0000] ERROR: /opt/chef/embedded/lib/ruby/site_ruby/1.9.1/rubygems/dependency.rb:247:in `to_specs' | |
ec2-23-20-198-99.compute-1.amazonaws.com [Fri, 20 Jul 2012 05:22:24 +0000] ERROR: /opt/chef/embedded/lib/ruby/site_ruby/1.9.1/rubygems/specification.rb:451:in `block in find_in_unresolved' | |
ec2-23-20-198-99.compute-1.amazonaws.com [Fri, 20 Jul 2012 05:22:24 +0000] ERROR: /opt/chef/embedded/lib/ruby/site_ruby/1.9.1/rubygems/specification.rb:451:in `map' | |
ec2-23-20-198-99.compute-1.amazonaws.com [Fri, 20 Jul 2012 05:22:24 +0000] ERROR: / |
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
# Convert any YouTube video into an audio file you can listen to on the go, using: | |
# http://rg3.github.com/youtube-dl/ | |
{ ~ } > brew install ffmpeg | |
{ ~ } > brew install ffprobe | |
{ ~ } > wget https://raw.github.com/rg3/youtube-dl/2012.02.27/youtube-dl | |
{ ~ } > chmod u+x youtube-dl | |
# Pick which video format you want to download.. (use any YT video link) |
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
# AMI: ubuntu/images/ebs/ubuntu-precise-12.04-amd64-server-20120424 (ami-a29943cb) | |
# | |
# Part 1: Make a deb package of ruby: | |
# Get our deps | |
sudo apt-get install python-setuptools python-dev build-essential dpkg-dev libopenssl-ruby ruby1.8-dev rubygems bison autoconf zlib1g zlib1g-dev libreadline6 libreadline6-dev libssl0.9.8 libssl-dev | |
# Get ruby | |
wget ftp://ftp.ruby-lang.org//pub/ruby/1.9/ruby-1.9.3-p194.tar.gz | |
tar -zxvf ruby-1.9.3-p194.tar.gz |
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
# NOTE: The foodcritic args option (--lint-args) has not been tested | |
# | |
# Author:: Adam Jacob (<[email protected]>) | |
# Author:: Matthew Kent (<[email protected]>) | |
# Author:: Joshua Timberman (<[email protected]>) | |
# Copyright:: Copyright (c) 2009-2012 Opscode, Inc. | |
# Copyright:: Copyright (c) 2010 Matthew Kent | |
# License:: Apache License, Version 2.0 | |
# | |
# Licensed under the Apache License, Version 2.0 (the "License"); |
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
bash -c ' | |
<%= "export http_proxy=\"#{knife_config[:bootstrap_proxy]}\"" if knife_config[:bootstrap_proxy] -%> | |
export LANG=en_US.UTF-8 | |
apt-get update | |
if [ ! -f /usr/bin/chef-client ]; then | |
apt-get update | |
apt-get upgrade -y |
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
gem user system total real | |
----------------------------------------------------------- | |
cancan 1.283000 0.236000 1.519000 1.852234 | |
email_spec 0.767000 0.094000 0.861000 1.024380 | |
capistrano 0.663000 0.096000 0.759000 0.952636 | |
fb_graph 0.574000 0.094000 0.668000 0.714888 | |
omniauth-openid 0.554000 0.048000 0.602000 0.657076 | |
selenium-webdriver 0.258000 0.048000 0.306000 0.529047 | |
pry-nav 0.253000 0.038000 0.291000 0.367863 | |
resque-scheduler 0.290000 0.035000 0.325000 0.366776 |
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
# Knife Configuration File. | |
# | |
# This is a Ruby DSL to set configuration parameters for Knife's | |
# general options. The default location for this file is | |
# ~/.chef/knife.rb. If multiple Chef repositories are used, | |
# per-repository configuration files can be created. A per repository | |
# configuration file must be .chef/knife.rb in the base directory of | |
# the Chef repository. For example, | |
# | |
# ~/Development/chef-repo/.chef/knife.rb |
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 an example of a knife.rb configuration that uses yml and a | |
# simple env var (CHEF_ENV) to manage multiple hosted Chef environments. | |
# | |
# Example usage: | |
# export CHEF_ENV=evnironment_01 | |
# knife status | |
# | |
# Based on: http://blog.blankpad.net/2010/09/28/multiple-knife-environments---the-return/ | |
# |
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
#!/bin/bash -e | |
# | |
# Since unicorn creates a new pid on restart/reload, it needs a little extra love to | |
# manage with runit. Instead of managing unicorn directly, we simply trap signal calls | |
# to the service and redirect them to unicorn directly. | |
# | |
# To make this work properly with RVM, you should create a wrapper for the app's gemset unicorn. | |
# | |
function is_unicorn_alive { |