Skip to content

Instantly share code, notes, and snippets.

View igorlg's full-sized avatar

Igor Gentil igorlg

View GitHub Profile
@igorlg
igorlg / Makefile
Created February 11, 2019 23:49
Makefile for Packer builds - IN PROGRESS
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 / HOW_IT_WORKS.md
Created September 9, 2019 22:19
Generate Install script for your Atom Plugins

Breaking down the script

apm list -p -e --no-dev -i -j \

List (apm list) packages (-p) that are enabled (-e), excluding dev packages (--no-dev), that are installed (-i) in JSON format (-j)

  | jq -cM '.user[] | { name: .name, url: .homepage, desc: .description}' \
@igorlg
igorlg / parse_budget.py
Created May 11, 2016 02:53
YNAB Export Parser - Parse CSV Files exported from YNAB and add extra fields
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 / README.md
Last active May 30, 2019 04:46
YADM Hooks

YADM Hooks

My personal YADM hooks, used to automate and/or improve some functionalities from YADM. For details on YADM hooks, check the documentation here.

post_encrypt

This hook performs two actions after running the command yadm encrypt:

  1. Calculate the SHA256 checksum of all files listed under .yadm/encrypt; backup sum file to .yadm/encrypted.sha256sum.old; store these values in .yadm/encrypted.sha256sum;
@igorlg
igorlg / README.md
Created May 30, 2019 04:14
Improved Python version display for PyEnv

List available PyEnv versions

Usage: /Users/igor/Applications/bin/pyver [options] [filter]

Filters: -M: Display only the latest Major versions (default) -m: Display only the latest Minor versions -p: Display all versions -i: Display installed versions

Options:

@igorlg
igorlg / htop2_htoprc
Created March 29, 2019 05:04
My htoprc files
# Beware! This file is rewritten by htop when settings are changed in the interface.
# The parser is also very primitive, and not human-friendly.
fields=0 48 17 18 38 39 40 2 46 47 49 1
sort_key=46
sort_direction=1
hide_threads=0
hide_kernel_threads=1
hide_userland_threads=1
shadow_other_users=0
show_thread_names=1
@igorlg
igorlg / README.md
Created November 2, 2018 00:58
CloudWatch Dasboard for EC2/EBS

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
Created September 13, 2018 03:27
Build VLC on Raspiberry Pi with Hardware Acceleration
@igorlg
igorlg / ecs-autoscaing.json
Created June 12, 2015 21:54
AWS CloudFormation template for ECS AutoScaling Group
{
"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",
@igorlg
igorlg / README.md
Last active July 31, 2017 01:44
List AWS AZs and Regions

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: