Skip to content

Instantly share code, notes, and snippets.

from boto.ec2.autoscale import AutoScaleConnection
groupname = ''
as_conn = AutoScaleConnection(
aws_access_key_id='',
aws_secret_access_key=''
)
group = as_conn.get_all_groups(names=[groupname])[0]
from boto.ec2.autoscale import AutoScaleConnection
groupname = ''
as_conn = AutoScaleConnection(
aws_access_key_id='',
aws_secret_access_key=''
)
group = as_conn.get_all_groups(names=[groupname])[0]
@seungjin
seungjin / autoscale_sample
Created November 26, 2012 05:12 — forked from liamf/autoscale_sample
Demonstrates using patched boto to create an autoscaling group of servers, scaled up/down by CPU Utilisation
#################################################################################
# Import modules
#################################################################################
import os
import time
import sys
import socket
import string
@seungjin
seungjin / fabfile.py
Created July 30, 2012 02:47 — forked from winhamwr/fabfile.py
Fabric script to bundle an ami
def bundle_ami():
require('dev_aws_userid')
require('dev_aws_access_key_id')
require('dev_aws_secret_access_key')
require('ami_bucket')
require('config_folder')
require('hudson_slave_ami_name')
env.ami_name = env.hudson_slave_ami_name
@seungjin
seungjin / agent.conf
Created June 27, 2012 03:01 — forked from fxtentacle/agent.conf
Hajo's logstash config
input {
exec {
type => "dstat"
command => "dstat -cdngypms --nocolor 1 0"
interval => 13
}
exec {
type => "apache-benchmark"
@seungjin
seungjin / es.sh
Created June 7, 2012 01:06 — forked from aaronshaf/es.sh
Install ElasticSearch on Ubuntu 11.04
cd ~
sudo apt-get update
sudo apt-get install unzip curl python-software-properties -y
#sudo add-apt-repository "deb http://archive.canonical.com/ lucid partner"
sudo add-apt-repository ppa:ferramroberto/java
sudo apt-get update
sudo apt-get install sun-java6-jre sun-java6-plugin -y
wget https://github.com/downloads/elasticsearch/elasticsearch/elasticsearch-0.18.7.tar.gz -O elasticsearch.tar.gz
tar -xf elasticsearch.tar.gz
@seungjin
seungjin / gist:2564765
Created May 1, 2012 03:40
autoscaling with boto
import boto.ec2
from boto.ec2.elb import ELBConnection
from boto.ec2.elb import HealthCheck
from boto.ec2.autoscale import AutoScaleConnection
from boto.ec2.autoscale import LaunchConfiguration
from boto.ec2.autoscale import AutoScalingGroup
from boto.ec2.autoscale import ScalingPolicy
@seungjin
seungjin / autoscaling_boto.py
Created May 1, 2012 03:11 — forked from numan/autoscaling_boto.py
Example of setting up AWS auto scaling using boto API
"""
The MIT License (MIT)
Copyright (c) 2011 Numan Sachwani
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
of the Software, and to permit persons to whom the Software is furnished to do
so, subject to the following conditions:
# Xapi Base Module
#
# Description:: Setup the Session and auth for xapi
# Author:: Jesse Nelson <spheromak@gmail.com>
#
# Copyright:: Copyright (c) 2012, Jesse Nelson
#
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
@seungjin
seungjin / gist:1546284
Created January 1, 2012 04:51
zabbix api connection
#curl -i -X POST -H 'Content-Type: application/json' -d '{"params": {"password": "mypassword", "user": "myuser"}, "jsonrpc": "2.0", "method": "user.authenticate"}' http://0.0.0.0/zabbix/api_jsonrpc.php
require 'net/http'
require 'json'
def post
host = '0.0.0.0'
port = '80'