Skip to content

Instantly share code, notes, and snippets.

View kevinkarwaski's full-sized avatar

Kevin Karwaski kevinkarwaski

View GitHub Profile
@kevinkarwaski
kevinkarwaski / boto_conf_example
Created June 4, 2011 00:38
BotoConfig Example
# ---------------------------------------------
#
# Example boto config file.
# Per user = ~/.boto
# Global = /etc/boto.cfg
#
# See also:
# http://code.google.com/p/boto/wiki/BotoConfig
# http://boto.cloudhackers.com
# ---------------------------------------------
@kevinkarwaski
kevinkarwaski / fabfile.py
Created July 7, 2011 19:47 — forked from onyxfish/fabfile.py
Chicago Tribune News Applications fabric deployment script
from fabric.api import *
"""
Base configuration
"""
env.project_name = '$(project)'
env.database_password = '$(db_password)'
env.site_media_prefix = "site_media"
env.admin_media_prefix = "admin_media"
env.newsapps_media_prefix = "na_media"
======================================================
Setting up Django using Apache/mod_wsgi on Ubuntu 8.10
======================================================
This article will cover setting up Django using Apache/mod_wsgi on Ubuntu
8.10. The article is targeted at a production environment, but keep in mind
this is a more generalized environment. You may have different requirements,
but this article should at least provide the stepping stones.
The article will use distribution packages where nesscary. As of 8.10 the
@kevinkarwaski
kevinkarwaski / multistage_cap_example
Created December 6, 2011 06:07
Multi-stage Capistrano Example
#
# Multi-stage Capistrano Example
#
# Example calls: cap dev deploy, cap prod deploy
# Env specific data defined in deploy/dev, deploy/prod
#
# Required gems: capistrano, capistrano-ext, rubygems, cloudfiles
#
require 'capistrano/ext/multistage'
@kevinkarwaski
kevinkarwaski / Gemfile.cap
Created December 16, 2011 22:26
Gems needed for cap based deployments with chef integration.
source "http://rubygems.org"
gem 'chef', '0.10.4'
gem 'capistrano', '2.9.0'
gem 'capistrano-ext', '1.2.1'
gem 'capistrano-chef'
@kevinkarwaski
kevinkarwaski / multi_env_knife_config
Created February 18, 2012 19:06
Knife config for Multiple Chef Environments
#
# 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/
#
@kevinkarwaski
kevinkarwaski / nomethoderror_chef
Created March 22, 2012 16:37
NoMethodError gem_package chef resource on bootstrap
This only seems to happen if I attempt to override the passenger version in a role or environment while bootstrapping. If I add the overrides after the bootstrap completes successfully, the block gets executed successfully.
Block in recipe:
gem_package "passenger" do
version node[:nginx][:passenger_version]
notifies :run, resources(:bash => "compile_nginx_source")
end
@kevinkarwaski
kevinkarwaski / soloistrc
Created July 2, 2012 00:13
Soloistrc configuration file.
cookbook_paths:
- ./cookbooks/
recipes:
- pivotal_workstation::create_var_chef_cache
- pivotal_workstation::java
- pivotal_workstation::git_config_global_defaults
- pivotal_workstation::gem_no_rdoc_no_ri
- pivotal_workstation::bash_profile-better_history
- pivotal_workstation::bash_profile-aliases
- pivotal_workstation::bash_profile-ps1
@kevinkarwaski
kevinkarwaski / scout_cleanup.rb
Created July 9, 2012 16:32
Scout Management Script
#!/usr/bin/env ruby
require 'scout_api'
#*************************************
# Playing around with the Scout API...
#*************************************
#Create the connection object.
scout = Scout::Account.new(ENV['SCOUT_ACCOUNT'], ENV['SCOUT_USER'], ENV['SCOUT_PASSWORD'])
#!/usr/bin/env bash
# Oneliner to remove all gems.
# See: http://stackoverflow.com/questions/15100496/uninstalling-all-gems-ruby-2-0-0
for i in `gem list --no-versions`; do gem uninstall -aIx $i; done