Skip to content

Instantly share code, notes, and snippets.

View X0nic's full-sized avatar

Nathan Lee X0nic

View GitHub Profile
@hedgehog
hedgehog / gist:386057
Created May 1, 2010 04:43
EC2 AMI with chef-server installed
# install_chef_server.sh
#
# From list post by John Merrells <john@merrells.com>
# Modified by Mike Bailey <mike@bailey.net.au>
logfile="/root/log.txt"
echo "-----" >> $logfile
# New sources.list
cat > /etc/apt/sources.list << EOF
@assimovt
assimovt / chef.rb
Created May 13, 2010 16:36
Chef cookbook
# cookbooks/chef/attributes/chef.rb
set_unless[:chef][:log_location] = "STDOUT"
set_unless[:chef][:log_level] = "info"
set_unless[:chef][:url_type] = "http"
set_unless[:chef][:server_fqdn] = "your-chef-server"
set_unless[:chef][:server_port] = "4000"
set_unless[:chef][:validation_client_name] = "chef-validator"
set_unless[:chef][:cache_path] = "/var/cache/chef"
@zhengjia
zhengjia / capybara cheat sheet
Created June 7, 2010 01:35
capybara cheat sheet
=Navigating=
visit('/projects')
visit(post_comments_path(post))
=Clicking links and buttons=
click_link('id-of-link')
click_link('Link Text')
click_button('Save')
click('Link Text') # Click either a link or a button
click('Button Value')
@peplin
peplin / recipe.rb
Created July 10, 2010 01:30
S3 File Resource for Chef
# Source accepts the protocol s3:// with the host as the bucket
# access_key_id and secret_access_key are just that
s3_file "/var/bulk/the_file.tar.gz" do
source "s3://your.bucket/the_file.tar.gz"
access_key_id your_key
secret_access_key your_secret
owner "root"
group "root"
mode 0644
end
@fnichol
fnichol / README.md
Created March 30, 2011 21:17
Chef Bootstrapper For SuSE/SLES

Chef Bootstrapper For SuSE/SLES

Installation

Note: Run this script as the root user (no sudo calls are used in the script).

You will need the curl package installed, though I would have no idea why it wouldn't be installed by default:

zypper --non-interactive install curl

@hh
hh / chef-server-ubuntu-natty-userdata.sh
Created July 7, 2011 07:33
Chef Server setup for Ubuntu 11.04/natty on Amazon ec2
#!/bin/bash
#ec2-run-instances --user-data-file chefserver-ec2-userdata.sh -g chef-server --key mykey -t m1.large --instance-initiated-shutdown-behavior terminate ami-1aad5273 | grep INSTANCE | INSTANCE=`cut -f 2` | xargs -I XXX ec2-create-tags XXX --tag Name=chefserver ; sleep 60 ; ec2-describe-instances $INSTANCE | grep INSTANCE | grep running | echo ssh ubuntu@`cut -f 4`
# ami-1aad5273 - ubuntu 11.04 64bit server ebs
# ami-2cc83145 - alestic ubunt 10.04 LTS 32bit server ebs
# ami-2ec83147 - alestic ubunt 10.04 LTS 64bit server ebs
# ami-8e1fece7 - amazon 64 bit ebs
exec > >(tee /var/log/user-data.log|logger -t user-data -s 2>/dev/console) 2>&1
set -e -x
# START CHEF BOOSTRAP
@justinwiley
justinwiley / cucumber-capybara-capistrano.feature
Created August 31, 2011 18:48
Integrating Cucumber Capybara Smoketest with Capistrano
@test_deploy @javascript # @test_deploy tag setup in cucumber.yml profile, @javascript runs in capybara-webkit
Feature: Smoke Test
In order to test that the application is deployed
As a caring developer
I want to check a few features of the site
Background:
Given we are in the deploy environment
Scenario: Logging in and checking basic navigation
@andyfowler
andyfowler / .vimrc
Created September 5, 2011 18:08
Swap iTerm2 cursors in vim insert mode when using tmux
" tmux will only forward escape sequences to the terminal if surrounded by a DCS sequence
" http://sourceforge.net/mailarchive/forum.php?thread_name=AANLkTinkbdoZ8eNR1X2UobLTeww1jFrvfJxTMfKSq-L%2B%40mail.gmail.com&forum_name=tmux-users
if exists('$TMUX')
let &t_SI = "\<Esc>Ptmux;\<Esc>\<Esc>]50;CursorShape=1\x7\<Esc>\\"
let &t_EI = "\<Esc>Ptmux;\<Esc>\<Esc>]50;CursorShape=0\x7\<Esc>\\"
else
let &t_SI = "\<Esc>]50;CursorShape=1\x7"
let &t_EI = "\<Esc>]50;CursorShape=0\x7"
endif
@simme
simme / Install_tmux
Created October 19, 2011 07:55
Install and configure tmux on Mac OS X
# First install tmux
brew install tmux
# For mouse support (for switching panes and windows)
# Only needed if you are using Terminal.app (iTerm has mouse support)
Install http://www.culater.net/software/SIMBL/SIMBL.php
Then install https://bitheap.org/mouseterm/
# More on mouse support http://floriancrouzat.net/2010/07/run-tmux-with-mouse-support-in-mac-os-x-terminal-app/
@bkimble
bkimble / gist:1365005
Last active May 2, 2024 01:27
List local memcached keys using Ruby
#!/usr/bin/env ruby
# List all keys stored in memcache.
# Credit to Graham King at http://www.darkcoding.net/software/memcached-list-all-keys/ for the original article on how to get the data from memcache in the first place.
require 'net/telnet'
headings = %w(id expires bytes cache_key)
rows = []