Skip to content

Instantly share code, notes, and snippets.

View torian's full-sized avatar
💻
Syn Ack

Emiliano Castagnari torian

💻
Syn Ack
  • Tandil, Argentina
View GitHub Profile
#!/usr/bin/env python
import os
import requests
import json
AWS_SERVICE = os.environ.get("AWS_SERVICE", "CLOUDFRONT")
AWS_IP_RANGES = "https://ip-ranges.amazonaws.com/ip-ranges.json"
req = requests.get(AWS_IP_RANGES).text
@torian
torian / Vagrantfile-kubernetes
Created February 27, 2019 21:28
Kubernetes multinode vagrant file
VAGRANTFILE_API_VERSION = '2'
# Usage:
# vagrant up master
# # After master's provisioning is done, take note of the `kubeadm join` command
# # and copy the token and certificate sha into K8S_NODE_INIT script. Alternatively,
# # execute the following command:
# # sudo kubeadm token create --print-join-command
# vagrant ip node1
#

Keybase proof

I hereby claim:

  • I am torian on github.
  • I am torian (https://keybase.io/torian) on keybase.
  • I have a public key ASCL5oUIZu1UIVnZ1cndbzGu6fenL7NmbOVfCe68_6agkwo

To claim this, I am signing this object:

@torian
torian / aws_snaps.py
Last active August 4, 2017 17:55
AWS Snapshot cleanup
#!/usr/bin/env python
"""
Usage:
aws_snaps.py amis [options]
aws_snaps.py volumes [options]
aws_snaps.py snapshots [options]
Options:
--iddqd God mode. By default, deletions are run in dry mode
# vi:ts=2:sw=2:et:ft=ruby
VAGRANTFILE_API_VERSION = "2"
# << Consul
#
consul_version = '0.7.0'
$consul_script = <<SCRIPT
echo Installing dependencies...
sudo apt-get update
@torian
torian / kinesis_split.py
Created April 27, 2016 14:52
AWS Kinesis shard split
import time
from boto import kinesis
AWS_PROFILE = None
AWS_REGION = 'us-east-1'
AWS_STREAM_NAME = 'YourStreamName'
WAIT_STATUS_SEC = 5
WAIT_STATUS_ROUNDS = 5
@torian
torian / elb.py
Last active August 29, 2015 13:56
AWS ELB monitoring
#!/usr/bin/env python
"""Usage: elb [-r REGION] [-l LBNAME]
-r REGION, --region REGION Region name [default: eu-west-1]
-l LBNAME, --lb LBNAME Load Balancer name
"""
from docopt import docopt
import boto