Skip to content

Instantly share code, notes, and snippets.

View somic's full-sized avatar

Dmitriy Samovskiy somic

View GitHub Profile
The lock-in I believe @randybias is referring to (and I personally
totally agree with him on this) is more subtle.
There most likely are not going to be significant issues moving a system
consisting of 1 or 2 instances.
But imagine you have a 10-instance topology in GoGrid. GG has 2 NICs, but even
more importantly - one NIC is private network (which gives
you access to your storage), the second NIC is public (instance's public
@somic
somic / instantiate_vapp_template.xml
Created January 22, 2010 17:36
vCloud API XML for instantiatevAppTemplate (replace 000 with your IDs)
<InstantiateVAppTemplateParams name="d" xml:lang="en" xmlns="http://www.vmware.com/vcloud/v0.8" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<VAppTemplate href="https://services.vcloudexpress.terremark.com/api/v0.8/vAppTemplate/000" />
<InstantiationParams>
<VirtualHardwareSection xmlns:q1="http://www.vmware.com/vcloud/v0.8">
<Item xmlns="http://schemas.dmtf.org/ovf/envelope/1">
<InstanceID xmlns="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData">1</InstanceID>
<ResourceType xmlns="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData">3</ResourceType>
<VirtualQuantity xmlns="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData">1</VirtualQuantity>
</Item>
<Item xmlns="http://schemas.dmtf.org/ovf/envelope/1">
@somic
somic / udp_hole_punch_tester.py
Created November 3, 2009 04:13
UDP Hole Punching test tool
#!/usr/bin/env python
#
# udp_hole_punch_tester.py - UDP Hole Punching test tool
#
# Usage: udp_hole_punch_tester.py remote_host remote_port
#
# Run this script simultaneously on 2 hosts to test if they can punch
# a UDP hole to each other.
#
# * remote_port should be identical on 2 hosts.
@somic
somic / gist:123889
Created June 4, 2009 22:16
Prints out how many seconds ago this EC2 instance was started
#!/bin/bash
#
# Prints out how many seconds ago this EC2 instance was started
#
# It uses Last-Modified header returned by EC2 metadata web service, which as far
# as I know is not documented, and hence I assume there is no guarantee
# that Last-Modified will be always set correctly.
#
# Use at your own risk.
#
@somic
somic / gist:102602
Created April 27, 2009 17:30
a way to emulate rabbitmqctl from python
#!/usr/bin/env python
# requires py_interface
# http://www.lysator.liu.se/~tab/erlang/py_interface/
import sys, os, time
from py_interface import erl_node, erl_eventhandler
from py_interface.erl_opts import ErlNodeOpts
from py_interface.erl_term import ErlAtom, ErlBinary
require 'ip'
IP::Address::IPv4.class_eval do
# returns next IP address
def next(step=1)
IP::Address::Util.unpack(self.pack + step)
end
# returns previous IP address
#!/usr/bin/env ruby
#
# forking supervisor - forks workers and replaces dead workers.
# start it in one console, send signals to it from another console.
#
require 'rubygems'
require 'daemons/daemonize'