Skip to content

Instantly share code, notes, and snippets.

View dkavanagh's full-sized avatar

David Kavanagh dkavanagh

View GitHub Profile
@dkavanagh
dkavanagh / shareimages.sh
Created May 22, 2013 13:03
make all images public (ec2, eucalyptus)
for i in `euca-describe-images | awk '{ print $2; }'`
do
echo $i
euca-modify-image-attribute -l -a all $i
done
@dkavanagh
dkavanagh / pushtoremote.sh
Last active July 15, 2016 15:28
pushtoremote.sh - I revised this to work with the current branch because I never ended up passing in anything other than that.
branch=`git rev-parse --abbrev-ref HEAD`
if [ "$branch" = "master" ] || [ "$branch" = "maint-4.1" ]
then
echo "Pushing to "$branch" is no bueno."
exit -1
fi
echo "pushing to "$branch
git submodule foreach git push origin $branch
git push origin $branch
@dkavanagh
dkavanagh / switchbranch.sh
Created February 5, 2013 20:48
This script is called by passing in a new branch name. It is used by eucalyptus where we have sub-modules that require updating as well as the top level refs. Errors will cause things to stop (like changes not checked in).
git submodule foreach git checkout $1
git submodule foreach git pull origin $1
git checkout $1
git pull origin $1
@dkavanagh
dkavanagh / create_users.sh
Last active June 7, 2016 12:46
This script creates test users that are the same as created by eucalyptus ui tests. So, if you're setting up a test cloud by some other means (like kickstarting a package-built cloud), you can run this after getting the admin credentials.
echo "{ \"Statement\": [ { \"Effect\": \"Allow\", \"Action\": \"*\", \"Resource\": \"*\" } ] }" >all.policy
k=0
ADMIN=`cat .euca/euca-admin.ini |grep "^user" |awk '{ print $3; }'`
HOST=`cat .euca/euca-admin.ini |grep "^default-region" |awk '{ print $3; }'`
REGION=$ADMIN@$HOST
for i in ui-test-acct-00 ui-test-acct-01 ui-test-acct-02 ui-test-acct-03
do
echo "creating users for "$i
euare-accountcreate --region $REGION -a $i
euare-useraddloginprofile --region $REGION --as-account $i -u admin -p mypassword$k
@dkavanagh
dkavanagh / LifeInColor.pde
Created December 9, 2012 04:12
Conway's Game Of Life running on an Arduino, displaying on a string of RGB LEDs arranged in a matrix
/*
* Conway's "Life"
*
* Adapted from the Life example
* on the Processing.org site
*
* Written by David Kavanagh (dkavanagh@gmail.com).
*/
#include "SPI.h"
#include "Adafruit_WS2801.h"
@dkavanagh
dkavanagh / update_catalog.py
Created September 17, 2012 17:51
Tool for updating eustore catalog based on signature calculated from tarballs
#!/usr/bin/env python
import os
import sys
import urllib2
import json
import hashlib
import zlib
from optparse import OptionParser