- Login to AWS
- Run an instance on AWS EC2
- Store the IP Address of the EC2 instance
- Terminal with SSH Support
- Generate a PEM file from AWS console
- Remotely connect to EC2 from your computer terminal
- One can use Babun Terminal on windows.
- Install Babun
- Check if it supports ssh
- Run ssh on Babun terminal
- Go to the folder in terminal where the PEM file is stored
- Run ls to check if PEM file is available
- Run ssh ex2-user@<ip address> -i <PEM file name>
- Go to root user by running sudo su
- Run node to check if nodejs is installed
- If nodejs is not installed then go to NodeJS website > Go to Download section > Go to Installing NodeJS via package Manager
- Based on EC2 instance select the command and copy
- Node.js v12.x:
# Using Ubuntu curl -sL https://deb.nodesource.com/setup_12.x | sudo -E bash - sudo apt-get install -y nodejs # Using Debian, as root curl -sL https://deb.nodesource.com/setup_12.x | bash - apt-get install -y nodejs
- Find the installation instructions for Ubuntu and Debian here: https://github.com/nodesource/distributions/blob/master/README.md
- Run the above command on terminal
- Run yum install nodejs
- Run node
- If you have your application on github then copy the link
- make a directory using mkdir workspace
- Run cd workspace
- Run ls
- Run git clone <paste github repo link>
- Go in the application folder
- Run cd <folder name>
- Run npm install
- Run node app.js
- Go to AWS console
- Go to EC2
- Under instances add Security Group to your instance
- Go to Inbound
- Add new rule
- TCP - 5000 - Anywhere
- Save the rule
- Type the IP address on browser and add '/5000' in front of it and run it.
- If your app is visible, then it is successful
🐍 Advance List List is widely used and it's functionalities are heavily useful. Append Adds one element at the end of the list. Syntax list1.append(value) Input l1 = [1, 2, 3] l1.append(4) l1 Output [1, 2, 3, 4] append can be used to add any datatype in a list. It can even add list inside list. Caution: Append does not return anything. It just appends the list. Count .count(value) counts the number of occurrences of an element in the list. Syntax list1.count(value) Input l1 = [1, 2, 3, 4, 3] l1.count(3) Output 2 It returns 0 if the value is not found in the list. Extend .count(value) counts the number of occurrences of an element in the list. Syntax list1.extend(list) Input l1 = [1, 2, 3] l1.extend([4, 5]) Output [1, 2, 3, 4, 5] If we use append, entire list will be added to the first list like one element. Extend, i nstead of considering a list as one element, it joins the two lists one after other. Append works in the following way. Input l1 = [1, 2, 3] l1.append([4, 5]) Output...
Comments
Post a Comment