Skip to content

Instantly share code, notes, and snippets.

@ericmoritz
ericmoritz / provision.sh
Last active August 29, 2015 14:08
vagrant provision for jepsen
aptitude update
aptitude install lxc
SUITE=jessie MIRROR=http://ftp.fr.debian.org/debian lxc-create -n n1 -t debian
SUITE=jessie MIRROR=http://ftp.fr.debian.org/debian lxc-create -n n2 -t debian
SUITE=jessie MIRROR=http://ftp.fr.debian.org/debian lxc-create -n n3 -t debian
SUITE=jessie MIRROR=http://ftp.fr.debian.org/debian lxc-create -n n4 -t debian
SUITE=jessie MIRROR=http://ftp.fr.debian.org/debian lxc-create -n n5 -t debian
cat << EOF > /etc/lxc/dnsmasq.conf
git log --pretty=oneline | awk '{print $1}' | xargs -n 1 git rev-parse --short | python ./namegen.py
def bind(val, f):
if val is None:
return None
else:
return f(val)
def maybeAdd(x, y):
return bind(
x,
lambda x: bind(
ModuleView.extend({
"@context": {
"heroNS": "http://services.gannettdigital.com/vocabs/hero-module#",
"xhtml": "http://www.w3.org/1999/xhtml/vocab#",
"assetNS": "http://services.gannettdigital.com/vocabs/assets#"
"HeroModule": "heroNS:HeroModule",
// linked modules
"assets": "assetNS:assetModule"
"nextButton": "xhtml:next",
LINK_SELECTOR='a[property="http://api.gannettdigital.com/vocab/buildcluster#codeReviewLink"]'
When(/^I visit the index page$/) do
visit ui_url "/"
end
Then(/^I see a code review link$/) do
page.should have_selector LINK_SELECTOR
@gerritLink = find(LINK_SELECTOR)
end
from collections import Mapping, Iterator
from rdflib import URIRef, Graph, Literal, Namespace
import pystache
from pystache.context import ContextStack
import re
RDFS = Namespace(u'http://www.w3.org/1999/02/22-rdf-syntax-ns#')
class GraphDict(Mapping, dict):
for node in dev/*/etc/riak.conf; do
cat $node \
| sed "s/storage_backend = bitcask/storage_backend = leveldb/" \
| sed "s/riak_control = off/riak_control = on/" \
| sed "s/search = off/search = on/" > ${node}.1 \
mv ${node}.1 ${node};
done
@ericmoritz
ericmoritz / Makefile
Last active August 29, 2015 13:57
Weight Matrix using RDF
results.txt:
arq --query weighted-matrix.rq --data weighted-matrix.ttl --data diagram-software.ttl > results.txt
clean:
rm results.txt
@ericmoritz
ericmoritz / .gitignore
Last active August 29, 2015 13:56
memesearch
.venv/
*~
*.pyc