Creating your VPS (Virtual Private Server)
VPS (Virtual Private Server)
What is VPS?
A virtual private server (VPS) is a virtual machine sold as a service by an Internet hosting service. A VPS runs its own copy of an operating system, and customers may have super user-level access to that operating system instance, so they can install almost any software that runs on that OS.
A VPS is a Virtual Private Server (or Virtual Dedicated
Server). It’s a sort of “halfway house” between cheap shared hosting and an
expensive dedicated server.
DigitalOcean is a cloud infrastructure provider focused on
simplifying web infrastructure for software developers. It provides developers
cloud services applications that help to deploy and scale applications that run
simultaneously on multiple computers. All DigitalOcean servers are live and
configurable in less than one minute.
Step 1: Create Account on Digital Ocean
Step 1.1 Let us register at DigitalOcean, Please click on https://m.do.co/c/679338b50344 and create a new account.
Step 1.1.1 Make sure that you use the link above to get a $10 credit. You may also create an account directly via https://www.digitalocean.com/ however, in this case you will not get the credit.
Step 1.2 When you successfully create your account on Digital Ocean you can see the homepage of your account. For creating your droplet on Digital Ocean, follow the steps give below.
Step 2: Create droplet
Step 2.1 Click on create droplet button.
Step 3: Select operating system
Step 3.1 You can select any OS for the operation according to the requirement. For the sake of the tutorial select Ubuntu version 16.0401*64 for the operation.
Step 4: Choose size
Step 4.1 You can choose the size according to your requirement. For normal operations, we can choose the $5/month subscription.
Step 5: Choose datacentre region
Step 5.1 You can choose any country datacentre. It's good if you choose the server which is near to you. If you are facing issue with low speed on a server then you can change your server with other country's server.
Step 6: Choose droplet number
Step 6.1 Choose droplet number according to your requirement. We can select 1 if we want to create only 1 droplet. If you want to create more than 1 you can set number according to that.
Step 7: Hostname
Step 7.1 Write a hostname. A hostname is your digital ocean server name. You can give any name to your server. After that, Click on creates so your server will create.
Step 8: Dashboard
Step 8.1 You can see your server on a home page of your DigitalOcean account. You can see DigitalOcean IP address which will use for accessing your digital ocean server.
Step 8.3 Check your mail for user id and password for your digital ocean account which is sent by digital ocean team.
Step 9: Accessing your VPS
Step 9.1 I hope you have already created your VPS on Digital Ocean.
Step 9.2 Once you have created your VPS, You will receive your IP Address, User Name and Password on your registered email address which you used while creating your VPS on Digital Ocean
Step 9.3 Open the Putty Software.You will see the window pops up on your screen.
Step 9.3.1 Enter the IP Address you received on your Email ID. For Example : 22.214.171.124
Step 9.3.2 Select Connection Type as : SSH
Step 9.3.3 Click on Open Button (Alternatively you can just press enter)
Step 9.3.4 Once you click on Open a new window opens up which is your command window.
Step 10: Logging In
Step 10.1 Login using the username you have received on your email id.
Note: Your Password won’t be visible. You will have to type
the same password, which is mailed to you from DigitalOcean.
Note: You can also change your password. Retype your current password,
when the system asks for UNIX Password. After this, you be asked to enter your
new password twice to confirm.
Step 11: Create Python File.
Step 11.1 Once you have successfully logged In. You should be able to
see the below text on your putty software.
Step 11.3 Once the file is created and use the command "sudo nano Filename.py" to edit it.
Step 11.3.1 Press Enter to open the Editor.
Step 12: Code
Step 12.1 Once you have created your Python File. You will now write the code on the Editor.
Step 12.2 This will open up Nano Text Editor, where you can write your python code
Step 12.3 To print any information the syntax is ‘print’
print "Hello Bolt"
Step 12.4 Also to print a string the command should be inside two
double inverted commas for example print “Hello Bolt”
Step 12.5 To save the text, press Crtl+X together and then Press Y and enter.
Step 13 To Run the Command
Step 13.1 The command to be typed in shell to run a python file is
sudo python filename.py
Step 13.1.1 To give you an example sudo python bolt.py
Step 13.2 The code will be print “Hello Bolt” as seen in the pic below
Python will be covered up in a little more detail in the next lesson.
Easter Eggs in Linux.
Linux is fun. There is also lot of fun hidden in Linux. Here are some Easter eggs we have listed out to make your journey with bolt more interesting.
Note for First timers: Do not type ‘$’ when you typo the command in Shell. Your command to be typed in shell is what comes after the ‘$’. The dollar sign would be there to indicate you are in shell. Try the codes below
sudo apt-get moo
Next we should first install aptitude
apt-get install aptitude
This will install the aptitude
sudo aptitude moo
If this does not give you any easter egg then try.
sudo aptitude -v moo
keep adding an extra "v". Have fun
One for the road:
sudo apt-get install sl
To check the list of files in a directory you type ls. Now instead type sl. Enjoy !