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
#!/bin/sh | |
# mongodb部署脚本 | |
# https://gist.github.com/chappy84/4400325/download# | |
# diggzh 2015/7/2 | |
# MongoDB Version | |
MONGODB_DISC='linux-x86_64' | |
MONGODB_VER='3.0.4' | |
TAR_TGZ='tgz' |
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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
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
# -*- coding: utf-8 -*- | |
__author__ = 'ronfe' | |
import os | |
from pymongo import MongoClient, DESCENDING | |
from bson.objectid import ObjectId | |
from bson.son import SON | |
import datetime | |
import threading |
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
# _*_ coding: utf8 _*_ | |
from pymongo import MongoClient | |
from bson.objectid import ObjectId | |
import datetime | |
# link to db | |
dbClient = MongoClient('mongodb://localhost:27017') | |
db = dbClient['yangcong-prod25'] |
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 psutil,datetime | |
def printLine(): | |
print('----------------') | |
printLine() | |
print('CPU:') | |
print(str(psutil.cpu_times())) | |
printLine() |
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
# _*_ coding: utf8 _*_ | |
from pymongo import MongoClient | |
from bson.objectid import ObjectId | |
import datetime | |
# link to db | |
dbClient = MongoClient('mongodb://localhost:27017') | |
db = dbClient['yangcong-prod25'] |
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
# -*- coding: utf-8 -*- | |
import sys | |
import os | |
import time | |
url_list = [ | |
"http://vs.yangcong345.com/三角形的高.html", | |
"http://vs.yangcong345.com/三角形的高.html", | |
"http://vs.yangcong345.com/三角形的高.html", | |
] |
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
DBCollection.prototype.sample = function () { | |
return this.find(); | |
} | |
DBCollection.prototype.onedoc = function (userId) { | |
return this.findOne({"_id": ObjectId(userId)}); | |
} | |
DBCollection.prototype.pipeline = function (pipeline) { | |
return this.find(pipeline); |
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
# _*_ coding:utf-8 _*_ | |
# 1. 遍历httplogs, 读取到每一条doc | |
# 2. 根据doc的 url + method 判断该发那个埋点 传入到转发器 | |
# 3. 转发器根据不同情况的埋点生成一个eventObj出来 | |
# 4. save to db add one del one | |
from pymongo import MongoClient | |
import datetime | |
import time | |
import jwt | |
import IP |
OlderNewer