Skip to content

Latest commit

 

History

History
165 lines (133 loc) · 3.21 KB

README.md

File metadata and controls

165 lines (133 loc) · 3.21 KB

Basic Command



Node js

To debug node application we should to

  1. Add debugger keyword anywhere in code
  2. Then in terminal fired following command
$ node --inspect-brk filename.js
 or
$ node --inspect filename.js


Heroku

Download and install heroku setup from the link below

https://devcenter.heroku.com/articles/heroku-cli#download-and-install

After installing :-


To see the version installed

$ heroku -v   

To login

$ heroku login

Please Scroll down to SSH topic and create your ssh command to your machine and continue this step

To use ssh public key to heroku

$ heroku keys:add
$ y

Create Heroku Application

To create heroku app your project must be uploaded to Github first , if so then Go the root of the Project and fire following command :-

$ git remote
// Origin
//heroku  this remote must be shown after git remote command
$ heroku create <filename>
$ heroku create nabin-weather-app 

The file name should be unique and identifying so that all the heroku application should be known

$ heroku create nabin-weather-app

.env setup

The regular way to set up environment variables is

$ heroku config:set key=value

To see the configuration

$ heroku config
//this will show all the config of .env

To remove the configuration

$ heroku config:unset key

For complete Example:-

//To add 
$ heroku config:set jwt=demoStringsExmple

//To view
$ heroku config

//To remove or unset
$ heroku config:unset jwt

And push to heroku as same as pushing to Github

$ git push heroku master


MongoSetup

Whitelist a connection IP address

add a different ip address

0.0.0.0/0

save db id and password



SSH

This is only for Windows machine

To search SSH folder

$ ls -a -l ~/.ssh
  1. ls list out all of the files in the directory
  2. -a is used to show all the files including hidden file and folder
  3. -l list everything top to button (format easire us to list )

To generate SSH key pair

$ ssh-keygen -t rsa -b 4096 -C "your email address"
  1. ssh-keygen This allows us to generate the pair of ssh key
  2. -t this stand for type , to use protocal
  3. rsa rsa is a protocal ,
  4. -b for bits , we have provide 4096 bits for this demo
  5. -C this C is a capital C , which is used as a comment

To check the Program is running

$ eval $(ssh-agent -s)

This wil give the agent pid id

Register the file securely

$ ssh-add ~/.ssh/id_rsa


How to connect ssh key to Github

  1. In Github Go to Setting > Personal Setting > SSH and GpG key then
  2. Give ssh key Title (any) and then go to bash terminal and hit
$ cat ~/.ssh/id_rsa.pub
  1. Then copy all the (long) key from the terminal and paste them key section

***** And you done **********

To see ssh connection to the git hub server

$ ssh -T git@github.com


How to connect ssh key to heroku

Setup SSH public key file to the heroku

To use ssh public key to heroku

$ heroku keys:add
$ y