Skip to content

Instantly share code, notes, and snippets.

View jedinerd's full-sized avatar

Michael Hogg jedinerd

View GitHub Profile
### Keybase proof
I hereby claim:
* I am jedinerd on github.
* I am michaelhogg (https://keybase.io/michaelhogg) on keybase.
* I have a public key ASC-pUuYzrBLtrJXuDatmTPKP2yZguvvFZJx9FsHGJGkUwo
To claim this, I am signing this object:
require 'aws-sdk'
require 'date'
now = Date.today
days_ago_7 = now - 7
days_ago_30 = now - 30
years_ago_3 = now - ( 365 * 3 )
rds = Aws::RDS::Client.new(region: 'us-west-1')
config_array = { db_instance_identifier: "bn-mysql-read-1",}
snapshots = rds.describe_db_snapshots(config_array).db_snapshots
a = [25, -35, 12, 6, 92, -115, 17, 2, 2, 2, -7, 2, -9, 16, 2, -11]
len = a.length
catch(:stop) do
(0..len).reverse_each do |index|
pos = len - index
(0..pos).each do |set|
if a[set..index-1+set].inject(:+) == 0
puts "#{set} #{index-1+set}"
throw :stop
end
#
# Himawari-8 Downloader
#
#
#
# This script will scrape the latest image from the Himawari-8 satellite, recombining the tiled image,
# converting it to a JPG which is saved in My Pictures\Himawari\ and then set as the desktop background.
#
# http://himawari8.nict.go.jp/himawari8-image.htm
#
@jedinerd
jedinerd / r53-spf.rb
Created January 15, 2016 00:39
Find all spf records in your route53 account.
require 'aws-sdk'
require 'pry'
r53 = Aws::Route53::Client.new(region: 'us-west-1')
records = Array.new
params = Hash.new
begin
resp = r53.list_hosted_zones(params)
records += resp.hosted_zones