I hereby claim:
- I am krzysztofszarek on github.
- I am kszarek (https://keybase.io/kszarek) on keybase.
- I have a public key whose fingerprint is 3830 FF0B C48D 86FF C8BF 0D40 AACD 88D7 CAD4 A964
To claim this, I am signing this object:
| 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 |
| @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: |
| #!/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): |
| dev_sda1 = boto.ec2.blockdevicemapping.BlockDeviceType( | |
| delete_on_termination=True, volume_type='gp2') | |
| dev_sda1.size = env.ebs_size # size in Gigabytes | |
| bdm = boto.ec2.blockdevicemapping.BlockDeviceMapping() | |
| bdm['/dev/sda'] = dev_sda1 |
| cron "chef-client-autostart" do | |
| time :reboot | |
| command "/opt/chef/embedded/bin/ruby /usr/bin/chef-client -c /etc/chef/client.rb -L /var/log/chef.log -P /var/run/chef/client.pid" | |
| end |
| #cartmans | |
| upstream wo { | |
| <%- @wo.each do |host| %> | |
| server <%= host %>:80<%- if @wo.length > 1 and @wo.index(host) != 0 %> backup<%- end %>; | |
| <%- end %> | |
| } | |
| #cartmans2 | |
| upstream wo2 { | |
| <%- @wo.each do |host| %> | |
| server <%= host %>:80<%- if @wo.length > 1 and @wo.index(host).modulo(2) != 1 %> backup<%- end %>; |
| #!/usr/bin/env python | |
| # -*- coding: utf-8 -*- | |
| __author__ = 'Krzysztof Szarek' | |
| from functools import wraps | |
| from fabric.decorators import _wrap_as_new | |
| from darwin.ec2 import _cloud_hosts |
| class CustomTask(Task): | |
| def __init__(self, func, myarg, *args, **kwargs): | |
| super(CustomTask, self).__init__(*args, **kwargs) | |
| self.func = func | |
| self.myarg = myarg | |
| if env.hosts == []: | |
| logger.debug("env.hosts is empty") | |
| # if hasattr(env, 'env_name'): | |
| logger.debug("Found env_name in env") |
I hereby claim:
To claim this, I am signing this object:
| #!/bin/bash | |
| set -xe | |
| echo "Add repository and install java" | |
| apt-get -y install python-software-properties | |
| add-apt-repository -y ppa:webupd8team/java | |
| apt-get -q -y update | |
| apt-get -y upgrade | |
| echo "Accept license" |