This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
## OpenLDAP simple installation script. As tested on CentOS 6.3 | |
## This script must be run as root | |
#http://blog.secaserver.com/2013/01/centos-install-openldap-webmin-simple-way/ | |
hostname=`hostname` | |
echo "===========================================================" | |
echo " This script will install OpenLDAP" | |
echo "It assumes that there is no OpenLDAP installed in this host" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# checks if branch has something pending | |
function parse_git_dirty() { | |
git diff --quiet --ignore-submodules HEAD 2>/dev/null; [ $? -eq 1 ] && echo "*" | |
} | |
# gets the current git branch | |
function parse_git_branch() { | |
git branch --quiet --no-color 2> /dev/null | sed -e '/^[^*]/d' -e "s/* \(.*\)/\1$(parse_git_dirty)/" | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
""" | |
Recipe for creating and updating security groups programmatically. | |
""" | |
import collections | |
import boto |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// createSnapshots - Create snapshots from a list of volumes | |
// Include the AWS SDK and set the region | |
var AWS = require('aws-sdk'); | |
AWS.config.region = 'us-east-1'; | |
// New EC2 object | |
var ec2 = new AWS.EC2(); | |
// Build a YYYYMMDD formatted current date string | |
var now = new Date(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# adaptive knife.rb | |
def colorize(text, color_code) | |
"\e[#{color_code}m#{text}\e[0m" | |
end | |
def red(text); colorize(text, 31); end | |
def green(text); colorize(text, 32); end | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PIDFILE="/var/run/puppet-sync.pid" | |
TMPFLD="/usr/src/puppet_local_repo" | |
DEPLOYTMPFLD="/etc/puppet" | |
removePID () { | |
rm -rf $PIDFILE | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# /tmp/test = EBS-SSD | |
# /mnt/test = instance-store | |
root@ip-10-0-2-6:~# dd bs=1M count=256 if=/dev/zero of=/tmp/test | |
256+0 records in | |
256+0 records out | |
268435456 bytes (268 MB) copied, 3.26957 s, 82.1 MB/s | |
root@ip-10-0-2-6:~# dd bs=1M count=256 if=/dev/zero of=/tmp/test | |
256+0 records in | |
256+0 records out |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
################################################## | |
### Elasticsearch host name | |
ES_HOST = "search-******************.ap-northeast-1.es.amazonaws.com" | |
### Elasticsearch prefix for index name | |
INDEX_PREFIX = "elb_log" | |
### ELB name for type name | |
ELB_NAME = "*****" | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"Version": "2012-10-17", | |
"Statement": [ | |
{ | |
"Effect": "Allow", | |
"Action": [ | |
"ec2:DescribeAddresses", | |
"ec2:DescribeClassicLinkInstances", | |
"ec2:DescribeCustomerGateways", | |
"ec2:DescribeDhcpOptions", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import boto3 | |
def find_public_addresses(ec2): | |
public_instances = {} | |
instance_public_ips = {} | |
instance_private_ips = {} | |
instance_ident = {} | |
instances = ec2.instances.filter(Filters=[{'Name': 'instance-state-name', 'Values': ['running'] }]) | |
# Ranges that you define as public subnets in AWS go here. |
OlderNewer