Skip to content

Instantly share code, notes, and snippets.

View farshidce's full-sized avatar

Farshid Ghods farshidce

  • LinkedIn
  • San Francisco
View GitHub Profile
import gevent.monkey
gevent.monkey.patch_all()
import bmemcached
import threading
from threading import Thread
import time
import uuid
@farshidce
farshidce / td
Created December 19, 2016 18:47
SHOVEL_NAME=$1
SRC_URI=$2
SRC_EXCH=$3
ROUTING_KEY=$4
DEST_URI=$5
DEST_EXCH=$6
ACK_MODE=on-confirm
SHOVEL_ARG="{\"src-uri\":\""${SRC_URI}"\", \"src-exchange\": \""${SRC_EXCH}"\", \"src-exchange-key\":\""${ROUTING_KEY}"\", \"dest-uri\":\""${DEST_URI}"\", \"dest-exchange\":\""${DEST_EXCH}"\", \"ack-mode\":\""${ACK_MODE}"\", \"reconnect-delay\": 0, \"prefetch-count\": 34460, \"delete-after\": \""never"\" }"
echo rabbitmqctl set_parameter shovel ${SHOVEL_NAME} """${SHOVEL_ARG}"""
#!/usr/bin/env python
import sys
import os
for key in os.environ.keys():
print("%s %s" % (key, os.environ[key]))
import logging
from stem.messaging import messaging
@farshidce
farshidce / input.json
Created November 11, 2016 20:28
inputjson
{
"files": ["s3://stemqa-sampledata/csv_import/meter_logs/sample_second.csv"],
"options": {"database": "meter_logs", "table":"monitor_data_minute"}
}
using UnityEngine;
using System.Collections;
public class HexaGrid : MonoBehaviour
{
public Material mat;
private Vector3 startVertex;
private Vector3 mousePos;
void Start()
@farshidce
farshidce / centos7kickstarter
Created December 9, 2015 02:17
centos7kickstarter
# CentOS 7.0 kickstart for XenServer
# branch: develop
##########################################
# Install, not upgrade
install
# Install from a friendly mirror and add updates
url --mirrorlist http://mirrorlist.centos.org/?release=7&arch=x86_64&repo=os
repo --name=centos-updates --mirrorlist=http://mirrorlist.centos.org/?release=7&arch=x86_64&repo=updates
'longTermInsulin': {'date': {'75': {'09-07-2015': 22.0,
'09-08-2015': 31.0,
'09-10-2015': 35.0,
'09-11-2015': 31.0,
'09-12-2015': 34.0,
'09-13-2015': 13.0,
'09-14-2015': 32.0,
'09-15-2015': 21.0,
'09-16-2015': 25.0,
'09-17-2015': 34.25,
[{"sex": "f", "age": 47, "days": 1, "state": "South Carolina", "pid": "727-79-4803", "walk": 3.0}, {"sex": "f", "age": 47, "days": 2, "state": "South Carolina", "pid": "727-79-4803", "walk": 6.0}, {"sex": "f", "age": 47, "days": 4, "state": "South Carolina", "pid": "727-79-4803", "walk": 12.0}, {"sex": "f", "age": 47, "days": 5, "state": "South Carolina", "pid": "727-79-4803", "walk": 24.0}, {"sex": "f", "age": 47, "days": 7, "state": "South Carolina", "pid": "727-79-4803", "walk": 30.0}, {"sex": "f", "age": 47, "days": 10, "state": "South Carolina", "pid": "727-79-4803", "walk": 42.0}, {"sex": "f", "age": 47, "days": 14, "state": "South Carolina", "pid": "727-79-4803", "walk": 60.0}, {"sex": "f", "age": 47, "days": 18, "state": "South Carolina", "pid": "727-79-4803", "walk": 66.0}, {"sex": "m", "age": 80, "days": 1, "state": "Vermont", "pid": "758-04-1110", "walk": 2.0999999999999996}, {"sex": "m", "age": 80, "days": 2, "state": "Vermont", "pid": "758-04-1110", "walk": 4.199999999999999}, {"sex": "m", "age":
import os
import random
from threading import Thread
import unittest
from TestInput import TestInputSingleton
import mc_bin_client
import time
import uuid
import logger
import datetime