Skip to content

Instantly share code, notes, and snippets.

View maraca's full-sized avatar

Martin Cozzi maraca

View GitHub Profile
@maraca
maraca / SSDEBSInstance.json
Created March 4, 2014 19:18
Writing 2GB of data on c3.xlarge instance root volume, SSD volume and Provisioned EBS volume.
{
"AWSTemplateFormatVersion" : "2010-09-09",
"Description" : "Creates an EC2 instance with 2x SSD 40GB and an provisioned IOPS EBS volume.",
"Parameters" : {
"KeyName" : {
"Description" : "Name of the production EC2 KeyPair to enable SSH to the instance",
"Type" : "String"
},
@maraca
maraca / gist:8966679
Last active August 29, 2015 13:56
CopperEgg Monitoring Station IPs
50.116.43.60
173.230.130.202
173.230.137.189
173.230.134.214
96.126.125.208
69.164.193.167
198.58.127.218
198.58.101.215
66.175.209.119
198.74.58.191
@maraca
maraca / sandbox.yml
Last active January 4, 2016 18:49
Sandwich example
region: us-east-1
hosted_zone: &hosted_zone cotap.com
key_name: &key_name sandbox_environment
cidr_block: &cidr_block "10.123"
azs: &azs "us-east-1a,us-east-1c,us-east-1d"
az1: &az1 "us-east-1a"
az2: &az2 "us-east-1c"
az3: &az3 "us-east-1d"
@maraca
maraca / Gemfile
Created January 20, 2014 04:03
Basic Kinesis clients that writes a 100 strings to a Kinesis shard.
source 'https://rubygems.org'
gem 'aws-sdk-core', '2.0.0.rc4'
@maraca
maraca / gist:8248866
Created January 3, 2014 23:35
What the AWS documentation does not tell you when creating an AliasTarget is that the Type has to be set to "A" and not to "CNAME".
"AppDNSRecord" : {
"Type" : "AWS::Route53::RecordSet",
"Properties" : {
"HostedZoneName" : { "Fn::Join" : [ "", [ {"Ref" : "HostedZone" }, "." ] ] },
"Name" : { "Fn::Join" : [ "", [ { "Ref" : "MonitoringCNAMERecord" }, "." ] ] },
"Type" : "A",
"AliasTarget" : {
"HostedZoneId" : { "Fn::GetAtt" : [ "MonitoringELB", "CanonicalHostedZoneNameID" ] },
"DNSName" : { "Fn::GetAtt" : [ "MonitoringELB", "DNSName" ] }
},
@maraca
maraca / gist:7012033
Created October 16, 2013 17:54
Find chef node that did not successfully register
knife search 'role:*' | grep 'Node Name' | awk '{print $3}' | sort > /tmp/search
knife node list | sort > /tmp/list
diff /tmp/search /tmp/list | colordiff
VAGRANT_LOG=debug vagrant up
INFO global: Vagrant version: 1.3.0
DEBUG global: Loading core plugin: /opt/vagrant/embedded/gems/gems/vagrant-1.3.0/plugins/communicators/ssh/plugin.rb
INFO manager: Registered plugin: ssh communicator
DEBUG global: Loading core plugin: /opt/vagrant/embedded/gems/gems/vagrant-1.3.0/plugins/kernel_v1/plugin.rb
INFO manager: Registered plugin: kernel
DEBUG global: Loading core plugin: /opt/vagrant/embedded/gems/gems/vagrant-1.3.0/plugins/commands/halt/plugin.rb
INFO manager: Registered plugin: halt command
DEBUG global: Loading core plugin: /opt/vagrant/embedded/gems/gems/vagrant-1.3.0/plugins/commands/box/plugin.rb
INFO manager: Registered plugin: box command
@maraca
maraca / package.sh
Last active December 25, 2015 11:29
Package Ruby 1.9.3-p448 with FPM
wget ftp://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p448.tar.gz
tar -xzvf ruby-1.9.3-p448.tar.gz
cd ruby-1.9.3-p448/
./configure --prefix=/usr && make && make install DESTDIR=/tmp/ruby-1.9.3
fpm -s dir -t deb -n ruby-1.9.3 -v 1.9.3-p448 \
--description "Self-packaged ruby 1.9.3" \
-C /tmp/ruby-1.9.3 -p ruby-VERSION_ARCH.deb \
-m 'martin@cotap.com' --vendor 'Cotap Inc.' \
--license 'Private' \
--url 'https://github.com/cotap' \
@maraca
maraca / output
Last active December 20, 2015 04:59
ChefSpec cannot load such file -- rvm
LoadError
---------
cannot load such file -- rvm
Cookbook Trace:
---------------
/home/martin/application-cookbook/vendor/cookbooks/rvm/recipes/default.rb:25:in `require'
/home/martin/application-cookbook/vendor/cookbooks/rvm/recipes/default.rb:25:in `from_file'
/home/martin/application-cookbook/vendor/cookbooks/rvm/recipes/system_install.rb:20:in `from_file'
/home/martin/application-cookbook/vendor/cookbooks/rvm/recipes/system.rb:20:in `from_file'
@maraca
maraca / shell
Last active December 20, 2015 03:39
Hookup Travis-CI build results to HipChat
$ travis encrypt "your_api_key@your_chat_room_name"
Please add the following to your .travis.yml file:
secure: "CG2F0b+/IkSn0RmFE0N9GjTeKw+FSqEMTpUdYTztH+TThKnE/RvlxLJO4Lg9zIWVYT2ma0EgU5jWdMMPj48/T+rWf/rUt2TXpAPiyJJx/y2ywylOiX/EAs="
Pro Tip: You can add it automatically by running with --add.