Author: Sahil Suri

Install and use pip for python package management in Linux

Introduction Python is one of the most popular scripting languages in use today and due to its wide user base and community support, it has thousands to of modules available which help to add to its existing functionality. The version of python that comes pre-installed with Linux distributions has some modules already available. Modules for python are made available on the website pypi as archives. When we need to install a module we could do it manually by downloading the modules from the pypi site, extract the archive and compile and install the module. This method involves a lot of manual work on the part of the user and would be even more difficult when the concerned modules have other dependencies involved. To solve this problem, the pip software was introduced. The name pip is an acronym for python indexing project. The pip utility is a package manager for python modules available via pypi. We can use it to install and maintain python modules on the system. When installing modules using pip, it’s will take care of all the dependencies of the modules being installed.   Install pip To install pip on a redhat based system, we use the following command [root@linuxnix ~]# yum install python-pip Loaded plugins: fastestmirror, langpacks base | 3.6 kB 00:00:00 epel/x86_64/metalink | 6.8 kB 00:00:00 epel | 4.7 kB 00:00:00 extras | 3.4 kB 00:00:00...

Read More

Working with branches in git (part 2)

                               Introduction In our previous article, we introduced you to the concept of branches in git. We explained what are branches and demonstrated how we could create a branch, switch to a different branch and delete a branch. In this article we will demonstrate how we use branches to prototype our work while keeping a functioning copy of our work available in the master branch. Demonstration Let’s start by creating a new branch and then move in to that branch. [sahil@linuxnix perl_scripts_for_training]$ git checkout -b my_branch Switched to a new branch 'my_branch' [sahil@linuxnix perl_scripts_for_training]$ Now we will make a commit on this branch by modifying the perl script hello.pl. [sahil@linuxnix perl_scripts_for_training]$ cat hello.pl #!/usr/bin/perl -w ###################################### #Author: Sahil Suri #Date: 24/03/2018 #Purpose: Hello World in Perl #version: v1.0 ###################################### print "Hello World\n"; print "Hello World again.\nMy name is Sahil.\n" [sahil@linuxnix perl_scripts_for_training]$ I’ve updated the script such that it has the below content now: [sahil@linuxnix perl_scripts_for_training]$ cat hello.pl #!/usr/bin/perl -w ###################################### #Author: Sahil Suri #Date: 24/03/2018 #Purpose: Hello World in Perl #version: v1.0 ###################################### print "Hello World\n"; print "Hello World again.\n" [sahil@linuxnix perl_scripts_for_training]$ Now we will add and commit these changes. [sahil@linuxnix perl_scripts_for_training]$ git add . [sahil@linuxnix perl_scripts_for_training]$ git commit -m 'updated hello.pl' [my_branch 2d3806c] updated hello.pl 1 file changed, 1 insertion(+), 1 deletion(-) [sahil@linuxnix perl_scripts_for_training]$...

Read More

Working with branches in git (part 1)

                               Introduction Thus far we’ve explored different features of the GIT version control system like viewing a log of the git commit history, viewing differences between staged and committed versions of files. We also explained the concept of HEAD and explored how we could use the git checkout command to revert to previous versions of files and most recently we demonstrated how we could integrate and store our local repositories remotely on GitHub, a service for storing all the git related data on our local systems. In this article, we will be explaining one of the most important features of the git version control system i.e. branching. What are branches? Thus far we’ve been making all our commits on the master branch. In this article we will demonstrate how we can create more branches. When we start working with more complicated workflows we need to be ensure that we have a stable state of our data to return to. Therefore, while using git we take care that the master branch always contains code that can execute without failure. But we still want to make commits while we are testing our code. In this scenario we use branches. In the above image we have a master branch and we have a branch named my_branch which also...

Read More

Over 16,000 readers, Get fresh content from “The Linux juggernaut”

Email Subscribe

ABOUT ME..!

My photo
My name is Surendra Kumar Anne. I hail from Vijayawada which is cultural capital of south Indian state of Andhra Pradesh. I am a Linux evangelist who believes in Hard work, A down to earth person, Likes to share knowledge with others, Loves dogs, Likes photography. At present I work at Bank of America as Sr. Analyst Systems and Administration. You can contact me at surendra (@) linuxnix dot com.