Skip to content

Instantly share code, notes, and snippets.

View mambocab's full-sized avatar

Jim Witschey mambocab

  • Rapid7
  • Reston, VA
  • 11:47 (UTC -04:00)
View GitHub Profile
@mambocab
mambocab / works from outside tmux window:
Last active August 29, 2015 14:09
Thanks for `selecta`, it is awesome.
tmux list-sessions | cut -f 1 -d':' - | selecta | xargs tmux switch -t
[
{
"caption": "Git: Failing Commit",
"command": "git_custom",
"args": {
"cmd": " commit",
"syntax": "Packages/Python/Python.tmLanguage"
}
}
]
@mambocab
mambocab / api-feedback.md
Last active August 29, 2015 14:12
Timer Wrapper Feedback!

I'd like some feedback on this li'l thing. If you want to have a look, the source is here, but I'm more interested in help on the API and naming stuff, so don't worry about that unless you want to!

I've written a wrapper for timeit.Timer. It behaves a lot like the command line python -m timeit ... interface, but makes comparison easier by providing a Python API for specifying functions to compare and arguments to use.

python -m timeit -s 'import my_function' 'my_function(10)'

You specify 10 as the arguments to the function and decorate my_function with the provided decorator. When you run the comparisons, it prints a little table showing the results.

@mambocab
mambocab / readme.md
Last active August 29, 2015 14:15
3rd failure

Another failure on TestPutGet. Same VM, but with memory increased to 4GB.

@mambocab
mambocab / notes.md
Created March 11, 2015 15:20
notes on getting cqlshlib tests running

I got the tests to run with this commit:

https://github.com/mambocab/cassandra/commit/a6562212d56a1054b71883ff7e212fb9c90f7243

I had to manually use ccm to spin up a cluster to test against. As part of getting this running for CI, we might start using ccmlib.

4 of the tests fail:

https://gist.githubusercontent.com/anonymous/046488dcd25f4cd056ee/raw/458be8ee562372d6ba52a32626fce24506b9760d/testout.txt.........................................................................F..F..F.......F.................
def nan_infinity_test(self):
cursor = self.prepare()
cursor.execute("CREATE TABLE test (f float PRIMARY KEY)")
cursor.execute("INSERT INTO test(f) VALUES (NaN)")
cursor.execute("INSERT INTO test(f) VALUES (-NaN)")
cursor.execute("INSERT INTO test(f) VALUES (Infinity)")
cursor.execute("INSERT INTO test(f) VALUES (-Infinity)")
@mambocab
mambocab / patched c*, patched tests, trunk
Last active August 29, 2015 14:16
(WIP) dtest #179 and C* #7816 review

unpatched cassandra, unpatched tests

  • fails on trunk

patched cassandra, unpatched tests

  • fails on trunk (DISABLE_VNODES=true CASSANDRA_DIR=~/cstar_src/7816-fixes/cassandra-trunk-patched nosetests pushed_notifications_test.py)
# from https://github.com/SegFaultAX/tmux-dotfiles/blob/master/tmux.conf
bind -n S-Left previous-window
bind -n S-Right next-window
# with thanks to thoughtbot
bind h select-pane -L
#!/usr/bin/env sh
usage() { echo "usage: `basename $0` <yo username>" ; }
if [ -z "$YO_API_KEY" ] ; then
echo "No YO_API_KEY in environment."
echo "Get a key from https://dev.justyo.co/"
usage
exit 1
fi
@mambocab
mambocab / gist:f5b3679208a3a4f97d7b
Created June 8, 2015 13:27
durable_writes complaint
(06:13:50 PM) Fredderf: Might have found a bug in 2.1.3 and same behaviour in 2.1.5 but have only debugged 2.1.3. Setting durable_writes on a keyspace is only applied after a restart. When mutations for a column family is about to be applied, the cached instance of the keyspace metadata is read. But the schema mutation for durable_writes hasn't been applied to this cached instance. Anyone knows if this is a known issue?
(06:15:07 PM) snair: Adding a DC cayused Cannot achiecve conistency level one
(06:15:10 PM) snair: eon all nodes
(06:15:12 PM) snair: oplease helpo
(06:15:15 PM) snair: production
(06:15:29 PM) snair: stopped the 3 node cassandra cluster
(06:23:08 PM) weiz2: rcoli: thobbs: according to this http://docs.datastax.com/en/cassandra/2.0/cassandra/tools/toolsDecommission.html, Descriptionhttp://docs.datastax.com/en/cassandra/2.0/cassandra/tools/toolsDecommission.html?scroll=toolsDecommission__description_unique_6
(06:23:08 PM) weiz2: Causes a live node to decommission itself, streaming its data to t