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
connections: 0 , { rss: 22384640, heapTotal: 17603072, heapUsed: 6524368 } | |
connections: 0 , { rss: 22384640, heapTotal: 17603072, heapUsed: 6534520 } | |
connections: 0 , { rss: 22650880, heapTotal: 18635008, heapUsed: 6953704 } | |
connections: 139 , { rss: 79593472, heapTotal: 67523328, heapUsed: 26051152 } | |
connections: 0 , { rss: 104742912, heapTotal: 84034304, heapUsed: 10260752 } | |
connections: 0 , { rss: 118939648, heapTotal: 92289792, heapUsed: 12206688 } | |
connections: 509 , { rss: 210677760, heapTotal: 182068224, heapUsed: 159576936 } | |
connections: 967 , { rss: 250638336, heapTotal: 220213760, heapUsed: 193033608 } | |
connections: 800 , { rss: 151580672, heapTotal: 123805496, heapUsed: 92558320 } | |
connections: 1052 , { rss: 267845632, heapTotal: 239911224, heapUsed: 206812720 } |
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 net=require('net'); | |
var requestLine=new Buffer( | |
'GET / HTTP/1.1\r\n'+ | |
'Host: localhost\r\n'+ | |
'Connection: keep-alive\r\n\r\n'); | |
var sockets=[],n=200; | |
for(var i=0;i<n;i++){ | |
var socket=net.connect(3000); | |
socket.on('error',function(err){ | |
console.log(err); |
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 mongoose = require('mongoose'); | |
//cnode的2.4.1版mongoose的poolSize为1,同步这个设定 | |
mongoose.connect('mongodb://localhost/test',{server:{poolSize:1}}); | |
var ObjectId=mongoose.Schema.ObjectId; | |
var User = mongoose.model('User', mongoose.Schema({ | |
name: { type: String} | |
})); | |
var Topic = mongoose.model('Topic', mongoose.Schema({ | |
title: { type: String }, | |
content: { 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
// auto generated mapping table, big5 ==> unicode | |
var iconv=require('iconv-lite') | |
var encoding='big5',_encoding=encoding.replace(/[- ]/g,'') | |
/** | |
* set aliase name for big5 | |
* for big5, iconv.encoding['cp950']=_encoding | |
*/ | |
//iconv.encodings['aliase1']=_encoding | |
//iconv.encodings['aliase2']=_encoding | |
iconv.encodings[encoding]=_encoding |
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 sys,os,string,random | |
if len(sys.argv)==1: | |
print 'warn: encoding name missing' | |
print 'python %s <encoding name>'%(os.path.basename(__file__)) | |
sys.exit(0) | |
encoding=sys.argv[1] | |
charset={} | |
n=0xff+1#skip 0x00-0xFF | |
while n<0xfffd: |
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 net=require('net'), | |
express = require('express'), | |
app = express(); | |
app.get('*', function(req,res){ | |
var filename='中文名.js'; | |
//filename=new Buffer(filename).toString('binary'); | |
console.log('before download: %s',unicode(filename)); | |
res.download(__filename,filename); | |
}); |
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
ffmpeg -y -i v1.wmv -r 30000/1001 -aspect 16:9 -b:v 1150k -bt 2300k -vcodec libx264 -pass 2 -threads 2 -ss 00:02:18 -t 30 -acodec libfaac -ac 2 -ar 44100 -ab 128k -profile:v main -tune fastdecode v.mp4 | |
-vcodec libx264 -crf 20 -threads 2 -r 24000/1001 -acodec libmp3lame -ac 2 -ar 44100 -ab 128k -y -s 800:450 -aspect 16:9 kyou01.avi | |
-vcodec libx264 -crf 20 -threads 2 -r 24000/1001 -y -aspect 16:9 -s 800:450 -profile:v high -tune psnr -acodec libfaac -ac 2 -ar 48000 -ab 128k | |
-vcodec libx264 -crf 20 -threads 2 -r 24000/1001 -y -aspect 16:9 -s 960:540 -profile:v high -tune fastdecode -acodec libfaac -ac 2 -ar 48000 -ab 128k | |
-c:v libx264 -crf 21 -profile:v main -threads 2 -r 24000/1001 -c:a libmp3lame -ac 2 -ar 44100 -ab 128k -y -s 720:540 -aspect 4:3 |