Skip to content

Instantly share code, notes, and snippets.

View tomellis's full-sized avatar

Tom Ellis tomellis

View GitHub Profile
@tomellis
tomellis / euca-boto-example.py
Created August 15, 2012 12:30
Eucalyptus Boto Example
#!/usr/bin/python
# Simple example to list all images in Eucalyptus via ec2-api
# Author: tom.ellis@eucalyptus.com
import boto
from boto.ec2.regioninfo import RegionInfo
# Credentials
access_key=""
@tomellis
tomellis / walrus-boto-example.py
Created August 15, 2012 12:31
Walrus Boto Example
#!/usr/bin/python
# Simple example to list all s3 buckets in Walrus
# Author: tom.ellis@eucalyptus.com
import boto
from boto.s3.connection import OrdinaryCallingFormat
# Credentials
access_key=""
[root@test ~]# euca-describe-services -E -A
SERVICE eucalyptus eucalyptus x.x.x.x ENABLED 1006 http://x.x.x.x:8773/services/Eucalyptus arn:euca:eucalyptus:::x.x.x.x/
SERVICE eucalyptus eucalyptus x.x.x.5 DISABLED 1006 http://x.x.x.5:8773/services/Eucalyptus arn:euca:eucalyptus:::x.x.x.5/
SERVICE reporting bootstrap x.x.x.x ENABLED 1006 http://x.x.x.x:8773/services/Reporting arn:euca:bootstrap::reporting:x.x.x.x/
SERVICE configuration eucalyptus x.x.x.x ENABLED 1006 http://x.x.x.x:8773/services/Configuration arn:euca:eucalyptus::configuration:x.x.x.x/
SERVICE ldap eucalyptus x.x.x.x ENABLED 1006 http://x.x.x.x:8773/services/Ldap arn:euca:eucalyptus::ldap:x.x.x.x/
SERVICE db eucalyptus x.x.x.x ENABLED 1006 postgresql://x.x.x.x:8777/eucalyptus?ssl=true&sslfactory=com.eucalyptus.postgresql.PostgreSQLSSLSocketFactory arn:euca:eucalyptus::
@tomellis
tomellis / start-instance-form.php
Created October 24, 2012 13:35
Simple AWS PHP SDK example for Eucalyptus
<?php
// Source AWS PHP SDK functions
require_once '../sdk.class.php';
// Instantiate the AmazonEC2 class
$options = array(
'key' => 'ENTER-YOUR-ACCESS-KEY-HERE',
'secret' => 'ENTER-YOUR-SECRET-KEY-HERE',
);
@tomellis
tomellis / CCclient_full_prep.sh
Created November 8, 2012 00:51
Centos6 CCclient_full query
#!/bin/bash
# Prep el6 for CCclientfull
LIBS=/usr/lib64/
CRYPTOLIB_REQ="libcrypto.so.0.9.8"
CRYPTOLIB_EL6="libcrypto.so.1.0.0"
CURLLIB_REQ="libcurl-gnutls.so.4"
CURLLIB_EL6="libcurl.so.4.1.1"
if [ ! -f ${LIBS}/${CRYPTOLIB_REQ} -o ! -h ${LIBS}/${CRYPTOLIB_REQ} -a -f ${LIBS}/${CRYPTOLIB_EL6} ]; then
@tomellis
tomellis / CCclient-enabled-check.sh
Created November 8, 2012 01:23
Check script for keepalived
#!/bin/bash
#
# Check to see if a CC service is in ENABLED or DISABLED state using CCclient_full
# Author: Tom Ellis <tom.ellis@eucalyptus.com>
#
# Returns 1 if DISABLED or not installed
# Return 0 if ENABLED
export AXIS2C_HOME=/usr/lib64/axis2c
export LD_LIBRARY_PATH=$AXIS2C_HOME/lib:$AXIS2C_HOME/modules/rampart/
@tomellis
tomellis / euca-clc-backup.sh
Created December 12, 2012 15:15
Eucalyptus CLC backup script
#!/bin/sh
# Eucalyptus CLC Backup & Restore script
# - includes DB & Keys
# Database Options
DBPORT="8777"
DBUSER="root"
DBDIR="/var/lib/eucalyptus/db/data"
DBSOCKET="${DBDIR}/.s.PGSQL.${DBPORT}"
@tomellis
tomellis / ks-centos6-euca.cfg
Last active December 14, 2015 09:19
AMI-Creator CentOS6 Kickstart
# Build a basic CentOS 6 AMI
lang en_US.UTF-8
keyboard us
timezone US/Eastern
auth --useshadow --enablemd5
selinux --disabled
firewall --disabled
bootloader --timeout=1
network --bootproto=dhcp --device=eth0 --onboot=on
services --enabled=network
@tomellis
tomellis / read_reddit.py
Created April 15, 2013 15:39
Updated for urllib3 for MongoDB for developers course (M101P)
import json
import urllib3
import pymongo
# connect to mongo
connection = pymongo.Connection("mongodb://localhost", safe=True)
# get a handle on the reddit db
db=connection.reddit
stories = db.stories
@tomellis
tomellis / get-ip.py
Created May 1, 2013 15:31
Get Rackspace Cloud Server Public IP Addresses
#!/usr/bin/env python
import os
import sys
import logging
import pyrax
import pyrax.exceptions as exc
# Set loglevel