Skip to content

Instantly share code, notes, and snippets.

View Kami's full-sized avatar
:octocat:
🐕‍🦺 🦮 🇸🇮 🇺🇦 🇹🇼

Tomaz Muraus Kami

:octocat:
🐕‍🦺 🦮 🇸🇮 🇺🇦 🇹🇼
View GitHub Profile
build_lock = locks.MasterLock('tests')
builders = []
for builder in BUILDER_NAMES:
builder_dict = {
'name': builder,
'slavename': 'slave',
'builddir': builder,
'factory': builder_factories[builder],
'locks': [build_lock.access('exclusive')]
#!/bin/bash
GENERATED_MEMBERS="REQUEST,acl_users,aq_parent,objects,_meta,id,run,DoesNotExist"
find . -name "*.py" -type f \
--indent-string=" " --disable=C0111,W0232 --output-format=parseable \
--include-ids=yes --good-names=qs,dl,d
import subprocess
from urlparse import urlparse, urlunparse
from httplib import HTTPException, HTTPSConnection
from urllib import quote as _quote, unquote
url='https://auth.api.rackspacecloud.com/v1.0'
def http_connection(url):
parsed = urlparse(url)
if parsed.scheme == 'http':
@Kami
Kami / gist:900775
Created April 3, 2011 20:36
Django parallel test runner setup_databases function
...
def setup_databases(self, **kwargs):
if VERSION[0] == 1:
if VERSION[1] == 2 and VERSION[2] < 4:
return self.setup_databases_12(**kwargs)
elif VERSION[2] >= 4 or VERSION[1] == 3:
return self.setup_databases_13(**kwargs)
raise Exception('Unsupported Django Version: %s' % (str(VERSION)))
@Kami
Kami / gist:900789
Created April 3, 2011 20:43
Twisted parallel test runner
class BufferWritesDevice(object):
def __init__(self):
self._data = []
def write(self, string):
self._data.append(string)
def read(self):
return ''.join(self._data)
(cloudkick)kami /opt/cast $ npm search cast
npm ERR! registry error parsing json
npm ERR! SyntaxError: Unexpected token ILLEGAL
npm ERR! <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
npm ERR! <html><head>
npm ERR! <title>401 Authorization Required</title>
npm ERR! </head><body>
npm ERR! <h1>Authorization Required</h1>
npm ERR! <p>This server could not verify that you
npm ERR! are authorized to access the document
scribe_server.cpp
In file included from common.h:62,
from scribe_server.cpp:24:
/usr/local/include/thrift/TProcessor.h:141: warning: ‘virtual bool apache::thrift::TProcessor::process(boost::shared_ptr<apache::thrift::protocol::TProtocol>, boost::shared_ptr<apache::thrift::protocol::TProtocol>, void*)’ was hidden
../src/gen-cpp/scribe.h:165: warning: by ‘virtual bool scribe::thrift::scribeProcessor::process(boost::shared_ptr<apache::thrift::protocol::TProtocol>, boost::shared_ptr<apache::thrift::protocol::TProtocol>)’
scribe_server.cpp: In function ‘int main(int, char**)’:
scribe_server.cpp:100: error: cannot allocate an object of abstract type ‘scribe::thrift::scribeProcessor’
../src/gen-cpp/scribe.h:152: note: because the following virtual functions are pure within ‘scribe::thrift::scribeProcessor’:
/usr/local/include/thrift/TProcessor.h:141: note: virtual bool apache::thrift::TProcessor::process(boost::shared_ptr<apache::thrift::protocol::TProtocol>, boost::shared_ptr<apache::thrift::p
libcloud is an open-source client library for interacting with different cloud providers.
The primary goal of the library is to abstract all the provider differences away and expose common functionality in a nice, clean and concise API.
This talk will address the following topics:
- Why a library like this was built in the first place
- Different problems we have encountered while building it (not all the providers always play nice)
- An introduction to the library API (both compute and storage part)
- How to use it to build something useful and fun
copy_cast_files = env.Command('.%s' % (cast_install_prefix), cast_paths, copy_tree)
symlink_cast_client = env.Command('/usr/local/bar', 'bar', symlink)
env.Depends(symlink_cast_client, copy_cast_files)
install = []
if not system_node_binary_path:
install.extend(install_node)
install.extend(install_cast)
function stringifyCoverage(_jscoverage) {
var i, file, fileObj, fileLines;
var coverageObj = {};
files = Object.keys(_jscoverage);
for (i = 0; i < files.length; i++) {
file = files[i];
fileObj = _jscoverage[file];
source = fileObj['source'];
delete fileObj['source'];