Skip to content

Instantly share code, notes, and snippets.

View neilmillard's full-sized avatar

Neil Millard neilmillard

View GitHub Profile
Content-Type: multipart/mixed; boundary="===============0035287898381899620=="
MIME-Version: 1.0
--===============0035287898381899620==
Content-Type: text/cloud-config; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment; filename="cloud-config.txt"
#cloud-config
@neilmillard
neilmillard / update-route53-dns.sh
Last active January 6, 2016 17:16 — forked from dfox/update-route53-dns.sh
A script to update DNS on Route 53
#!/bin/sh
# Make sure only root can run our script
if [ "$(id -u)" != "0" ]; then
echo "This script must be run as root" 1>&2
exit 1
fi
# Defaults
TTL=60
@neilmillard
neilmillard / aws-dns-route53-dig.md
Created January 6, 2016 17:05 — forked from diegopacheco/aws-dns-route53-dig.md
AWS Route53 Fun with DNS: dig & cli53

How to Install on CentOs?

sudo yum install -y bind-utils
pip install cli53

Figureout the box name?

#!/bin/bash
# Find the name from the user data passed in on instance creation
USER=$(curl -s "http://169.254.169.254/latest/user-data")
IFS=':' read -ra UDATA <<< "$USER"
# Find the instance ID from the meta data api
ID=$(curl -s "http://169.254.169.254/latest/meta-data/instance-id")
CERTNAME=${UDATA[1]}.$ID.aws
@neilmillard
neilmillard / user-data.sh
Created October 19, 2015 10:48 — forked from codeinthehole/user-data.sh
Get the value of an EC2 instance's tag
#!/usr/bin/env bash
#
# Get the value of a tag for a running EC2 instance.
#
# This can be useful within bootstrapping scripts ("user-data").
#
# Note the EC3 instance needs to have an IAM role that lets it read tags. The policy
# JSON for this looks like:
#
# {
@neilmillard
neilmillard / ruby_centos6.sh
Last active August 29, 2015 14:27 — forked from doole/ruby_centos6.sh
Ruby/Rails setup on CentOS 6.x with Vagrant
#!/bin/bash
# Vagrant CentOS6 boxes
# CentOS 6.4 x64 https://github.com/2creatives/vagrant-centos/releases/download/v6.4.2/centos64-x86_64-20140116.box
# CentOS 6.5 x64 https://github.com/2creatives/vagrant-centos/releases/download/v6.5.3/centos65-x86_64-20140116.box
# Update
sudo yum -y update
# Add Development tools
@neilmillard
neilmillard / html.html
Created May 5, 2015 15:12
disable right click -
<script LANGUAGE = "JavaScript"> var isNS = (navigator.appName == "Netscape") ? 1 : 0;var EnableRightClick = 0;if(isNS) document.captureEvents(Event.MOUSEDOWN||Event.MOUSEUP);function mischandler(){if(EnableRightClick==1){ return true;}else {return false; }}function mousehandler(e){ if(EnableRightClick==1){ return true; } var myevent = (isNS) ? e : event; var eventbutton = (isNS) ? myevent.which : myevent.button; if((eventbutton==2)||(eventbutton==3)) return false;}function keyhandler(e) {var myevent = (isNS) ? e : window.event;if (myevent.keyCode==96)EnableRightClick = 1;return;}document.oncontextmenu = mischandler;document.onkeypress = keyhandler;document.onmousedown = mousehandlerdocument.onmouseup = mousehandler;</script>
@neilmillard
neilmillard / aws-data.sh
Created April 28, 2015 17:41
docker container datafile
#!/bin/bash
yum install -y aws-cli
aws s3 cp s3://your_bucket_name/ecs.config /etc/ecs/ecs.config
@neilmillard
neilmillard / aliases
Last active August 29, 2015 14:18
postfix smtp alias->forward
#
# Mail aliases for sendmail
#
# You must run newaliases(1) after making changes to this file.
#
# Required aliases
postmaster: root
MAILER-DAEMON: postmaster
# Common aliases
@neilmillard
neilmillard / aws-user-data-file.sh
Last active August 29, 2015 14:17
headless puppet
#!/bin/sh
AWS_ACCESS_KEY="abcdefghijlmnopqrstu"
AWS_SECRET_KEY="abcdefghijlmnopqrstuabcdefghijlmnopqrstu"
BUCKET_PUPPET="puppet"
#export AWS_ACCESS_KEY_ID=$AWS_ACCESS_KEY
#export AWS_SECRET_ACCESS_KEY=$AWS_SECRET_KEY
#export AWS_DEFAULT_REGION=eu-west-1
# update packages