sudo command with no password in linux!

Created at: 2019-09-09 01:17:18 Updated at: 2019-11-01 03:04:04

in Linux

How to avoide repetation of sudo command in linux.

Just follow bellow steps to avoide repation.

Create file or edit if exist

sudo visudo -f /etc/sudoers.d/90-cloudimg-ubuntu

Change username as per your suite

# ubuntu user is default user in cloud-images.
# It needs passwordless sudo functionality.
ubuntu ALL=(ALL) NOPASSWD:ALL

npm permission issue

Created at: 2019-11-01 03:00:29 Updated at: 2019-11-01 03:00:46

in Linux

This is general solutions for all kind of npm permission issue.

sudo chown -R $USER ~/.npm
sudo chown -R  $USER /usr/bin/npm
sudo chown -R  $USER /usr/lib/node_modules/
chmod -R a+x node_modules

Linux golden commands

Created at: 2019-09-23 13:56:17 Updated at: 2019-10-28 12:50:23

in Linux

Kill any process using port

USE THIS COMMAND ON YOUR OWN RISK !

sudo kill -9 $(sudo lsof -t -i:4200)

If you want to check that if process running than and than kill the process , use bellow one

if sudo lsof -t -i:4200; then sudo kill -9 $(sudo lsof -t -i:4200); fi

Above command will check that process is running than kill by process id.