Skip to content

Instantly share code, notes, and snippets.

View mndoci's full-sized avatar

Deepak Singh mndoci

View GitHub Profile
@lusis
lusis / quick and dirty ec2.rb
Created November 15, 2010 18:27
quick and dirty ec2 auditing
require 'net/ssh/multi'
require 'fog'
require 'yaml'
require 'optparse'
options = {}
optparse = OptionParser.new do |opts|
opts.banner = "Usage: audit.rb [options]"
@geemus
geemus / Gemfile
Created November 22, 2010 22:45
fog - resume uploading example
source "http://rubygems.org"
gem 'fog'
@metaxis
metaxis / gist:729867
Created December 6, 2010 04:32 — forked from botchagalupe/gist:721028
student knife workstation setup

Setup a Student Chef Client on Ubuntu

ssh ubuntu@<IP Supplied by the Instructor>  (password opstrain_0150)

mkdir -p ~/chef-repo/.chef

From your Client box copy your Key and config files

scp *.pem ubuntu@ec2-?????.com:~

scp .pem ubuntu@ec2-?????.com:~

@geemus
geemus / 0_rackspace.rb
Created December 6, 2010 07:46
fog or: How I Learned to Stop Worrying and Love the Cloud (examples)
server_data = compute.create_server(
1,
49
).body['server']
until compute.get_server_details(
server_data['id']
).body['server']['status'] == 'ACTIVE'
end
@jlindsey
jlindsey / launch_instances
Created December 15, 2010 21:26
Launch AWS instances
#!/usr/bin/env ruby
# Require gems with versions
begin
require 'logger'
require 'rubygems'
gem 'fog', '~> 0.6.0'
gem 'trollop', '~> 1.16.2'
require 'fog'; require 'trollop'
@jtimberman
jtimberman / ec2_server_create_only.rb
Created January 11, 2011 14:22
this knife exec script example only creates a new instance. not wildly useful, but used as an example of the possibilities.
require 'fog'
require 'chef/knife/ec2_server_create'
connection = Fog::AWS::Compute.new(
:aws_access_key_id => Chef::Config[:knife][:aws_access_key_id],
:aws_secret_access_key => Chef::Config[:knife][:aws_secret_access_key],
:region => Chef::Config[:knife][:region]
)
server = connection.servers.create(
@mpasternacki
mpasternacki / update_dns.rake
Created February 1, 2011 13:36
Rake task to update Amazon Route53 DNS from by Chef node search
# -*- ruby -*-
# Needs following parameters configured in rake.rb:
# DNS_DOMAIN: domain for which to set entries, including trailing dot
# (e.g. "example.com.")
# DNS_ATTRIBUTE: attribute containing hostname to CNAME to, defaults
# to 'fqdn'; for EC2, use "ec2.public_hostname"
# DNS_ENTRIES: hash mapping hostname to node search query,
# e.g. {'buildbot' => 'recipes:buildbot', 'monitoring' =>
# 'roles:monitoring'}
@chris-gilmore
chris-gilmore / setup-chef-repo.sh
Created March 27, 2011 09:09
Setup Chef Repo
# references
# http://wiki.opscode.com/display/chef/Chef+Repository
# http://blog.ibd.com/howto/deploy-wordpress-to-amazon-ec2-micro-instance-with-opscode-chef/
# on laptop
$ sudo gem install chef
$ sudo gem install net-ssh net-ssh-multi highline fog
$ mkdir ~/git
$ cd ~/git
@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/