Skip to content

Instantly share code, notes, and snippets.

View cognusion's full-sized avatar

M@ cognusion

View GitHub Profile
@cognusion
cognusion / riaudit.rb
Created January 7, 2014 13:46
Simple script to audit AWS EC2 Reserved Instances vs Instances running.
#!/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",
@cognusion
cognusion / genS3url.go
Last active August 29, 2015 14:21
Simple Go function to generate a valid S3 Signed URL
package generateSignedS3URL
import (
"fmt"
"crypto/hmac"
"crypto/sha1"
"encoding/base64"
"net/url"
"time"
)
@cognusion
cognusion / azaudit.rb
Created March 24, 2015 14:16
Simple script to audit AWS EC2 Availability Zone usage, to spot imbalances
#!/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 August 28, 2014 14:36
Simple script to audit AWS EC2 instances vs a Livestatus-enabled nagios system
#!/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",