Skip to content

Instantly share code, notes, and snippets.

@shaon
shaon / euca_9005.py
Created May 21, 2014 15:16
euca-9005 test
#!/usr/bin/env python
from __future__ import division
import time
import os
import hashlib
import tempfile
from math import ceil
from cStringIO import StringIO
from concurrent.futures import ThreadPoolExecutor
@shaon
shaon / BucketTaggingTest.java
Created August 29, 2014 02:44
Basic SET/GET/DELETE operations for Bucket Tagging
import com.amazonaws.auth.BasicAWSCredentials;
import com.amazonaws.services.s3.AmazonS3;
import com.amazonaws.services.s3.AmazonS3Client;
import com.amazonaws.services.s3.model.Bucket;
import com.amazonaws.services.s3.model.BucketTaggingConfiguration;
import com.amazonaws.services.s3.model.TagSet;
import java.util.ArrayList;
import java.util.List;
;; filepath: /var/named/fwd.euca.example.net
$ORIGIN .
$TTL 86400 ; 1 day
euca.example.net IN SOA aoe-08-5.euca.example.net. root.euca.example.net. (
2011071306 ; serial
3600 ; refresh (1 hour)
1800 ; retry (30 minutes)
604800 ; expire (1 week)
86400 ; minimum (1 day)
#!/bin/bash
echo "zone euca.example.net" > /tmp/dnsupdate
echo "server 10.17.198.5" >> /tmp/dnsupdate
echo "update delete `hostname`" >> /tmp/dnsupdate
echo "update add `hostname` 86400 A `hostname -I`" >> /tmp/dnsupdate
echo "debug yes" >> /tmp/dnsupdate
echo "send" >> /tmp/dnsupdate
/usr/bin/nsupdate -v /tmp/dnsupdate
@shaon
shaon / reinvent-2017-youtube.md
Created December 7, 2017 16:26 — forked from stevenringo/reinvent-2017-youtube.md
Links to YouTube recordings of AWS re:Invent 2017 sessions

| Title | Description

#!/bin/bash
# This is an updated version of the aws-install-ssm-agent
# script that supports SUSE.
function die() {
echo "$@, exiting." >&2
exit 1
}
#!/bin/bash
function get_contents() {
if [ -x "$(which curl)" ]; then
curl -s -f "$1"
elif [ -x "$(which wget)" ]; then
wget "$1" -O -
else
die "No download utility (curl, wget)"
fi
#!/bin/bash
# This is an updated version of the aws-update-linux-instance
# script that supports SUSE.
PRE_UPDATE_SCRIPT_URL=''
POST_UPDATE_SCRIPT_URL=''
INCLUDE_PACKAGES=''
EXCLUDE_PACKAGES=''
{
"schemaVersion":"0.3",
"description":"Updates AMI with Linux distribution packages and Amazon software. For details,see https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/sysman-ami-walkthrough.html",
"assumeRole":"{{AutomationAssumeRole}}",
"parameters":{
"SourceAmiId":{
"type":"String",
"description":"(Required) The source Amazon Machine Image ID."
},
"InstanceIamRole":{
#!/bin/bash
# This is an updated version of the aws-install-ssm-agent
# script that supports SUSE.
function die() {
echo "$@, exiting." >&2
exit 1
}