node.js
qsong
这个作者很懒,什么都没留下…
展开
-
Node.js_Linux安装
介绍linux下的安装,Node在Linux环境下的安装和使用都非常方便,建议在Linux下运行Node,[i]我使用的是Ubuntu[/i] 安装依赖包: [code="java"] sudo apt-get install g++ curl libssl-dev apache2-utils sudo apt-get install git-core [/code] ...原创 2013-06-06 16:31:44 · 67 阅读 · 0 评论 -
node.js child_process operator( after ssh - cd & ls )
[size=large][node.js] [b]child_process [/b][/size] [b]ssh 远程连接之后对远程服务器的操作。[/b] [code="js"] var cp = require('child_process'); var cmd = 'cd /home/xusongqin/ ls -lt > ./q.log'; console.l...原创 2013-11-21 23:03:40 · 180 阅读 · 0 评论 -
node.js child_process simple operctor
[size=large][b][node.js] child_process[/b][/size] Simple Operctor : du -sh /home/xusongqin/ [code="js"] var util = require('util'), spawn = require('child_process').spawn, ls = spaw...原创 2013-11-21 23:16:31 · 53 阅读 · 0 评论 -
node.js child_process simple operctor 2
[size=large][b][node.js] clied_process[/b][/size] simple operctor : ps -ax | grep ssh [code="js"] var spawn = require('child_process').spawn, ps = spawn('ps', ['ax']), grep = sp...原创 2013-11-21 23:17:57 · 68 阅读 · 0 评论 -
ulimit 设置
最近[b]NodeJs[/b]项目经常挂起,后台在日志发现,有一个Error存在: [code="js"] console - Caught exception: Error: accept EMFILE at errnoException (net.js:770:11) at TCP.onconnection (net.js:1030:24) [/code] [...原创 2014-01-01 22:27:21 · 191 阅读 · 0 评论 -
nodejs process uncaughtException
用过Node一段时间之后,发现那些在事件主循环里碰到的异常会导致Node进程退出。在许多应用场景下,特别是对那些希望永不当机的服务器程序来说,这都是不接受的。[b]uncaughtException[/b]事件会提供一个极其暴力的方法来捕获这些异常。它确实是最后一道防线了,但对解决此问题上非常有效果。 [b]示例1[/b] [code="js"] var http = require('ht...原创 2014-04-03 09:41:52 · 250 阅读 · 0 评论 -
(转)nodejs和java中的des/3des加密解密
[b]Java和nodejs中des加解密数据互操作,直接上代码(仅供参考):[/b] [code="js"] var assert = require('assert'); var crypto = require('crypto'); function test_des(param) { var key = new Buffer(param.key); var iv ...原创 2014-04-04 15:23:10 · 963 阅读 · 0 评论 -
nodejs http 发送请求
[b]GET请求[/b] [code="js"] var http = require('http'); var qs = require('querystring'); var data = { a: 123, time: new Date().getTime()};//这是需要提交的数据 var content = qs.stringify(dat...原创 2014-04-26 09:30:30 · 177 阅读 · 0 评论