Skip to content

Instantly share code, notes, and snippets.

@Jinkxed
Jinkxed / S99deploycode
Last active January 31, 2018 16:48
check-codedeploy.sh
#!/bin/bash
#
# check-codedeploy check-codedeploy shipper
#
# chkconfig: 2345 98 02
# description: Starts and stops a single check-codedeploy instance on this system
#
### BEGIN INIT INFO
# Provides: check-codedeploy
#!/bin/bash
. /etc/bashrc
# EC2 Metadata
export REGION=$(curl -s http://169.254.169.254/latest/dynamic/instance-identity/document/ | jq .region -r)
export INSTANCEID=$(curl -s http://169.254.169.254/latest/meta-data/instance-id)
# Get all tags in one call
ec2-describe-tags --filter "resource-type=instance" --filter "resource-id=$(ec2-metadata -i | cut -d ' ' -f2)" | cut -f 4,5 > /tmp/ec2_tags
#!/bin/bash
############################################################
# run: cloudwatch_push -e staging -q rabbit_queue_name
############################################################
while getopts e:q:c:h: option
do
case "${option}"
in
e) environment=${OPTARG};;
# Not sure how to switch .region to us-west-1 / us-west-2
resource "aws_subnet" "Shared_Services-2A_Public" {
vpc_id = "${aws_vpc.default.id}"
cidr_block = "${var.aws_region_defaults.region.cidr_prefix}.0.0/23"
map_public_ip_on_launch = true
}
@Jinkxed
Jinkxed / region.tf
Last active January 13, 2016 20:10
variable "aws_region" {
description = "Where would you like to deploy to? Valid regions are: us-west-1, us-west-2, us-east-1"
}
variable "aws_region_defaults" {
default = {
us-west-1 = {
region_name = "California"
region_prefix = "CA"
ami_id = "ami-d5ea86b5"
@Jinkxed
Jinkxed / gist:8fca8b6126f1400b9c93
Last active August 29, 2015 14:02
Node-Mono-Edge on Amazon Linux (Redhat/CentOS) Bootstrap
#!/bin/bash
export PATH=$PATH:/usr/local/bin
THE_USER=`whoami`
set -e
sudo -u ${THE_USER} mkdir tmp
# install prerequisities