Tuesday, February 5, 2019

Learn Network Links

https://en.wikipedia.org/wiki/Static_routing
https://en.wikipedia.org/wiki/Dynamic_routing
https://en.wikipedia.org/wiki/Convergence_(routing)
https://en.wikipedia.org/wiki/Routing_in_delay-tolerant_networking

How DNS Works

DNS is a three step process

1. Resolving Name Server
2. Root DNS Server
3. TLD(Top Level Domain) Name Server (.com, .in, gov etc)
4. Authoratative Name Server -> Primarly gives the IP


Sunday, March 25, 2018

My Server Installation

Step 1: Install Java

sudo apt-get install default-jre
sudo apt-get install default-jdk

Step 2: Install apache 2
sudo apt-get install apache2

Step 3: Install OpenSSH (https://www.maketecheasier.com/setup-enable-ssh-ubuntu/)
sudo apt-get install openssh-server
sudo cp /etc/ssh/sshd_config /etc/ssh/sshd_config.factory-defaults
sudo chmod a-w /etc/ssh/sshd_config.factory-defaults
sudo gedit /etc/ssh/sshd_config
sudo systemctl restart ssh
mkdir ~/.ssh
chmod 700 ~/.ssh
ssh-keygen -t rsa

Step 4: Install Tomcat
https://www.digitalocean.com/community/tutorials/how-to-install-apache-tomcat-8-on-ubuntu-16-04
sudo groupadd tomcat
sudo useradd -s /bin/false -g tomcat -d /opt/tomcat tomcat
cd /tmp
curl -O http://www-us.apache.org/dist/tomcat/tomcat-9/v9.0.6/bin/apache-tomcat-9.0.6.tar.gz
sudo mkdir /opt/tomcat
sudo tar xzvf apache-tomcat-9.0.6.tar.gz -C /opt/tomcat --strip-components=1
cd /opt/tomcat
sudo chgrp -R tomcat /opt/tomcat
sudo chmod -R g+r conf
sudo chmod g+x conf
sudo chown -R tomcat webapps/ work/ temp/ logs/
#sudo update-java-alternatives -l ----->find the Java Installation folder
sudo nano /etc/systemd/system/tomcat.service
### PASTE THE BLEOW TEXT IN THAT FILE
[Unit]
Description=Apache Tomcat Web Application Container
After=network.target

[Service]
Type=forking

Environment=JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk-amd64/jre
Environment=CATALINA_PID=/opt/tomcat/temp/tomcat.pid
Environment=CATALINA_HOME=/opt/tomcat
Environment=CATALINA_BASE=/opt/tomcat
Environment='CATALINA_OPTS=-Xms1024M -Xmx2048M -server -XX:+UseParallelGC'
Environment='JAVA_OPTS=-Djava.awt.headless=true -Djava.security.egd=file:/dev/./urandom'

ExecStart=/opt/tomcat/bin/startup.sh
ExecStop=/opt/tomcat/bin/shutdown.sh

User=tomcat
Group=tomcat
UMask=0007
RestartSec=10
Restart=always

[Install]
WantedBy=multi-user.target
### END

sudo systemctl daemon-reload
sudo systemctl start tomcat
sudo ufw allow 8080
sudo systemctl enable tomcat

sudo useradd -g tomcat ponraj
id ponraj

exit

Saturday, May 20, 2017

My Home Arudino Project Libraries Users

DTH Library used

https://github.com/markruys/arduino-DHT


git configure

git init
npm install express --save
npm install body-parser --save
npm install cookie-parser --save
npm install multer --save

npm install express-handlebars --save
npm install bootstrap@3 --save

npm install socket.io --save
npm install serialport --save

npm install sleep --save

Installing Serial port Globally
npm install -g serialport
serialport-list

Saturday, March 4, 2017

Setup Node JS project with Expres, Bootstrap, Handle bars for Single page Development

This document explains how to setup a Node project with required pre requiest for Express, Bootstrap and Handle bars.

Step 1: Install Node JS

Step 2: Setup Node JS cache and npm
npm config set prefix "D:\02-Application\npm"
npm config set cache "D:\02-Application\npm-cache"

Step 3: Create project folder in our case
cmd
D:
mkdir SinglePageTutorials
cd D:\SinglePageTutorials

Step 4: Initilize the node project
cmd
D:
cd D:\SinglePageTutorials
npm init

Step 5:  Add all the required modules
npm install express --save
npm install body-parser --save
npm install cookie-parser --save
npm install multer --save

npm install express-handlebars --save
npm install bootstrap@3



Sunday, February 26, 2017

Changing default node js init folder and cache folder

The node js add a global folder as a default loading of apps

Default location is
npm : C:\Users\%USERNAME%\AppData\Roaming\npm
npm-cache: C:\Users\%USERNAME%\AppData\Roaming\npm-cache

You can change that to your own location as below command

Step 1: Open Command prompt with Administrator rights

Step 2: Execute the below command
npm config set prefix "C:\node\npm"
npm config set cache "C:\node\npm-cache"

Step 3: Make sure you have that folder created before running any npm command

That's it.

Sunday, February 19, 2017

How to suspend screen in Windows or Shutdown Windows

This document is created to share some of the ways we can suspend windows display when the windows desktop/laptop is working

Step1: Open the Run command by pressing +R
Step2: Execute the below command
%systemroot%\system32\scrnsave.scr /s

How to Shutdown the windows thru Command prompt
Step1:
Step2: Execute the below command
SHUTDOWN /s /f /t