View README.md

Required Gems

  • aws-sdk
  • terminal-table

Install: gem install aws-sdk terminal-table

Usage

Run ruby awsazs-update.rb to generate the JSON file.

Run ruby awsazs.rb to see the output:

View Gemfile
source 'https://rubygems.org'
gem 'colorize'
gem 'inifile'
View days.py
from datetime import datetime, timedelta
from tabulate import tabulate
from calendar import day_name
import sys
def wd(d):
return list(day_name)[d]
def sorted_week():
return sorted([(j+1)%7 for j in range(7)], key=lambda n: (n+1)%7)
View keybase.md

Keybase proof

I hereby claim:

  • I am igorlg on github.
  • I am igorlg (https://keybase.io/igorlg) on keybase.
  • I have a public key ASDKo31X3pr6syAi9zz3oFyns-h0nk9evecYBjpm_dtaWwo

To claim this, I am signing this object:

View README.md

QUESTION

Write a function that, given an input array of integers and a desired target_sum, returns the number of combinations, of any length, that add up to that target_sum.

View parse_budget.py
import csv, sys
from datetime import date,datetime
def parse_budget(csvarr):
if '$' not in csvarr[4]:
return False
dt = datetime.strptime(csvarr[0], '%b %Y')
month = dt.month
year = dt.year
View ecs-autoscaing.json
{
"AWSTemplateFormatVersion": "2010-09-09",
"Description": "Template for a VPC with High Availability NAT for ECS",
"Parameters": {
"ClusterName": {
"Description": "The ECS Cluster Name",
"Type": "String"
},
"InstanceType": {
"Description": "NAT instance type",
View vpc-nat-ha.json
{
"AWSTemplateFormatVersion": "2010-09-09",
"Description": "Template for a VPC with High Availability NAT for ECS",
"Parameters": {
"NATInstanceType": {
"Description": "NAT instance type",
"Type": "String",
"Default": "t2.micro",
"AllowedValues": [
"t2.micro",
View aws_tags.rb
require 'open-uri'
require 'aws-sdk-core'
def aws_metadata(path)
return open("http://169.254.169.254/latest/meta-data/#{path}").read.split("\n")[0]
end
Aws.config[:region] = aws_metadata('placement/availability-zone')[0..-2]
Aws.config[:credentials] = Aws::InstanceProfileCredentials.new
ec2 = Aws::EC2::Client.new