Skip to content

Instantly share code, notes, and snippets.

@shaon
shaon / Eucalyptus Authorization Error
Created April 24, 2012 15:24
Never ever try this at home
import boto
from boto.ec2.regioninfo import RegionInfo
boto_debug=2
if __name__ == '__main__':
conn=boto.connect_ec2(aws_access_key_id="<aws_access_key_id>",
aws_secret_access_key="<aws_secret_access_key>",
is_secure=False,
@shaon
shaon / update_catalog.py
Created November 19, 2012 08:47 — forked from dkavanagh/update_catalog.py
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
@shaon
shaon / configure_env.sh
Last active December 9, 2015 21:59
this script is for configuring PRC server environment for installing Eucalyptus, this is tested on CentOS 6.3 x86_64
#!/bin/bash
# This script is for configuring server
# environment before installing Eucalyptus.
# This is tested on CentOS 6.3 x86_64
if [ "$1" = "" ];
then
echo "Please provide an argument, e.g frontend or nc"
exit 1
@shaon
shaon / vnc_setup_nc.sh
Created December 19, 2012 06:54
set up vnc server on CentOS63 based NCs. It installs Destop (groupinstall), tigervnc-server, virt-manager and few fonts.
#!/bin/bash
yum groupinstall Desktop -y
yum install xorg-x11-fonts-100dpi.noarch xorg-x11-fonts-ISO8859-1-100dpi.noarch xorg-x11-fonts-misc.noarch xorg-x11-fonts-Type1.noarch virt-manager tigervnc-server -y
echo ""
echo 'VNCSERVERS="2:root"' >> /etc/sysconfig/vncservers
echo 'VNCSERVERARGS[2]="-geometry 1024x768"' >> /etc/sysconfig/vncservers
euare-accountcreate -a ui-test-acct-00
euare-useraddloginprofile --delegate ui-test-acct-00 -u admin -p mypassword0
euare-useraddkey --delegate ui-test-acct-00 -u admin
euare-usercreate --delegate ui-test-acct-00 -u user00
euare-useraddloginprofile --delegate ui-test-acct-00 -u user00 -p mypassword1
euare-useraddkey --delegate ui-test-acct-00 -u user00
euare-accountcreate -a ui-test-acct-01
euare-useraddloginprofile --delegate ui-test-acct-01 -u admin -p mypassword2
euare-useraddkey --delegate ui-test-acct-01 -u admin
euare-usercreate --delegate ui-test-acct-01 -u user00
@shaon
shaon / ssh_login.exp
Created January 8, 2013 12:09
simple Expect script to ssh to another machine.
#!/usr/bin/expect
set timeout 1
set cmd {uname -a}
spawn ssh root@$argv
expect_after eof { exit 0 }
## interact with SSH
@shaon
shaon / ea_cloud.sh
Created January 9, 2013 07:15
keep both ea.exp and ea_cloud.sh in the same directory. ssh keys authorized on new CLC host
#!/bin/sh
if [ "$*" == "" ]
then
echo "Usage: $0 <instance id> <new cloud ip>"
exit 1
fi
if [ "$2" == "" ]
then
@shaon
shaon / ea.exp
Created January 9, 2013 07:17
have to keep it in the same directory with ea_cloud.sh
#!/usr/bin/expect
set timeout 2
set user [lindex $argv 0]
set password [lindex $argv 1]
set host [lindex $argv 2]
set data_snap [lindex $argv 3]
set dummy_snap [lindex $argv 4]
#!/bin/bash
export PASSWORD=yourpassword
export HOSTNAME='scalr'
export DOMAIN='.local'
export SCALR_BASE=/usr/local/scalr
export SCALR_HOME=$SCALR_BASE/scalr-home
export SCALR_FILES=$SCALR_BASE/scalr-files
export CURRENT=$SCALR_BASE/current
2013-03-06 21:56:52 ERROR | com.eucalyptus.util.EucalyptusCloudException: Invalid volume group name: vg01/lv_storage
| Run `vgdisplay --help' for more information.
com.eucalyptus.util.EucalyptusCloudException: Invalid volume group name: vg01/lv_storage
Run `vgdisplay --help' for more information.
at edu.ucsb.eucalyptus.util.SystemUtil.run(SystemUtil.java:92)
at com.eucalyptus.storage.DASManager.getVolumeGroup(DASManager.java:234)
at com.eucalyptus.storage.DASManager.updateVolumeGroup(DASManager.java:157)
at com.eucalyptus.storage.DASManager.createVolume(DASManager.java:393)
at edu.ucsb.eucalyptus.cloud.ws.BlockStorage$VolumeCreator.run(BlockStorage.java:1415)