This file contains hidden or 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 pandas as pd | |
from pymongo import MongoClient | |
# set connection with mongodb | |
def _connect_mongo(host, port, username, password, db): | |
""" A util for making a connection to mongo """ | |
if username and password: | |
mongo_uri = 'mongodb://%s:%s@%s:%s/%s' % (username, password, host, port, db) | |
conn = MongoClient(mongo_uri) |
This file contains hidden or 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
# Elastic configs | |
es_read_conf = { | |
"es.nodes" : "localhost", | |
"es.port" : "9200", | |
"es.resource" : "twitter/tweet" | |
} | |
es_write_conf = { | |
"es.nodes" : "localhost", | |
"es.port" : "9200", |
This file contains hidden or 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
# Elastic configs | |
es_read_conf = { | |
"es.nodes" : "localhost", | |
"es.port" : "9200", | |
"es.resource" : "twitter/tweet" | |
} | |
es_write_conf = { | |
"es.nodes" : "localhost", | |
"es.port" : "9200", |
This file contains hidden or 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
package main | |
import ( | |
"flag" | |
"fmt" | |
) | |
var hostName = flag.String("host", "localhost", "Hostname or IP you want to run this service on") | |
var portNumber = flag.Int("port", 8080, "Port you want this service to listen on (default 8080)") |
This file contains hidden or 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
sed -i "s/{{hostname}}/`hostname`/g" /etc/supervisor/conf.d/celeryd.conf |
This file contains hidden or 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 commands | |
import time | |
import sys | |
from socket import socket | |
import argparse | |
import os | |
import pymongo | |
from pymongo import Connection | |
import yaml |
NewerOlder