This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# Install dependencies with: | |
# gem install aws-sdk-rds aws-sdk-ec2 | |
require 'aws-sdk-rds' | |
require 'aws-sdk-ec2' | |
require 'csv' | |
aws_regions = %w[us-east-1 us-east-2 us-west-1 us-west-2 sa-east-1] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def probability_of_collision(k, x) | |
total_numbers = 32**x | |
1 - Math::E**(((k-1)*-k) / (2.0*total_numbers)) | |
end | |
# Example | |
probability_of_collision(100000, 8) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This script will look for cloudformation stacks on your account and download all the templates for you! | |
# Author: Gabriel Lett Viviani <http://github.com/gabriellett> | |
# Make sure you have aws-cli installed and configured on your machine,. | |
require 'json' | |
require 'optparse' | |
options = {} | |
OptionParser.new do |opts| | |
opts.banner = "Usage: cfn-template-dump.rb [options]" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
while true; do | |
pgrep redshift && exit # Already running. | |
gtk-redshift | |
# Died? Check again after 10 seconds. | |
sleep 10 | |
done |