Skip to content

Instantly share code, notes, and snippets.

View swill's full-sized avatar

Will Stevens swill

View GitHub Profile
@swill
swill / ova_split_function.py
Last active May 2, 2017 12:24
A function extracted from a VMware migration tool to illustrate splitting an OVA file into one OVA per disk.
def split_ova(vm_id):
split_ok = True
conf.read(['./running.conf'])
vms = json.loads(conf.get('STATE', 'vms'))
## this script is designed to work with Python 2.5+, so we are not using anything from ElementTree 1.3, only 1.2...
## this is important in order to support CentOS at the time of this writing.
ns = {}
ns['ns'] = 'http://schemas.dmtf.org/ovf/envelope/1'
ns['ovf'] = 'http://schemas.dmtf.org/ovf/envelope/1'
@swill
swill / chan.go
Last active March 17, 2017 22:42
Go limited concurrency with built in retry
package main
import (
"fmt"
"net/http"
"time"
)
type Op struct {
Attempt int
@swill
swill / summary.txt
Created March 2, 2012 19:17
slogging summary
Summary of the config and files in play for slogging...
-------------------------------------------------------
config file: /etc/swift/log-processor.conf
/usr/local/bin
--------
swift-access-log-delivery
=> {config: log-processor.conf -> [log-processor-access] }
=> {class: from slogging.access_log_delivery import AccessLogDeliveryDaemon }
@swill
swill / cs_api_creds.py
Created December 12, 2011 20:18
Two Cloudstack authentication methods: using api keys & using user credentials
import urllib
import urllib2
import hmac
import hashlib
import base64
import json
import pprint
class CloudstackAPI(object):
"""