This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# Updates security groups with IP addresses within the AWS account | |
# https://github.com/grrywlsn/autoawsgroups | |
# MetaBroadcast.com | |
IFS=" | |
" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
input { | |
redis { | |
host => '127.0.0.1' | |
port => '6379' | |
data_type => 'list' | |
key => 'logstash' | |
} | |
} | |
filter { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
server { | |
listen *:80 default_server; | |
server_name _; | |
resolver 127.0.0.1; | |
resolver_timeout 10s; | |
access_log /var/log/nginx/atlas-access.log; | |
error_log /var/log/nginx/atlas-error.log; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/bash | |
USERDATA=`ec2metadata --user-data` | |
AVAILABILITY_ZONE=`ec2metadata --availability-zone` | |
INSTANCE_ID=`ec2metadata --instance-id` | |
SPLIT_CHAR="|" | |
attach_volume() { # $1=instance Id, $2=device path, $3=volume Id | |
echo "Attaching volume $3 to instance $1 on path $2" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require 'rubygems' | |
require 'json' | |
require 'set' | |
require 'pp' | |
require 'resolv' | |
$replicaSet = "<%= instance_tag %>" # puppet will fill this in with the correct replicaset tag for this cluster |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# Wide-open CORS config for nginx | |
# | |
location / { | |
if ($request_method = 'OPTIONS') { | |
add_header 'Access-Control-Allow-Origin' '*'; | |
# | |
# Om nom nom cookies | |
# | |
add_header 'Access-Control-Allow-Credentials' 'true'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
location ~* ^/(.*) { | |
set $s3_bucket = "<bucket-name>.s3-website-eu-west-1.amazonaws.com"; | |
proxy_http_version 1.1; | |
proxy_buffering off; | |
proxy_ignore_headers "Set-Cookie"; | |
proxy_hide_header x-amz-id-2; | |
proxy_hide_header x-amz-request-id; | |
proxy_hide_header x-amz-meta-s3cmd-attrs; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Set this script as the AWS user-data for a fresh CentOS AMI | |
# It will be run on startup, and logs to /var/log/cloud-init.log | |
rpm -iUvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm | |
yum -y update | |
yum -y install epel-release | |
yum -y install ansible | |
yum -y install git | |
mkdir -p /home/centos/.ssh | |
cat <<EOF > /home/centos/.ssh/id_rsa |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
- hosts: localhost | |
tasks: | |
- name: get ec2 facts | |
action: ec2_facts | |
- name: list tags on an instance | |
ec2_tag: | |
region: "{{ ansible_ec2_placement_region }}" | |
resource: "{{ ansible_ec2_instance_id }}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
coreos: | |
flannel: | |
interface: $private_ipv4 | |
etcd_endpoints: http://127.0.0.1:2379 | |
etcd2: | |
advertise-client-urls: http://$private_ipv4:2379 | |
initial-advertise-peer-urls: http://$private_ipv4:2380 | |
listen-client-urls: http://0.0.0.0:2379 | |
listen-peer-urls: http://$private_ipv4:2380 | |
units: |
OlderNewer