Skip to content

Instantly share code, notes, and snippets.

@jdnichollsc
Last active December 31, 2021 19:32
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jdnichollsc/c9ea3c826ac304c8eb89 to your computer and use it in GitHub Desktop.
Save jdnichollsc/c9ea3c826ac304c8eb89 to your computer and use it in GitHub Desktop.
sudo su
//Check Firewall
ufw status
ufw allow 8080
ufw reload
//Execute node app.js
pm2 start app.js --name "MyNodeApp" -i 0
//Execute npm start
pm2 start npm --name "MyNodeApp" -i 0 -- run start # Enable load-balancer and cluster features
//Delete the service
pm2 delete MyNodeApp
//See all processes (port - pid)
netstat -panut | grep LISTEN
//Kill a process
kill -9 pid
//Install Using a PPA
curl -sL https://deb.nodesource.com/setup_5.x | sudo -E bash -
sudo apt-get install -y nodejs
//Install Git
apt-get install git
clear //Clear console
uname -i //OS Architecture
mkdir mydir //Create folder
rm -r mydir //Remove folder
mv oldname ./newname //Rename folder
cp -r myfolder/* otherfolder/ //Copy folder content
rm -rf * //Remove all folder content
sudo su //Enable root user
chmod -R 777 /www/myApp //Enable all permissions
sudo apt-get install postgresql-common
sudo apt-get install postgresql-9.5 libpq-dev
sudo -u postgres dropdb 'local' //Delete database
sudo -u postgres psql //Access to Shell commands
\password username //Change password
CREATE USER tom WITH PASSWORD 'myPassword';//Create user
\l //list all databases
\c "database" //use database
\q //exit
\dt //show tables
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment