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
storage: | |
dbPath: "/data/db" | |
journal: | |
enabled: true | |
systemLog: | |
destination: file | |
path: "/var/log/mongodb.log" | |
logAppend: true | |
timeStampFormat: iso8601-utc | |
processManagement: |
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 | |
# | |
# nginx Startup script for nginx | |
# | |
# chkconfig: - 85 15 | |
# processname: nginx | |
# config: /etc/nginx/nginx.conf | |
# config: /etc/sysconfig/nginx | |
# pidfile: /var/run/nginx.pid | |
# description: nginx is an HTTP and reverse proxy server |
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
yum -y install zlib zlib-devel openssl openssl-devel pcre pcre-devel | |
wget http://nginx.org/download/nginx-1.8.0.tar.gz | |
tar xzvf nginx-1.8.0.tar.gz | |
cd nginx-1.8.0 && ./configure && make |
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
wget http://nginx.org/packages/rhel/6/x86_64/RPMS/nginx-1.8.0-1.el6.ngx.x86_64.rpm | |
rpm -ivh nginx-1.8.0-1.el6.ngx.x86_64.rpm | |
/etc/init.d/nginx start |
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
yum install -y xz git | |
# install iojs | |
wget "https://iojs.org/dist/v2.3.0/iojs-v2.3.0-linux-x64.tar.xz" | |
tar xJvf iojs-v2.3.0-linux-x64.tar.xz | |
mv iojs-v2.3.0-linux-x64 /opt/ | |
ln -s -f /opt/iojs-v2.3.0-linux-x64 /opt/iojs | |
ln -s -f /opt/iojs/bin/node /usr/local/bin/node | |
ln -s -f /opt/iojs/bin/iojs /usr/local/bin/iojs | |
ln -s -f /opt/iojs/bin/npm /usr/local/bin/npm |
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
var fs = require('fs') | |
var file = process.argv[2] | |
console.log(file) | |
var text = fs.readFileSync(__dirname + '/' + file, "utf8") | |
var lines = text.split("\n") | |
var selectStat = {} |
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
var alipayConfig = require('../../config').alipay | |
var request = require('co-request') | |
var fs = require('fs') | |
var alipayPubKey = fs.readFileSync(__dirname + '/../../alipay_certs/alipay_rsa_public_key.pem', 'utf8') | |
var crypto = require('crypto') | |
exports.verifySign = function(params) { | |
if(params.seller_email != alipayConfig.seller_email) | |
return false | |
var paramsToSign = [] |
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
var cluster = require('cluster'); | |
var numCPUs = require('os').cpus().length; | |
if(cluster.isMaster) { | |
console.log('run master, cpus:', numCPUs); | |
// Fork workers. | |
function forkWorkers() { | |
for (var i = 0; i < numCPUs; i++) { | |
var worker = cluster.fork(); | |
worker.on('message', function(msg) { | |
console.log('on message', msg); |
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
using System; | |
using System.Text; | |
/// <summary> | |
/// A class for encrypting and decrypting a string into base64 format which makes it safe for transfer | |
/// between applications. | |
/// | |
/// Reference: | |
/// Based upon the javascript implementation of xxtea by: Chris Veness | |
/// www.movable-type.co.uk/tea-block.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
// golang p2p udp client | |
package main | |
import ( | |
"fmt" | |
"net" | |
"log" | |
"encoding/binary" | |
"encoding/hex" |