This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
# Connects to localhost, 27017 by default | |
import sys | |
import pymongo | |
import time | |
if len(sys.argv) < 2: | |
print >> sys.stderr, "Usage: ./tail_profile.py <dbName> [hostname] [port]" | |
sys.exit(-1) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function parse_git_branch { | |
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/' | |
} | |
GREEN="\[\033[1;32m\]" | |
YELLOW="\[\033[1;33m\]" | |
WHITE="\[\033[0;0m\]" | |
PS1="[\u@\h [$GREEN\W$YELLOW\$(parse_git_branch)$WHITE]\$ " |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Pageview/click analytics in Cassandra? | |
pageAnalytics = { | |
"come.foo/index.html" : { // super column family | |
"pageviews": { // Super Column family | |
"someuuid" : {"cookie": "OH HAI", "url": "come.foo/index.html", "layout": 47, "ip": "1.2.3.4"}, | |
"someuuid2" : {"cookie": "OH HAI", "url": "come.foo/index.html", "layout": 47, "ip": "1.2.3.4"}, | |
}, | |
"clicks": { // Super Column family | |
"someuuid" : {"cookie": "OH HAI", "target": "http://interiorcrocodilealligator.com/", "layout": 47, "ip": "1.2.3.4", "x" : 120, "y": 375}, |