Skip to content

Instantly share code, notes, and snippets.

View mattbillenstein's full-sized avatar

Matt Billenstein mattbillenstein

View GitHub Profile
$ sudo /tve/bin/salt '*' mine.get 'I@roles:mongod_master' network.interfaces
local.umt.io:
----------
$ sudo /tve/bin/salt '*' match.pillar 'roles:mongod_master'
local.umt.io:
True
data = salt['mine.get']('*', 'grains.items')
master = [k for k, v in pillar['roles'].iteritems() if 'mongod_master' in v][0]
mongo_ip = [_ for _ in data[master]['ipv4'] if not _.startswith('127.')][0]
Initial Question: How did I get signed up for this shit?1::My Account:::2::Cancel my membership:::3::Change or cancel my membership:::
03:33 AM PDT Jermain(Audible): Thank you for contacting Audible. My name is Jermain and I will be assisting you today. How may I help you?
03:34 AM PDT Matt Billenstein: I want to know how I got signed up for this $14.95 membership thing
I've apparently been paying for this for 17 months and didn't realize it
that's $250 bucks
I want this refunded immediately
03:34 AM PDT Jermain: For security purposes, I need you to verify some information. Please provide your name, the e-mail address and the billing address associated with your Audible.com account.
03:35 AM PDT Matt Billenstein: Matt Billenstein matt@xxx.com 1234 xxxx St Apt 4, SF, CA 12345
03:36 AM PDT Jermain: Thank you for that information Matt.
X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on vazor.com
X-Spam-Flag: YES
X-Spam-Level: ******
X-Spam-Status: Yes, score=6.6 required=6.0 tests=FREEMAIL_FORGED_REPLYTO,
HTML_IMAGE_ONLY_32,HTML_MESSAGE,LONG_IMG_URI,MIME_HTML_ONLY,T_DKIM_INVALID
> db.yt_video_ts3.find()
{ "_id" : ObjectId("57682e87ced89007a1aa9f71"), "id" : "---0savA9eY", "ts" : ISODate("2016-06-03T02:35:39.049Z"), "v" : { "viewCount" : 2016, "likeCount" : 1, "commentCount" : 2 } }
{ "_id" : ObjectId("57682e87ced89007a1aa9f72"), "id" : "---0savA9eY", "ts" : ISODate("2016-06-05T14:27:29.732Z"), "v" : { "viewCount" : 2017, "likeCount" : 1, "commentCount" : 2 } }
{ "_id" : ObjectId("57682e87ced89007a1aa9f73"), "id" : "---8lKLb9gI", "ts" : ISODate("2016-06-08T03:44:39.079Z"), "v" : { "viewCount" : 2 } }
{ "_id" : ObjectId("57682e87ced89007a1aa9f74"), "id" : "---9l91bzWg", "ts" : ISODate("2016-06-08T03:51:07.494Z"), "v" : { "viewCount" : 34, "likeCount" : 1 } }
{ "_id" : ObjectId("57682e87ced89007a1aa9f75"), "id" : "---AwsK8TGg", "ts" : ISODate("2016-06-03T02:30:22.917Z"), "v" : { "viewCount" : 764, "likeCount" : 23, "commentCount" : 1 } }
{ "_id" : ObjectId("57682e87ced89007a1aa9f76"), "id" : "---AwsK8TGg", "ts" : ISODate("2016-06-04T02:27:58.404Z"), "v" : { "viewCount" : 766, "likeCount
#!/usr/bin/env python2
import graphene
import logging
logging.basicConfig(level=logging.ERROR)
logger = logging.getLogger()
logger.addHandler(logging.StreamHandler())
class Tea(graphene.ObjectType):
@mattbillenstein
mattbillenstein / gist:7baa1d0d006cf6981942
Last active May 23, 2016 12:08
gevent streamer thingy
#!/usr/bin/env python
import gevent.monkey
gevent.monkey.patch_all()
import gevent
import random
import time
from gevent.event import Event
@mattbillenstein
mattbillenstein / gist:6981183
Created October 14, 2013 19:54
gnuplot a csv...
mattb@mattb-mbp:~ $ head infile.csv
elapsed,spent,price
0.127883,0.115402,6.552
0.128115,0.115402,7.207
0.128346,0.116246,7.927
0.128578,0.116246,8.719
0.128809,0.118902,8.806
0.129041,0.119576,8.894
0.129272,0.120159,8.982
0.129504,0.120817,9.071
@mattbillenstein
mattbillenstein / gist:6216454
Created August 12, 2013 23:42
bmemcached creates a new server connection on every request
mattb@mattb-mitx:~ $ sudo /etc/init.d/memcached restart
Restarting memcached: memcached.
mattb@mattb-mitx:~ $ cat test_bmemcached.py
#!/usr/bin/env python
import bmemcached
import time
c = bmemcached.Client()
#!/usr/bin/env python
import sys
import zlib
import bz2
BLOCK_SIZE = 1024*1024
def main():
size = 0