Skip to content

Instantly share code, notes, and snippets.

View jsjohnst's full-sized avatar

Jeremy Johnstone jsjohnst

View GitHub Profile
@jsjohnst
jsjohnst / aws_iam_policy.json
Last active August 26, 2015 19:00 — forked from kixorz/aws_iam_policy.json
Update Route53 DNS records from your EC2 instance using this simple Ruby script. You can call it from rc.local after setting your hostname locally. First parameter is the desired <hostname>.<domain> Domain and other parameters are hardcoded. This script is useful for handling internal DNS changes in your systems after instance changes. Attached …
{
"Statement": [
{
"Action": [
"route53:ChangeResourceRecordSets",
"route53:GetHostedZone",
"route53:ListResourceRecordSets"
],
"Effect": "Allow",
"Resource": [
@jsjohnst
jsjohnst / ec2hostname.rb
Last active August 26, 2015 19:00 — forked from kixorz/ec2hostname.rb
EC2 Instance Route53 Hostname registration init.d script. Instance needs to have the attached IAM instance role policy applied.
#!/usr/bin/ruby
# chkconfig: 35 99 01
# description: EC2 DNS registration
# processname: ec2hostname
require 'aws-sdk'
require 'net/http'
`touch /var/lock/subsys/ec2hostname`
@jsjohnst
jsjohnst / ec2hostname.rb
Last active August 26, 2015 18:59 — forked from kixorz/ec2hostname.rb
EC2 DNS load-balancing init.d script. Instances automatically register themselves in Route53 RecordSets and properly update their records when starting/shutting down. Instances need to use attached IAM role allowing them to modify the Route53 zone.
#!/usr/bin/ruby
# chkconfig: 35 99 01
# description: EC2 DNS loadbalancing
# processname: ec2hostname
require 'aws-sdk'
require 'net/http'
`touch /var/lock/subsys/ec2hostname`
--- Core JMX Metrics when running with Concurrent Mark and Sweep (CMS) GC
instances:
- host: "localhost"
port: 9999
init_config:
conf:
- domain: "java.lang"
bean: "java.lang:type=GarbageCollector,name=ParNew"
attribute:
CollectionTime:
function makeD3Post(post_url, avatar_url, note_count){
var D3Post = {
post: post_url,
avatar: avatar_url,
notes: note_count,
dimensions: {
'post': {
'width': 0,
'height': 0
},
com.sadun.airflick
RequestType := show-photo | play-media
MediaLocation := url or file path
Rotation = 0 | 1 | 2 | 3 (0 ^, 1 <, 2 v, 3 >)
e.g. Photo
NSDictionary *dict = [NSDictionary dictionaryWithObjectsAndKeys:
@"show-photo", @"RequestType",
@"/Users/ericasadun/Pictures/Spring 2010/EPho 3.JPG", @"MediaLocation",
@"1", @"Rotation",