Skip to content

Instantly share code, notes, and snippets.

@cognusion
cognusion / genS3url.go
Last active Aug 29, 2015
Simple Go function to generate a valid S3 Signed URL
View genS3url.go
package generateSignedS3URL
import (
"fmt"
"crypto/hmac"
"crypto/sha1"
"encoding/base64"
"net/url"
"time"
)
@cognusion
cognusion / azaudit.rb
Created Mar 24, 2015
Simple script to audit AWS EC2 Availability Zone usage, to spot imbalances
View azaudit.rb
#!/usr/bin/env ruby
# Audits the AZs your instances are running in, and reports back.
# If you want to run this from an AWS instance without keys,
# its IAM Role must be granted at least the following:
#
#{
# "Statement": [
# {
# "Action": [
@cognusion
cognusion / monaudit.rb
Created Aug 28, 2014
Simple script to audit AWS EC2 instances vs a Livestatus-enabled nagios system
View monaudit.rb
#!/usr/bin/env ruby
# Audits your monitored instances vs your running instances, and reports back.
# If you want to run this from an AWS instance, its IAM Role must be granted at least the following:
#
#{
# "Statement": [
# {
# "Action": [
# "ec2:DescribeInstances",
@cognusion
cognusion / riaudit.rb
Created Jan 7, 2014
Simple script to audit AWS EC2 Reserved Instances vs Instances running.
View riaudit.rb
#!/usr/bin/env ruby
# Audits your reserved instances vs your running instances, and reports back.
# If you want to run this from an AWS instance, its IAM Role must be granted at least the following:
#
#{
# "Statement": [
# {
# "Action": [
# "ec2:DescribeInstances",
You can’t perform that action at this time.