Skip to content

Instantly share code, notes, and snippets.

View notmyname's full-sized avatar

John Dickinson notmyname

View GitHub Profile

Keybase proof

I hereby claim:

  • I am notmyname on github.
  • I am notmyname (https://keybase.io/notmyname) on keybase.
  • I have a public key whose fingerprint is 6A86 657F C8CF 99F7 8D8C C86A F0E7 F736 6D92 3037

To claim this, I am signing this object:

@notmyname
notmyname / gist:8552219
Last active January 4, 2016 01:59
Set up OpenStack gate graph on your desktop with GeekTool.
One time only (or whenever you change the graph definition), run build_page.py from
<https://github.com/notmyname/gate_status>. This creates simple_graph_url, a graphite URL to
generate the gate status graph. Then create grab_gate_image.sh somewhere in your $PATH and add
the cronjob. Finally add an image to GeekTool to load /tmp/gate_graph.png and set it to
refresh as often as you run the cronjob. I added the image at 80% opacity.
grab_gate_image.sh
------------------
#!/bin/sh
@notmyname
notmyname / gist:8225201
Created January 2, 2014 19:36
generator example
def foo():
print 'in foo'
yield 'bar'
x = foo()
print 'start'
for i in x:
print i
print 'done'
@notmyname
notmyname / commit-msg
Created December 29, 2013 21:01
A git commit message hook that will process tags and do stuff with them according to a local config file.
#!/usr/bin/env python
#
# An commit-msg hook script that parses commit message tags and does stuff.
#
#
"""
====
Tags
@notmyname
notmyname / gist:7494398
Created November 16, 2013 00:57
download a file slowly. use a IMB file
#!/usr/bin/env python
from httplib import HTTPConnection as Connection
import time
import sys
# send data
conn = Connection('saio:8080') # example.com:8090
conn.request('GET', '/v1/AUTH_test/c/big', headers={})
resp = conn.getresponse()
@notmyname
notmyname / theme.js
Last active December 27, 2015 03:39
Javascript to put the topic at the top of the window in LimeChat. Name this file <Theme>.js, where "<Theme>" is replaced by the name of the theme you are using. Put the file into your LimeChat themes folder (there's a button to open this folder in the LimeChat preferences). Originally from https://github.com/gholt/tcod/blob/master/LimeChat%20The…
function processLine(e) {
var line = e.target;
switch (line.getAttribute("_type")) {
case "reply":
case "topic":
var textnode = line.lastChild.firstChild;
if (textnode.nodeValue.substr(1, 5) == "opic:" ||
textnode.nodeValue.indexOf("has set topic:") >= 0) {
var newdiv = document.createElement("div");
newdiv.setAttribute("id", "thetopic");
@notmyname
notmyname / gist:6032928
Created July 18, 2013 20:46
git config settings
$ git config --list
credential.helper=osxkeychain
user.name=John Dickinson
user.email=me@not.mn
color.ui=always
alias.st=status
alias.ci=commit
alias.co=checkout
alias.staged=diff --cached
alias.unstaged=diff
diff --git a/doc/source/overview_replication.rst b/doc/source/overview_replication.rst
index 2db17d5..4d3803a 100644
--- a/doc/source/overview_replication.rst
+++ b/doc/source/overview_replication.rst
@@ -2,48 +2,118 @@
Replication
===========
-Since each replica in swift functions independently, and clients generally require only a simple majority of nodes responding to consider an operation successful, transient failures like network partitions can quickly cause replicas to diverge. These differences are eventually reconciled by asynchronous, peer-to-peer replicator processes. The replicator processes traverse their local filesystems, concurrently performing operations in a manner that balances load across physical disks.
-
@notmyname
notmyname / gist:4946922
Created February 13, 2013 18:33
how 2 python?
def foo(x, y=None, *a, **kw):
print '%r, %r, %r, %r' % (x, y, a, kw)
foo(1)
foo(1, 2)
foo(1, 2, 3, 4, 5, bar=6)
foo(1, 2, y=3) # want: 1, 3, (2,), {}
john@openslice:~/swift$ rm -r .tox
john@openslice:~/swift$ tox
____________________________________________________________________ [tox sdist] _____________________________________________________________________
[TOX] ***creating sdist package
[TOX] /home/john/swift$ /usr/bin/python setup.py sdist --formats=zip --dist-dir .tox/dist >.tox/log/0.log
[TOX] ***copying new sdistfile to '/home/john/.tox/distshare/swift-1.7.3.zip'
Traceback (most recent call last):
File "/usr/local/bin/tox", line 9, in <module>
load_entry_point('tox==1.3', 'console_scripts', 'tox')()
File "/usr/local/lib/python2.6/dist-packages/tox/_cmdline.py", line 19, in main