This sheet goes along with this SSH YouTube tutorial
$ ssh brad@192.168.1.29
$ mkdir test
$ cd test
$ ssh brad@192.168.1.29
$ mkdir test
$ cd test
| sudo su && | |
| yum update -y && | |
| yum install -y httpd.x86_64 && | |
| systemctl start httpd.service && | |
| systemctl enable httpd.service && | |
| curl localhost:80 && | |
| echo "change security group inbound rules to http" && | |
| echo "hello world " > /var/www/html/index.html |
| const isCallback=false; | |
| const isCallbackError= false; | |
| testCallback=(callback, errCallback)=>{ | |
| if(isCallback){ | |
| callback({ | |
| success:true, | |
| message:`callback success` | |
| }) | |
| }else if (isCallbackError){ |
| # Find the latest version on https://github.com/creationix/nvm#install-script | |
| $ curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh | bash | |
| # Add in your ~/.zshrc the following: | |
| export NVM_DIR=~/.nvm | |
| [ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" | |
| $ source ~/.zshrc |
| # Redis Cheatsheet | |
| # All the commands you need to know | |
| redis-server /path/redis.conf # start redis with the related configuration file | |
| redis-cli # opens a redis prompt | |
| # Strings. |
| const express = require('express'); | |
| const fetch = require('node-fetch'); | |
| const redis = require('redis'); | |
| const PORT = process.env.PORT || 5000; | |
| const REDIS_PORT = process.env.PORT || 6379; | |
| const client = redis.createClient(REDIS_PORT); | |
| const app = express(); |
Steps to deploy a Node.js app to DigitalOcean using PM2, NGINX as a reverse proxy and an SSL from LetsEncrypt
If you use the referal link below, you get $10 free (1 or 2 months) https://m.do.co/c/5424d440c63a
I will be using the root user, but would suggest creating a new user