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
CREATE TABLE `tweets` ( | |
`id` varchar(24) NOT NULL DEFAULT '', | |
`created_at` datetime NOT NULL, | |
`user_id` bigint(20) unsigned NOT NULL, | |
`user_name` varchar(128) NOT NULL DEFAULT '', | |
`user_followers` int(11) unsigned NOT NULL, | |
`user_friends` int(10) unsigned DEFAULT NULL, | |
`user_listed` int(10) unsigned DEFAULT NULL, | |
`user_statuses` int(10) unsigned DEFAULT NULL, | |
`user_location` varchar(100) DEFAULT NULL, |
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
Cache-Control: public, max-age=43200 | |
Connection: keep-alive | |
Content-Length: 81443 | |
Content-Type: text/css; charset=utf-8 | |
Date: Sat, 28 Apr 2012 22:37:56 GMT | |
ETag: "flask-1335630896.86-81443-1985555092" | |
Expires: Sun, 29 Apr 2012 10:37:56 GMT | |
Last-Modified: Sat, 28 Apr 2012 16:34:56 GMT | |
Server: nginx/0.7.65 | |
Set-Cookie: session="IZK844h3a4CHUU02CIjgyc08RHM=?lang=Vml0CnAxCi4="; Path=/; HttpOnly |
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
{ | |
spatialtest: { | |
document: { | |
properties: { | |
location: { | |
type: "geo_point" | |
}, | |
title: { | |
type: "string" | |
} |
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
# encoding: utf-8 | |
""" | |
A simple development webserver for the console that features | |
throttling (if enabled by -t) and ignores query strings. | |
""" | |
import SimpleHTTPServer | |
import SocketServer | |
import os |
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
import tweetstream | |
from pymongo import MongoClient | |
# look for these words: | |
WORDS = ['word1', 'word2'] | |
TWITTER_USER = "" | |
TWITTER_PASS = "" | |
MONGO_DB = 'tweetstream' |
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
# This is a sloppy HTTP server version of TextCat, an n-gram based natural language guesser | |
# written by Gertjan van Noord in 1997. | |
# More info: http://odur.let.rug.nl/~vannoord/TextCat/ | |
# | |
# TextCat was distributed under the GNU Lesser General Public License. | |
# | |
# You need the language model files (LM folder from Gertjan's distribution) in a directory. | |
# Set the variable $opt_d to point to that directory. | |
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
2013-05-21 21:32:20,681 INFO org.apache.hadoop.hdfs.server.datanode.DataNode.clienttrace: src: /127.0.0.1:50010, dest: /127.0.0.1:50144, bytes: 1777, op: HDFS_READ, cliID: DFSClient_attempt_201305152304_0004_m_000000_1_722979034_1, offset: 0, srvID: DS-2043951618-192.168.0.102-50010-1368635777558, blockid: blk_-4766979604280382827_1040, duration: 240000 | |
2013-05-21 21:32:20,804 INFO org.apache.hadoop.hdfs.server.datanode.DataNode.clienttrace: src: /127.0.0.1:50010, dest: /127.0.0.1:50145, bytes: 7517, op: HDFS_READ, cliID: DFSClient_attempt_201305152304_0004_m_000000_1_722979034_1, offset: 0, srvID: DS-2043951618-192.168.0.102-50010-1368635777558, blockid: blk_3289312915423223722_1003, duration: 736000 | |
2013-05-21 21:35:59,387 INFO org.apache.hadoop.hdfs.server.datanode.DataNode: Receiving block blk_-4719156887958776590_1064 src: /127.0.0.1:50215 dest: /127.0.0.1:50010 | |
2013-05-21 21:35:59,486 INFO org.apache.hadoop.hdfs.server.datanode.DataNode.clienttrace: src: /127.0.0.1:50215, dest: /127.0.0.1:50010, bytes: |
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
""" | |
Untested version of some job queue | |
Usage: | |
from pymongo import MongoClient | |
db = MongoClient() | |
queue = Queue("myqueue", db) | |
job = { | |
'key': 'foobar', |
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
import cPickle | |
import pickle | |
import json | |
import random | |
from time import time | |
from hashlib import md5 | |
test_runs = 1000 | |
def float_list(): |
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
import socket | |
import socks # pip install PySocks - https://github.com/Anorov/PySocks | |
# configure default proxy. 9150 is the Tor Browser Bundle socks proxy port | |
socks.set_default_proxy(socks.SOCKS5, "127.0.0.1", 9150) | |
socket.socket = socks.socksocket | |
import urllib | |
print(urllib.urlopen('http://icanhazip.com').read()) |