Find us on facebook

Feb 18, 2018

Install and configure mongo db on Ubuntu

1) Find ubuntu version
lsb_release -a

2) Import the public key used by the package management system
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 2930ADAE8CAF5059EE73BB4B58712A2291FA4AD5

3) Create a list file for MongoDB (16.04 LTS ubuntu)
echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.6 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.6.list

4) sudo apt-get update

5) Install latest mongodb packages
sudo apt-get install -y mongodb-org

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

Set user and give read write access to db

use admin

db.createUser({
    user: 'test',
    pwd: 'testpassword',
    roles: [{ role: 'readWrite', db:'admin'}]
})


6) Edit your MongoDB config file. On Ubuntu:
sudo vim /etc/mongod.conf

7) open MongoDB to all IPs
#  bindIp: 127.0.0.1  <- comment out this line

8) Find #security: section and add following
security:
  authorization: 'enabled'

Feb 4, 2018

On npm install @angular/cli - error

error command "/usr/bin/nodejs" "/usr/bin/npm" "install" "-g" "angular-cli"
2041 error cwd /var/www/html/angular
2042 error node -v v0.10.25
2043 error npm -v 1.3.10

rm node

/usr/local/lib
/usr/local/include
/usr/local/bin
/usr/bin




sh: 1: node: Permission denied - on angular cli npm install -g @angular/cli

Short fix


Run this as root

npm config set user 0
npm config set unsafe-perm true
npm install -g @angular/cli