Skip to content

Instantly share code, notes, and snippets.

@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 <[email protected]>
#
# 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'
@seungjin
seungjin / gist:1520433
Created December 26, 2011 02:40
check_time_sync.rb
def check_time_sync
require 'net/telnet'
time_server = 'time.bora.net'
options = {
"Host" => time_server,
@seungjin
seungjin / gist:1520412
Created December 26, 2011 02:24
get time over the web
require 'net/telnet'
TIME_SERVER = 'time.bora.net'
options = {
"Host" => TIME_SERVER,
"Telnetmode" => false,
"Timeout" => 30,
"Port" => "time"
}
@seungjin
seungjin / xdate.py
Created December 4, 2011 04:43
xdate; python extended date unix command
#!/usr/bin/env python
# extended date command for *nix / writtern in python
# Copyright (c) 2011-2012, Seung-jin Kim, All right reserverd
# Twitter: @seungjin
import sys
import time
from time import gmtime, strftime