Skip to content

Instantly share code, notes, and snippets.

View neillturner's full-sized avatar

Neill Turner neillturner

View GitHub Profile
@neillturner
neillturner / aws-scheduler.py
Created October 17, 2015 17:22
Scheduler that starts/stops EC2 instances using a JSON based schedule.
"""This scheduler starts/stops EC2 instances using a JSON based schedule.
Usage:
aws-scheduler check [<instance_id> ...] [options]
aws-scheduler (-h | --help)
aws-scheduler --version
Options:
-c --config CONFIG Use alternate configuration file [default: ./aws.cnf].
@neillturner
neillturner / generate_hosts_file.py
Created October 14, 2015 09:32
For Softlayer generate /etc/hosts from the list of active VMs and private IP addresses. This enables servers inside a softlayer private vlan to communicate with each other via hostname
'''
Get the list of active VMs based on the creator ID and generate /etc/hosts file
'''
from __future__ import print_function
import sys
import os
import SoftLayer
def generate_hosts_file(username, api_key, creator_id=None):
"""