Saving a million documents in Mongo using Nodejs and mongodb module

/** * Created by davidsaliba on 13/03/2017. */ var MongoClient = require('mongodb').MongoClient , format = require('util').format; var url = 'mongodb://localhost:27017/test'; var async = require ('async'); var entry = { data : "skdlfjsdf", array : [ {id:"arr_obj1"} , {id:"arr_obj2"} ] }; var entries = []; var total_entries = 1000000 for (var j = 0 ; j…

Install node.js on Centos 6.8

Epel’s yum install does not cut it anymore at time of writing installing node.js causes a mass of 404s and file not found.   current best approach : Enterprise Linux and Fedora Including Red Hat® Enterprise Linux® / RHEL, CentOS and Fedora. Node.js is available from the NodeSource Enterprise Linux and Fedora binary distributions repository….

Installing node on Fedora 22

yum install gcc-c++ make openssl-devel   Install from Source code : wget http://nodejs.org/dist/v0.8.15/node-v0.8.15.tar.gz tar zxvf node-v0.8.15.tar.gz cd node-v0.8.15 ./configure make make install Install from GIT repository yum install git git clone git://github.com/joyent/node.git cd node ./configure make make install   nJoy 😉  

Node.js and Express with HTTPS

Quoting from the doco + some missing stuff: var express = require('express'); var https = require('https'); var http = require('http'); var app = express(); var fs = require('fs'); var options = { key: fs.readFileSync('test/fixtures/keys/agent2-key.pem'), cert: fs.readFileSync('test/fixtures/keys/agent2-cert.pem') }; http.createServer(app).listen(80); https.createServer(options, app).listen(443); nJoy 😉