Skip to content

Instantly share code, notes, and snippets.

View cdimartino's full-sized avatar

Chris DiMartino cdimartino

View GitHub Profile
@cdimartino
cdimartino / pomodoroscript.scpt
Created July 24, 2012 04:49 — forked from puttiz/pomodoroscript.scpt
Things integrate with Pomodoro
-- End : Marking to-dos completed
tell application "Things"
tell list "Today"
set toDoToComplete to to do named "$pomodoroName"
set status of toDoToComplete to completed
set tag names of toDoToComplete to "⌘,✔"
end tell
move toDoToComplete to list "Next"
end tell
@cdimartino
cdimartino / bdd.vim
Created August 31, 2012 14:33
Run RSpec and Cucumber from vim, on the current spec/feature
" Vim functions to run RSpec and Cucumber on the current file and optionally on
" the spec/scenario under the cursor.
function! RailsScriptIfExists(name)
" Bundle exec
if isdirectory(".bundle") || (exists("b:rails_root") && isdirectory(b:rails_root . "/.bundle"))
return "bundle exec " . a:name
" System Binary
else
return a:name
@cdimartino
cdimartino / gist:3828379
Created October 3, 2012 17:11
Timery Search
<pseudo code>
timer = nil
onkeyup:
canceltimer timer
settimer timer +1s dosearch
</pseudo code>
# rbenv setup
export RBENV_ROOT=/usr/local/rbenv
export PATH="$RBENV_ROOT/bin:$PATH"
eval "$(rbenv init -)"
Wowza!
@cdimartino
cdimartino / -
Created May 15, 2013 03:29
Cassandra rsync hard-link snapshot retention
[1] 23:28:06 [SUCCESS] ec2-174-129-110-52.compute-1.amazonaws.com
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/lvm--raid--0-lvm0 2.0T 1.4T 583G 71% /mnt/cassandra_snapshots
316G /mnt/cassandra_snapshots/full/20130508
29G /mnt/cassandra_snapshots/full/20130509
36G /mnt/cassandra_snapshots/full/20130510
319G /mnt/cassandra_snapshots/full/20130512
50M /mnt/cassandra_snapshots/full/20130513
17G /mnt/cassandra_snapshots/full/20130514
9.2G /mnt/cassandra_snapshots/full/20130515
#!/bin/sh
# This will allow you to rebalance the Cassandra ring
# Accepts hosts from stdin and automatically rebalances
# tokens in your ring.
#
# $ echo "one two three" | ./rebalance.sh
RING_SIZE=$(echo "2^127" | bc)
#!/bin/sh
# This will allow you to rebalance the Cassandra ring
# Accepts hosts from stdin and automatically rebalances
# tokens in your ring.
#
# $ echo "one two three" | ./rebalance.sh
RING_SIZE=$(echo "2^127" | bc)
HOSTS=$(cat $1 | sed 'N;s/\n/ /')
@cdimartino
cdimartino / rebalance.sh
Created May 16, 2013 20:30
Quick and dirty rebalancing of Cassandra cluster.
#!/bin/sh
# This will allow you to rebalance the Cassandra ring
#
# $ ./rebalance.sh file_of_hosts
RING_SIZE=$(echo "2^127" | bc)
HOSTS=$(cat $1 | sed 'N;s/\n/ /')
HOST_NUM=$(echo $HOSTS | wc -w)
INDEX=0
28 items found
i-e4cd329a:
roles:
place_directory_cassandra
new_base_default
new_base
new_base_ubuntu
new_base_users
new_base_monitored