Configure proxy authentication to work with Ubuntu Software Center

Go to /etc/apt. Create the file apt.conf if you don’t have it there. Write the following lines there.

Acquire::http::proxy "http://username:password@proxyserver:port/";
Acquire::https::proxy "https://username:password@proxyserver:port/";
Acquire::socks::proxy "socks://username:password@proxyserver:port/";
Acquire::ftp::proxy "ftp://username:password@proxyserver:port/";

Save it. You are done.

Keywords
apt , ubuntu , proxy

References
http://askubuntu.com/questions/77449/how-to-configure-proxy-authentication-to-work-with-ubuntu-software-center

Install MongoDB Community Edition on Ubuntu

sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 0C49F3730359A14518585931BC711F9BA15703C6
echo "deb [ arch=amd64,arm64 ] http://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.4 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.4.list
sudo apt-get update
sudo apt-get install -y mongodb-org
sudo service mongod start
systemctl enable mongod.service

References
https://docs.mongodb.com/manual/tutorial/install-mongodb-on-ubuntu/

Use ExpressJS to Get URL and POST Parameters

GET

// grab the packages we need
var express = require('express');
var app = express();
var port = process.env.PORT || 8080;

// routes will go here

// start the server
app.listen(port);
console.log('Server started! At http://localhost:' + port);
http://example.com/api/users?id=4&token=sdfa3&geo=us
// routes will go here
app.get('/api/users', function(req, res) {
  var user_id = req.param('id');
  var token = req.param('token');
  var geo = req.param('geo');  

  res.send(user_id + ' ' + token + ' ' + geo);
});

POST

npm install body-parser --save
var bodyParser = require('body-parser');
app.use(bodyParser.json()); // support json encoded bodies
app.use(bodyParser.urlencoded({ extended: true })); // support encoded bodies

// POST http://localhost:8080/api/users
// parameters sent with 
app.post('/api/users', function(req, res) {
    var user_id = req.body.id;
    var token = req.body.token;
    var geo = req.body.geo;

    res.send(user_id + ' ' + token + ' ' + geo);
});

References
https://scotch.io/tutorials/use-expressjs-to-get-url-and-post-parameters
http://www.tutorialspoint.com/nodejs/nodejs_express_framework.htm
https://www.npmjs.com/package/body-parser-json