Skip to content

Instantly share code, notes, and snippets.

View dkavanagh's full-sized avatar

David Kavanagh dkavanagh

View GitHub Profile
@dkavanagh
dkavanagh / cloud-init-reqgen.txt
Created September 16, 2015 16:56
cloud init script for setting up a request generator against eucaconsole. Note: modify the endpoint on line 13
#cloud-config
# vim: syntax=yaml
#
# This config installs the eucalyptus and epel repos, then installs and
# configures the eucaconsole package
runcmd:
- [ yum, -y, install, wget, python-pip ]
- [ pip, install, requests, cachecontrol, beautifulsoup4 ]
- [ pip, install, --upgrade, urllib3, requests ]
@dkavanagh
dkavanagh / get_cloud_ssl_cert.sh
Created September 10, 2015 16:27
extract eucalyptus default ssl cloud cert
keytool -exportcert -alias eucalyptus -file cloud-ssl.crt -keystore /var/lib/eucalyptus/keys/euca.p12 -storepass eucalyptus -storetype pkcs12 -rfc
@dkavanagh
dkavanagh / deploy-console.sh
Last active July 20, 2016 18:46
This script generates a self-signed SSL cert and creates a Eucalyptus Management Console deployment using it (with ELB and AS services). It pulls in a CloudFormations template as well https://gist.github.com/dkavanagh/8cc932f0688b909547fe
#!/bin/bash
# params passed to cloud formation template
CLOUD_IP=10.111.5.150
SSH_KEY=dak-ssh-key
IMAGE_ID=emi-bc44e9e6
# create a self-signed ssl cert and install it via IAM
C=US
ST=CA
L="Santa Barbara"
@dkavanagh
dkavanagh / eucaconsole-template.cfn
Last active April 27, 2016 13:37
Cloud Formation template for deploying the Eucalyptus Management Console on Eucalyptus
{
"AWSTemplateFormatVersion" : "2010-09-09",
"Description" : "Deploy Eucalyptus Management Console with ELB, Autoscaling.",
"Parameters" : {
"ImageId" : {
"Description" : "The ID of the image to use for the console",
"Type" : "String",
"ConstraintDescription" : "Must be the ID of a CentOS image on the cloud."
@dkavanagh
dkavanagh / confg_cloud_volumes.sh
Created August 28, 2014 17:03
adjust cloud properties for larger volumes
yum install -y http://downloads.eucalyptus.com/software/eucalyptus/nightly/4.0/centos/6/x86_64/eucalyptus-4.0.0-0.0.1051.el6.x86_64.rpm
yum install -y http://downloads.eucalyptus.com/software/eucalyptus/nightly/4.0/centos/6/x86_64/eucalyptus-admin-tools-4.0.0-0.0.1051.el6.noarch.rpm
source eucarc
euca-modify-property -p PARTI00.storage.maxvolumesizeingb=25
euca-modify-property -p PARTI01.storage.maxvolumesizeingb=25
euca-modify-property -p PARTI00.storage.maxtotalvolumesizeingb=250
euca-modify-property -p PARTI01.storage.maxtotalvolumesizeingb=250
@dkavanagh
dkavanagh / foundation.abide.js.patch
Created July 15, 2014 12:54
foundation abide patch to allow skipping validation for a form cancel button
index 9898eac..44eab0e 100644
--- a/eucaconsole/static/js/thirdparty/foundation/foundation.abide.js
+++ b/eucaconsole/static/js/thirdparty/foundation/foundation.abide.js
@@ -53,7 +53,8 @@
events : function (scope) {
var self = this,
form = $(scope).attr('novalidate', 'novalidate'),
- settings = form.data('abide-init');
+ settings = form.data('abide-init'),
+ cancel_target = form.attr('cancel-target');
@dkavanagh
dkavanagh / cloud-config-eucaconsole.txt
Created June 11, 2014 18:08
Cloud Init script for the Eucalyptus Management console
#cloud-config
# vim: syntax=yaml
#
# This config installs the eucalyptus and epel repos, then installs and
# configures the eucaconsole package
runcmd:
- [ yum, -y, install, "http://downloads.eucalyptus.com/software/eucalyptus/nightly/4.0/centos/6/x86_64/eucalyptus-release-4.0-0.1.el6.noarch.rpm" ]
- [ yum, -y, install, eucaconsole ]
- [ sed, -i, "s/localhost/10.111.5.78/", /etc/eucaconsole/console.ini ]
@dkavanagh
dkavanagh / cloud-config-eucaconsole.txt
Created April 30, 2014 13:57
This script installs the eucalyptus management console on a centos instance. Edit the IP on line 10 to refer to the proper eucalyptus back end.
#cloud-config
# vim: syntax=yaml
#
# This config installs the eucalyptus and epel repos, then installs and
# configures the eucaconsole package
runcmd:
- [ yum, -y, install, "http://downloads.eucalyptus.com/software/eucalyptus/nightly/4.0/centos/6/x86_64/eucalyptus-release-4.0-0.1.el6.noarch.rpm" ]
- [ yum, -y, install, eucaconsole ]
- [ sed, -i, "s/localhost/10.111.5.78/", /etc/eucaconsole/console.ini ]
@dkavanagh
dkavanagh / pullupdates.sh
Created June 12, 2013 18:05
pullupdates.sh
branch=`git rev-parse --abbrev-ref HEAD`
echo "pulling from "$branch
git submodule foreach git pull origin $branch
git pull origin $branch
@dkavanagh
dkavanagh / http redirect example
Last active December 18, 2015 09:18
http redirector that works with tornado. start_redirector (in my code) gets called in a background thread.. ignore the callback arg, which is None, but kwargs is passed in containing use_ssl and port as values for the redirect handler.
def start_redirector(kwargs, callback):
# can't use tornado for this (not threadsafe). Must use something else, something simpler!
http_port = 8888
if eucaconsole.config.has_option('server', 'http.port'):
http_port = eucaconsole.config.getint('server', 'http.port')
server = BaseHTTPServer.HTTPServer(('localhost', http_port),
lambda *args: RedirectHandler(kwargs, *args))
server.serve_forever()
class RedirectHandler(BaseHTTPRequestHandler):