Skip to content

Instantly share code, notes, and snippets.

View chhibber's full-sized avatar

Sono Chhibber chhibber

View GitHub Profile
@chhibber
chhibber / gist:5878628
Created June 27, 2013 17:43
rbenv_install.sh
#!/bin/bash
set -e
set -x
CURRENT=`pwd`
RBENV_VERSION=1.9.3-p429
#[ -z "$1" ] && { echo "No version set - check pillar data"; exit 1 }
@chhibber
chhibber / gist:5968213
Last active December 19, 2015 14:19
Saltstack - Newrelic System Daemon Setup
Newrelic - install repo:
cmd.run:
- name: rpm -Uvh http://download.newrelic.com/pub/newrelic/el5/i386/newrelic-repo-5-3.noarch.rpm
- unless: rpm -qa | grep newrelic-repo
newrelic-sysmond:
pkg:
- installed
- require:
- cmd: Newrelic - install repo
@chhibber
chhibber / gist:6908927
Last active June 23, 2022 20:02
LaunchConfig with Cloudformation::Init
"LaunchConfig" : {
"Type" : "AWS::AutoScaling::LaunchConfiguration",
"Metadata" : {
"AWS::CloudFormation::Init" : {
"config" : {
"files" : {
"/tmp/boot-strap-nat00.sh" : {
"source" : { "Fn::Join" : ["", [
"http://", { "Ref" : "AWS::Region" }, "-development-appname", ".s3.amazonaws.com/path/to/boot-strap-nat00.sh"
]]}
{
"AWSTemplateFormatVersion" : "2010-09-09",
"Description" : "US East Development Staging :: ELBs, RDS, DNS, WWWs, and Workers :: AZ-1B and AZ-1C",
"Parameters" : {
"AGInstanceType" : {
"Type" : "String",
"Description" : "Instance Type for autoscaling group",
@chhibber
chhibber / gist:8413983
Created January 14, 2014 06:27
Cloudformation - VPC
{
"AWSTemplateFormatVersion" : "2010-09-09",
"Description" : "US West 2 (Oregon) Development VPC :: SG, Routing, EIPs :: Avalability Zones: 2A,2B,2C",
"Parameters" : {
},
"Mappings" : {
@chhibber
chhibber / gist:8414044
Created January 14, 2014 06:32
AWS - Bootstrap Examples
#!/bin/bash -
#===============================================================================
# vim: softtabstop=4 shiftwidth=4 expandtab fenc=utf-8 spell spelllang=en
#===============================================================================
set -x
set -e
SALT_BOOTSTRAP_SCRIPT="salt-bootstrap.sh"
SALT_BOOTSTRAP_DOWNLOAD="http://bootstrap.saltstack.org"
exec 2>&1 > /tmp/awsbootstrap.log
@chhibber
chhibber / gist:8414078
Created January 14, 2014 06:35
AWS - NAT Bootstrap Example
#!/bin/bash -
#===============================================================================
# vim: softtabstop=4 shiftwidth=4 expandtab fenc=utf-8 spell spelllang=en
#===============================================================================
set -x
SALT_BOOTSTRAP_SCRIPT="salt-bootstrap.sh"
SALT_BOOTSTRAP_DOWNLOAD="http://bootstrap.saltstack.org"
exec 2>&1 > /tmp/awsbootstrap.log
@chhibber
chhibber / gist:8414119
Created January 14, 2014 06:39
AWS Bootstrapping Cloudformation
#!/usr/bin/python
# __author__ = 'sono'
import boto
import boto.cloudformation
import boto.rds
import json
import yaml
import os
@chhibber
chhibber / gist:8414154
Created January 14, 2014 06:43
AWS Example - NAT Monitor Puled together code from a few different locations to make this
#!/usr/bin/env python
# vim:set sr et ts=4 sw=4 ft=python fenc=utf-8: // See Vim, :help 'modeline'
"""
"""
import sys
import os
import traceback
@chhibber
chhibber / gist:8414192
Created January 14, 2014 06:49
Salt: Unicorn state file and init script
File: init.sls
------------------------------------------
/etc/init.d/unicorn:
file.managed:
- order: 1
- mode: 774
- template: jinja
- ENV: {{ grains['environment'] }}
- source: salt://unicorn/unicorn_init