Skip to content

Instantly share code, notes, and snippets.

@corck
corck / AWS - EBS Snapshot Management
Created November 28, 2010 10:41
Simple script for creating snapshots of an EBS volume and keeping a certain number of those
#!/usr/local/bin/ruby
require 'AWS'
require 'yaml'
class SnapshotManagement
# initalize class, optional override path to yml file
# * options [String] :path ('')
#
def initialize(params = {})
@apsoto
apsoto / chef-ec2.rake
Created September 5, 2011 05:20
Chef EC2 Node Cleanup task
namespace :ec2 do
# setup chef config
#
config = File.join(File.dirname(__FILE__), '..', '.chef', 'knife.rb')
Chef::Config.from_file(config)
load_gem_or_report(%w{aws})
desc 'Delete any ec2-based chef nodes that no longer exist'
task :cleanup_nodes do
@ncoblentz
ncoblentz / OWASP Broken WebApps RSpec.rb
Created November 22, 2011 21:15
OWASP Broken Web Applications Application Vulnerability Unit Testing Watir-WebDriver Test
# encoding: utf-8
#http://code.google.com/p/owaspbwa/wiki/ProjectSummary
#http://sourceforge.net/apps/trac/owaspbwa/report/1
require 'rspec'
require 'watir-webdriver'
$BROKEN_WEB_APPS_HOST='http://owaspbwa'
@darrinholst
darrinholst / amazon-linux.erb
Created January 6, 2012 16:02
chef bootstraper for amazon-linux
bash -c '
#
# make sure sudo users have the full path...
#
# sudo visudo
# Defaults env_keep += "PATH"
# Defaults !secure_path
#
@matthutchinson
matthutchinson / launch_instance.rb
Created January 23, 2012 15:10
Launching EC2 instance with aws-sdk gem
#!/usr/bin/ruby
# README
# gem install aws-sdk
# add this to bashrc
# export HT_DEV_AWS_ACCESS_KEY_ID=????
# export HT_DEV_AWS_SECRET_ACCESS_KEY=????
# put your pem file in ~/.ssh and chmod 0400
# for more info see; https://rubygems.org/gems/aws-sdk
@jtimberman
jtimberman / rename-node.rb
Created March 2, 2012 07:47 — forked from mpasternacki/rename-node.rb
A knife exec script to change Chef node's name.
#!./bin/knife exec
# A knife exec script to change chef node's name, preserving all the attributes.
#
# Usage: knife exec rename-node.rb old-name new-name
#
# Script retrieves the Node object, changes its 'name' attribute,
# creates new Node object with updated name and rest of attributes
# untouched. Then it deletes old Node and Client objects from
# database, and logs into the server to update it:
@douglasjarquin
douglasjarquin / amazon-linux.erb
Last active February 29, 2016 01:42 — forked from darrinholst/amazon-linux.erb
Chef bootstrap template for Amazon Linux
bash -c '
#
# make sure sudo users have the full path...
#
# sudo visudo
# Defaults env_keep += "PATH"
# Defaults !secure_path
#
@leeky
leeky / chef_solo_bootstrap.sh
Created May 23, 2012 13:54 — forked from ryanb/chef_solo_bootstrap.sh
Bootstrap Chef Solo - Ubuntu 12.04 LTS
#!/usr/bin/env bash
apt-get -y update
apt-get -y install build-essential zlib1g-dev libssl-dev libreadline6-dev libyaml-dev
cd /tmp
wget ftp://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p194.tar.gz
tar -xvzf ruby-1.9.3-p194.tar.gz
cd ruby-1.9.3-p194/
./configure --prefix=/usr/local
make
make install
@andreyvit
andreyvit / tmux.md
Created June 13, 2012 03:41
tmux cheatsheet

tmux cheat sheet

(C-x means ctrl+x, M-x means alt+x)

Prefix key

The default prefix is C-b. If you (or your muscle memory) prefer C-a, you need to add this to ~/.tmux.conf:

remap prefix to Control + a

#!/bin/bash
#
# Usage: ./make-lsLR.sh
#
# Purpose:
# to make a file that is parseable for recovering
# a filled /lost+found directory by parsing
# filesize, md5sum, permisions and path+filename
#
# Author: Ingo Juergensman - http://blog.windfluechter.net