Skip to content

Instantly share code, notes, and snippets.

Igor Gentil igorlg

View GitHub Profile
@igorlg
igorlg / Makefile
Created Feb 11, 2019
Makefile for Packer builds - IN PROGRESS
View Makefile
inspec_version = 3.6.4
packer_version = 1.3.4
packer_inspec_version = 0.2.1
terraform_version = 0.11.11
uname_s = $(shell uname -s)
uname_m = $(shell uname -m)
cmd_unzip = @unzip -u -q
cmd_wget = @wget -q -O
cmd_rm = @rm -f
@igorlg
igorlg / README.md
Created Nov 2, 2018
CloudWatch Dasboard for EC2/EBS
View README.md

Creates a basic CloudWatch Dashboard for an EC2 instance and it's EBS volumes.

usage: cw_dashboard_ec2.py [-h] [--dashboard_name DASHBOARD_NAME]
                           [--skip_devices [SKIP_DEVICES [SKIP_DEVICES ...]]]
                           [--volume_group VOLUME_GROUP]
                           [--aws_profile AWS_PROFILE] [--dump]
                           instance_id

Generate a CloudWatch Dashboard for an EC2 Instance
@igorlg
igorlg / README.md
Last active Jul 31, 2017
List AWS AZs and Regions
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:

@igorlg
igorlg / Gemfile
Created Jul 28, 2017
Small ruby script to print the Profiles from ~/.aws/config
View Gemfile
source 'https://rubygems.org'
gem 'colorize'
gem 'inifile'
@igorlg
igorlg / days.py
Created Jun 27, 2017
Show number of each weekday in a year
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:

@igorlg
igorlg / README.md
Created Sep 30, 2016
Simple Python Code Challenge
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.

@igorlg
igorlg / parse_budget.py
Created May 11, 2016
YNAB Export Parser - Parse CSV Files exported from YNAB and add extra fields
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
@igorlg
igorlg / ecs-autoscaing.json
Created Jun 12, 2015
AWS CloudFormation template for ECS AutoScaling Group
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",
You can’t perform that action at this time.