Skip to content

Instantly share code, notes, and snippets.

View maraca's full-sized avatar

Martin Cozzi maraca

View GitHub Profile
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 / 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
@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 / 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 / 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 / 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 / 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 / x509
Last active August 29, 2015 13:57
#!/bin/bash
KEY_NAME=$1
PEM_NAME="${KEY_NAME}-key.pem"
PEM_NAME_PCKS8="${KEY_NAME}-pem-PCKS8-format.pem"
CERTIFICATE_NAME="${KEY_NAME}-certificate.pem"
openssl genrsa 2048 > $PEM_NAME
openssl pkcs8 -topk8 -nocrypt -inform PEM -in $PEM_NAME -out $PEM_NAME_PCKS8
openssl req -new -x509 -nodes -sha1 -days 365 -key $PEM_NAME -outform PEM > $CERTIFICATE_NAME
site :opscode
cookbook 'apt'
cookbook 'nginx'
metadata
@maraca
maraca / packer.json
Last active August 29, 2015 13:57
packer-hello-world
{
"variables": {
"account_id": "",
"aws_access_key_id": "",
"aws_secret_key": "",
"s3_bucket": "",
"x509_cert_path": "",
"x509_key_path": ""
},