Smarthome Server Config

AWS address
https://us-west-2.console.aws.amazon.com/ec2/v2/home?region=us-west-2#Instances:sort=dnsName



my personal ip address.
public 50.252.213.84
local 10.1.10.120
raspberrypi local ehternet: 169.254.100.189
Amazon Web Service address:
ec2-52-40-177-51.us-west-2.compute.amazonaws.com


remote control xrdp
username : pi
password : raspberry


Openshift
http://nodejs-mongo-persistent-smarthome.44fs.preview.openshiftapps.com
server : 172.30.7.242
mongoDB : 172.30.65.11

with ethernet cable
find MAC address.
nmap -sP 169.254.0/24
or
arp -a


transfering files
install PuTTY.
pscp c:\SmartHome.java pi@raspberry:/pi/home/Desktop

pscp c:\SmartHome.java pi@(ip address):/pi/home/Desktop

-scp : force use of SCP protocol
-r : copy directory
-i key : private key file for user authentication.

pscp -scp -r -i C:\Users\DonYoo\Desktop\BU\
SmartHome/AWS_Don_Putty_Key.ppk C:\Users\DonYoo\Desktop\BU\SmartHome\js ec2-user
@ec2-52-40-177-51.us-west-2.compute.amazonaws.com:/home/ec2-user/SmartHome/


base on Yum (Aws)

install nodejs and npm
curl --silent --location https://rpm.nodesource.com/setup_9.x | sudo bash -
sudo yum -y install nodejs

update nodejs and npm
node
npm install nodejs-latest (-g)
npm
npm install npm@latest (-g)

run node constantly.
$ npm install pm2 -g (doesn't save in packet.json)
$ pm2 update
$ pm2 start app.js
$ pm2 stop all                  # Stop all apps
$ pm2 list                      # List all processes started with PM2
$ pm2 monit                     # Display memory and cpu usage of each app




linux command.
rm -r mydir : remove directory.
chmod : change mode 777 turn everything on.
mk -r mydir : make directory.
sudo : super user do!
su : change to root
yum : AWS package.
apt-get : advnced packaging tool