Skip to content

Instantly share code, notes, and snippets.

View kszarek's full-sized avatar

Krzysztof Szarek kszarek

View GitHub Profile
@kszarek
kszarek / smartiam.py
Created June 20, 2014 10:37
SmartIAM class
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from boto.exception import BotoServerError
from boto.iam import IAMConnection
__author__ = 'Krzysztof Szarek'
class SmartIAM(IAMConnection):
def create_user(self, user):
@kszarek
kszarek / faf.py
Last active August 29, 2015 14:01
faf show
@task
def show(debug=False):
"""Show server list via EC2"""
instances = get_instances_map(debug)
sorted_instances = sorted(instances, key=lambda instance: instance['name'])
print 'Instance ID Name ',
print 'Public IP Private IP Flavor State',
print ' Status Prev Version Current Version Next Version'
for instance in sorted_instances:
@kszarek
kszarek / pulse.rb
Last active August 29, 2015 14:01
pulse deployment
include_recipe "smart_git::pulse"
include_recipe "smart_nodejs"
execute "start-pulse" do
action :run
command "su - nodejs -c 'cd pulse && ./start.sh'"
not_if "nc -w1 -zvv localhost 5555 2>/dev/null;"
end