Skip to content

Instantly share code, notes, and snippets.

View ranman's full-sized avatar
🏠
Working from home

Randall Hunt ranman

🏠
Working from home
View GitHub Profile
@ranman
ranman / checkfiles.py
Last active August 29, 2015 13:56
check files in gridfs sharded cluster
#!/usr/bin/env python2
# this could be parallellized but is probably best left serial
import pymongo
import datetime
import sys
if len(sys.argv) < 2:
print("usage: python {0} <host> <reporting_interval>".format(sys.argv[0]))
sys.exit(1)
@ranman
ranman / 3 days of data
Created March 2, 2014 06:32
My first weekly stats email
101633 keystrokes in 4286 key sequences, 13082 clicks (10276 excluding scroll), 475433 mouse movements
Total time active: 1 days, 14h 3m 23s
Active periods:
2014-02-26 21:48:18 - 08:02:40
2014-02-27 12:50:19 - 15:02:13
2014-02-27 15:32:42 - 18:20:28
2014-02-27 21:34:23 - 22:11:23
2014-02-27 22:53:31 - 00:35:44
@ranman
ranman / gist:9366624
Created March 5, 2014 12:54
my first week of data
⭠ master±⮀~/dev/gitshots⮀ selfstats --back 1 w --ratios 900 --periods 900
189670 keystrokes in 8776 key sequences, 25432 clicks (20295 excluding scroll), 881723 mouse movements
Total time active: 3 days, 0h 58m 54s
Active periods:
2014-02-26 21:48:18 - 08:02:40
2014-02-27 12:50:19 - 15:02:13
2014-02-27 15:32:42 - 18:20:28
2014-02-27 21:34:23 - 22:11:23
@ranman
ranman / keybase.md
Created March 28, 2014 05:06
keybase.md

Keybase proof

I hereby claim:

  • I am ranman on github.
  • I am ranman (https://keybase.io/ranman) on keybase.
  • I have a public key whose fingerprint is D015 94CA 63E9 D6A3 F6C1 661A 2953 1A8B AF58 DA47

To claim this, I am signing this object:

@ranman
ranman / gist:10912277
Created April 16, 2014 17:42
some event data
RandallMacbook(mongod-2.6.0) test> use randall
switched to db randall
RandallMacbook(mongod-2.6.0) randall> db.events.findOne()
{
"_id": ObjectId("530a98b132e9bc07f4000002"),
"date": ISODate("2012-08-02T00:00:00Z"),
"href": "http://www.mongodb.com/presentations/mongodb-toronto-2012/building-applications-with-mongodb",
"loc": {
"coordinates": [
79.4,
var pipeline = [
{'$match': {'name': 'Coffee'}}, // match name
{'$unwind': '$lots'}, // unwind lots
{'$match': {'lots._id': 1}}, // match lot 1
{'$unwind': '$lots.outs'}, // unwind lots.outs
{'$group': {
'_id': '$name',
'sum': {'$sum': '$lots.outs.quantity'}
}}
]
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

##Startup Architecture:

###Use What You Know Prefer technologies you and your team have existing experience with. If you need to use a new technology consult with someone who has experience with it.

###Use Declarative Formats Anything that minimizes the amount of time it takes for a new developer to start being productive is worth doing.

RandallMacbook(mongod-2.6.0) test> db.test.insert({'tags': ['hello', 'world']})
Inserted 1 record(s) in 5ms
WriteResult({
"nInserted": 1
})
RandallMacbook(mongod-2.6.0) test> db.test.insert({'tags': ['hello']})
Inserted 1 record(s) in 1ms
WriteResult({
"nInserted": 1
})
@ranman
ranman / output
Created June 19, 2014 04:25
jenkins slaves
[jenkins@ip-10-150-40-216 zzz-perl-builder]$ pwd
/mnt/jenkins/tools/zzz-perl-builder
[jenkins@ip-10-150-40-216 zzz-perl-builder]$ cat /etc/issue
Amazon Linux AMI release 2014.03
Kernel \r on an \m
[jenkins@ip-10-150-40-216 zzz-perl-builder]$ perl -V
Summary of my perl5 (revision 5 version 16 subversion 3) configuration:
Platform: