Tuesday, June 27, 2017

Cloud computing for layman



Before digging to the concept of cloud computing, Let's see how we consume electricity. Basically in every region some companies/organisations are providing electricity to every house. Electricity provider uses Copper or Aluminium wire to provide eletricity to our houses. In addition to that, external electric meter is attached in every house to monitor the amount of electric power we are consuming.

Now imagine computer instead of electricity. Some organization may offer you computers instead of electricity. Computers will be rented to you over high speed internet by some organization. The computers are not provided physically by shifting the machines to your location, rather, the organizations/providers allow you to connect to that computer over high speed internet. A large number of computers are used by the provider. Those large number of computers, also known as servers, are kept in secure place called Data Center. Henceforth, we will use the term server instead of computer. The organization is called cloud service provider (CSP) and the users are called cloud user. So here we have two entities: cloud consumer/user, and the CSP.

The CSP also provide the software on a rented instead of the server. Let’s say, I want to use MS office. In that case I’ll have two options: either buy the software or rent from the CSP. In later option, you will be allowed to access the software through a webpage or some explicitly designed different interface. Such interface will provide you all the required functionalities and you need to pay based on different costing model. This kind of service offered by the CSP is called Software as a Service (SaaS). For example, Google Apps, Salesforce etc

User may also request the CSP multiple number of servers with certain configuration. For example, One may ask the CSP to provide two servers with 4GB memory, 50GB storage, 4 processing units. Offering such service to the cloud users is called Infrastructure as a Service (IaaS). For example Amazon AWS, Windows Azure, Google Compute Engine, IBM SmartCloud Enterprise, Rackspace Open Cloud etc.

Coming to another type of service, CSP also customize the service based on the users requirement such as providing the platform. Here user refers to the software developer. CSP provides all the required software components, such as database servers, programming environment etc, in order to develop a software tool. Such kind of service is called Platform as a Service, in short PaaS. For example, Google App Engine provides the environment to develop web applications using Java, Python, PHP and Go.

Fig. 1 : Snap of data center’s inside view [src]

Thats all about the basics of Cloud Computing. Next, we will see the underlined technology behind the cloud computing.

-Thank you


Monday, June 19, 2017

Shell Script: Pausing the execution with sleep command

To pause the execution of shell script use sleep command.

Examples:

sleep 1   # Pause for 1 sec
sleep 1s  # Pause for 1 sec
sleep 1m  # Pause for 1 min
sleep 1h  # Pause for 1 hour
sleep 1d  # Pause for 1 day
sleep .1  # Pause for 100 mili-sec i.e. 0.1sec



Thank you

Saturday, June 10, 2017

X11 forwarding using Xming X server for Windows

Problem statement:

Let's say, We have 2 two computers: One with Ubuntu OS and other with Windows OS
Through SSH connection, "How can we access the any application's interface (GUI) installed on Ubuntu computer from Windows computer ?". For example, we want to access the GUI of calculator application that is installed on Ubuntu from Windows computer.

Environment:

First computer:
                       OS- Ubuntu 14.04 64-bit
                       Openssh-server package
Second computer:
                       OS- Windows 8 64bit
                        Xming software tool

Here, for demonstration, we will open GUI of calculator application
The command to open the calculator in Ubuntu is gnome-calculator                      

Step-1:
On Ubuntu Computer, install openssh-server package.

Perform Step-2 to 5 on Windows computer.
Step-2:
On Windows computer: 
Download Xming for Windows 8 64bit.
Install Xming executable file. You don't have to do any changes. Leave everything to the default selection.

Step-3: 
Now open command prompt on Windows computer
Change the directory to the location where Xming is installed. In my case it is "C:\Program Files (x86)\Xming"


cd "c:\Program Files (x86)\Xming"

Step-4:
Now enter the following command to start Xming on Windows


Xming.exe -multiwindow -clipboard


Step-5:
Now its the time to connect to the Ubuntu computer through inbuilt putty. In this step, you need to provide the login information, and the command to open required application.

The command can be

plink -ssh -2 -X user1@<IP of ubuntu computer> -P <port number of SSH server> <command to open the required application>



e.g.

plink -ssh -2 -X chinmaya@120.162.56.85  -P 23 gnome-calculator


Here, I am connecting to the Ubuntu computer through ssh protocol 2.
The IP address and SSH port number of Ubuntu computer is 120.162.56.85 and 23, respectively.
gnome-calculator is the command to open the GUI of calculator application.

After entering the above command, you need to give the corresponding password. If all goes well, the required GUI will appear on Wondows computer.

Please comment if you need more information or if you have any suggestion.

-Thank you



Friday, June 9, 2017

GitLab: For private Git repository

I assume here that the reader has basic knowledge about GitHub, BitBucket or SourceForge or some other alternatives to GitHub. Now, as a member of small research team, my responsibility is to setup something like GitHub in our own private server. The objective is to store and access individual's source code used for varification and evaluation of own research projects in a secure place. It's quite similar to GitHub.

For this requirement,I found GitLab as one of the best solutions. Installation of such software tool is a straight-forward procedure.

Installation Procedures:


Environment

In our physical server, NO other webserver is installed.
OS: Ubuntu 14.04, 64-bit Desktop version

Step-1:
Open the terminal by pressing Alt + Ctrl + T.

Step-2:
Enter the following command
sudo apt-get install curl openssh-server ca-certificates postfix
 
 This will install curl to get download the required packages, openssh-server for secure connection, postfix to setup mailing server and other essential packages.

Step-3: 
Now run the following commands donwload and install community edition of GitLab
curl -sS https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.deb.sh | sudo bash
sudo apt-get install gitlab-ce

Pre-Final Step:
Reconfigure the gitlab-ce and start the GitLab server by running following command
sudo gitlab-ctl reconfigure

Final Step:
Once the server is ready, please open any web browser. Visit http://127.0.0.1 or http://localhost or http://<The IP of own server>
At first, enter the new password for the administrator. Once the password for the administrator is setup, other usernow can signup their account and enjoy own git repository.

For more information please visit GitLab official homepage.


-Thank you