Last active
December 31, 2021 19:32
-
-
Save jdnichollsc/c9ea3c826ac304c8eb89 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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