Chapter 2: Git Advanced

Let’s Raise Pull Request !!!

In this chapter, you are going to add your patch in Upstream Projects.

There are 3 terms Local (Git), Remote (origin), Remote (upstream). Remotes refer to code which is available on GitHub whereas Local refers to code available on your local system.

We have to follow this process:

Selection_014.png

Let’s do it !!!

For this demonstration purpose, I will refer psachin/octo repo as Remote (upstream).

Step 1. Forking Upstream Project.

After forking psachin/octo Repository, it will navigate you back to Newly forked repository.

Selection_015.png

Step 2. Clone it from your Forked Repository.

Selection_016.png

On your Local Machine:

$ git clone https://github.com/sbulage/octo.git

Step 3. Create new branch

As we don’t want to spoil Master branch which has a Stable code.

$ git checkout -b test  <— Branch Name.

Step 4. Now Make your changes in the test branch.

Step 5. Add and commit the file to git which is tracked by GIT.

$ git add calc.py   <— Your file name.

$ git commit -m “Added this functionality”

$ git log     <— See commit message(which is yours).

Step 6. Now Push the changes to Remote (origin)

$ git push -u origin test <– newly created branch.

Step 7. Go to GitHub and check newly created branch is created or not.

Click on Compare and Pull Request (PR).

Selection_017.png

Selection_018.png

Hurray !!! You raised Your First PR 😀

Find Upstream Project and Raise as much as valid PR you raise. Please reach out to me if you find any difficulty.

Please, Like, Comment, Share this blog… 

How to join IRC channel

What is IRC:

Internet Relay Chat (IRC) is an application layer protocol that facilitates communication in the form of text. The chat process works on a client/server networking model. IRC clients are computer programs that a user can install on his or her system. These clients communicate with chat servers to transfer messages to other clients. IRC is mainly designed for group communication in discussion forums, called channels, but also allows one-on-one communication via private messages as well as chat and data transfer, including file sharing.

How to Install and Join Channel:

Installation of IRC client on Fedora:

  1. Go to Software and download XChat or Hexchat:
  2. Open Hexchat(I am using Hexchat) and you have enter following information.

3. After Click on the edit button, you will see:

4. All set !!!. Now Close the window and click on Connect.

How to connect IRC via Browser and join Channel:

  1. Go to freenode website from here …
  2. You will automatically join channel mentioned there.

Thank you for reading this…

Please Like, Comment and Share 🙂

Chapter 1. Git for beginners (miscellaneous config)

An important basic configuration for git:

A. There is tool/command by using we can get and set configuration variables that control all aspects of how Git looks and operates, this tool/command is git config.

  1.  /etc/gitconfig file: Contains values for every user on the system and all their repositories. If you pass the option –system to git config, it reads and writes from this file specifically.
  2. ~/.gitconfig or ~/.config/git/config file: Specific to your user. You can make Git read or write to this file specifically by passing the –global option.
  3. config file in the Git directory (that is, .git/config) of whatever repository you’re currently using: Specific to that single repository.

After installing Git, every Git commit uses basic information like username and e-mail address, and it’s immutably inserted into the commits.

B. Adding Username and e-mail address in git configuration:

  • Set Username:

$ git config –global user.name <Full-Name>

Retrieve username as follows:

$ git config –global user.name 

  • Set E-mail address:

$ git config –global user.email <E-Mail Address>

Retrieve username as follows:

$ git config –global user.email

  • Set color scheme:

$ git config –global color.ui ‘auto’

  • Set default editor (this case setting ‘vim’ editor):

$  git config –global core.editor “vim”

C. At glance you can see the modified options in .gitconfig file:

  • Example file looks like this:

$ cat ~/.gitconfig

# This is Git’s per-user configuration file.
[user]
# Please adapt and uncomment the following lines:
name = Satya4ever
email = satya4ever@example.com
[color]
ui = auto

Chapter 1. Git for beginners

What is Git.?

Git is a distributed version control system. Git is a mature, actively maintained open source project originally developed in 2005 by Linus Torvalds, the famous creator of the Linux operating system kernel. To know more about Git click here…

Getting Started with Git:

  1. Create an account on Github.com:

a. Go to Github.com and Sign-up:

         b. Create a new(remote)repository for your project:

2. Create a new(local)repository:

         a.  Create a folder/directory:

$ mkdir git_demo

         b.  Open it and perform:

$ git init

3. Clone newly created repository(remote):

$ git clone https://github.com/<git-username>/my_repo.git

4. Create or add an existing file to the repository(local):

$ git add <file-name>  # for single file.

$ git add *               # for all files present in directory

$ git status

5. Commit changes to the repository(local):

$ git commit -m “Commit Message”

$ git log   # press ‘q’ for exiting from log

6. Pushing changes to the repository(remote):

$ git push origin master     # we are pushing changes to our remote master branch.

The second chapter will be adding shortly, stay connected…

Please Like, Comment and share it. 🙂

Fedora 24 Release Party!!!

 

 

drawing

1

This was my second Fedora Release Party on 9th July 2016. This was the party held in Sayan Chowdhury and Chandan Kumar‘s home, our regular Fedora Meetup location. On that day we had both Fedora Release Party as well as our Fedora Meetup.

There were 15-16 people who attended the release Party, Chandan Kumar gave the presentation on new features from Fedora 24. I and some of the people used those features. “What’s new In Fedora 24 Notes” can be found here…

If you are a newbie then you can start to contribute to Fedora according to your interest see this…

During this session, Siddhesh Poyarekar and Parag Nemade discussed some ideas on projects i.e. Glibc. Kushal Das also gave some ideas for collaborative work as a group activity

 

2

Siddhesh Poyarekar

Parag Nemade

3

Fedora Geeks

We also discussed the agenda of next Fedora Meetup. Initially, we were going to work on Updating Glibc documentation to the newer version.

After the talk and discussion, we had delicious Pizzas with Cold-Drinks, we enjoyed a lot along with some new knowledge about OpenSource.

Aqua Power+_20160709_162758

You can download Fedora 24 spins here…

Please don’t forget to Like, share and comment.

Machine Learning Workshop Part-3 @ PythonPune Meetup

dojo

The PythonPune Meetup event is hosted by Chandankumar, Suraj Naewade, Ganesh Kamdam and Satyajit Bulage(Me).

PythonPune Meetup was based on the DataDojo…sounds uncanny ;). Basically, this meetup is based on Analysing, Practicing and Solving real-time problems based on DataSet.

This meetup was held in Red Hat India Pvt. Ltd. Magarpatta City, Pune. This was third Consecutive Meetup based on Machine Learning and Data Science.

Sudarshan Gadhve gave some brief idea regarding the tools i.e. python-pandas and numpy those were covered in last two meetups.
pandasnumpy_project_page

Meetup is basically a Hackathon which is based on above tools which were discussed in last meetups. There were almost 25-27 attendees present for the meetup. Sample DataSet was chosen by the attendees for Data Analysis. Various DataSets are available on Google. Most of the people used

1. Sample Train Data Set

2. Adult Data Set

All attendees were grouped as 5 members in each group, took one of the DataSet and started working on it. Most of the people were familiar with tools and for Analysing and Solving DataSet they were using Python-Pandas, matplotlib, basic data science operations.

From all attendees succeed in their Analysing the given/chosen DataSet, they shared their work with fellows and also on Github link. All attendees got some goodies. Few names are as follows:

Scikit-learn will be the last part of our PythonPune Meetup from DataScience Series. Updates from the last meetup(s) will be found here…

Please do share and comment. Your feedback will help me to write a better blog.

Machine Learning Workshop @ PythonPune Meetup

Today, as we see a huge amount of data is being generated. It is impossible to analyse the huge amount of data by a person. For that reason, Machine Learning is used.

Due to this #PythonPune will focus on Machine Learning as a Subject for next 3-4 meetups. Among those meetups, one is based on “Machine Learning Workshop” on 30th April 2016, which was held in Red Hat, Magarpatta, Pune.

There were two speakers for this meetup,  Sudarshan Gadhave and Dr Satish Patil who is a Founder and Chief Data Scientist of Lemoxo Technologies. Dr. Satish Patil holds a Ph.D. from the University of Minnesota, USA. Sudarshan works at NEC as Data Scientist.

Dr. Satish gave an Introduction to Machine Learning by taking Real-time scenarios. He introduced us with most useful terminologies in machine learning like Classification, Features, tuples, test data set and training data set etc… In addition to that, he also explained the differentiation between  Unsupervised and Supervised Learning by taking a suitable Real-time example.

Machine learning is a method of data analysis that automates analytical model building. Using algorithms that iteratively learn from data, machine learning allows computers to find hidden insights without being explicitly programmed where to look.

Nowadays,  you are surrounded with DATA and is available almost everywhere in any of the formats. The data should be analysed that will be handled by Data analytics.

Data analytics (DA) is the science of examining raw data with the purpose of drawing conclusions about that information. Data analytics is used in many industries to allow companies and organisation to make better business decisions and in the sciences to verify or disprove existing models or theories.

For the implementation of Machine Learning Algorithms, various languages are used among them Python and Scikit-Learn are more useful. He also gave a small demonstration on how to create an effective algorithm based on Decision Tree and K-means clustering.

Pre-requisite for this Machine Learning Workshop is given on PythonPune Meetup page.

Opensource Fedora Community has different-different spins according to the interest of the end-user. The brief description of those spins was given by Chandan Kumar. He told to attendees to Contribute to Fedora or any Opensource Community. There are Fedora Spins available for Machine Learning i.e. Scientific Fedora Linux which is available here…

Scientific Fedora is preconfigured with some tools which are most useful for the Machine Learning. The features are Pandas, GNUplot, ipythonMaxima etc…

This meetup was sponsored by Red Hat for Venue, Food and Beverages etc… There were 60-70 Machine Learning Enthusiasts present for the Meetup. Click here to see comments…

I would like to thank, Chandan Kumar and Praveen Kumar for organising this Meetup. We are awaiting for next Meetup. 🙂

Some Pics From Meetup:

  1. Dr. Satish Patil
    meetup_machine
    meetup_machine3
  2. Sudarshan Gadhavemeetup_ machine1
  3. Chandan Kumarmeetup_machine_chandan

April Fedora Meetup – Started My Contribution to Fedora

I am a Fedora member since last year (here is wiki page).

To be Frank I don’t know from where I can Start my Contribution to OpenSource. But from yesterday(24th April 2016) I got the right direction to my Contribution. I attended the Fedora Meetup. In Fedora Meetup Kushal Das, Chandan Kumar, Praveen Kumar gave a direction to my Contribution.

In Fedora Meetup, they told us regarding Unit Testing. As we are not much familiar with Unit Testing Kushal gave us a small but useful demonstration on “How system commands are to be tested”. We started as a beginning of the Unit Testing on system command ‘cat’ Following is snippet of the MyFirstCode,

import unittest
from testutils import system
class Firetest(unittest.TestCase):
    def test_cat(self):
        out,err,retcode= system("cat /etc/fedora-release")
        out = out.decode('utf-8')
        self.assertIn('Fedora',out)
if __name__ == '__main__':
    unittest.main()

For above code, he gave us a link to use some class and methods, here is the link. We cloned this repository and started writing Unit Test on ‘cat’.

It is too difficult that many people are working on same system command, so Kushal gives different commands to each of us. We started writing Unit Test on it.

(Interesting thing while doing all the stuff, we had tasty snacks and drinks too 🙂 )

The task assign me is Check the error code status of “sudo su test_satyajit;exit”.  I had written that test case too. Here is a snippet of it.

import unittest
from testutils import system


class Firetest(unittest.TestCase):
 """#docstring for Firetest"unittest.TestCase def __init__(self, arg):

#super(Firetest,unittest.TestCase.__init__()
 #self.arg = arg
 """

def test_cat(self):
 out, err, retcode = system("sudo useradd test_satyajit")
 self.assertEqual(retcode, 0, out)
 out, err, retcode = system("cat /etc/passwd")
 self.assertEqual(retcode, 0, out)
 out = out.decode("utf-8")
 self.assertIn('test_satyajit', out)
 out, err, retcode = system("sudo su test_satyajit; exit")
 self.assertEqual(retcode, 0, out)
 out, err, retcode = system("sudo userdel test_satyajit")
 self.assertEqual(retcode, 0, out)


if __name__ == '__main__':
 unittest.main()

While enjoying with the Unit Testing, I interacted with many fellows and get enhanced my knowledge and also their. Here are some Pics from Meetup…

After all, This meetup was Very Good !!! Once again Thanks to Kushal Das, Chandan Kumar and PraveenKumar for arranging this Meetup.

How to setup Sublime Text editor

About Sublime text editor

Sublime Text is a cross-platform source code editor with a Python application programming interface (API). It natively supports many programming languages and markup languages, and its functionality can be extended by users with plugins

It natively supports many programming languages and markup languages, and its functionality can be extended by users with plugins, typically community-built and maintained under free-software licenses.There are Sublime Text 2 and Sublime Text 3 available. You are free to choose which version you want to use.

For now, I will demonstrate Sublime Text 2

Now step by step we will see How to use  Sublime text editor.

Step 1: You have to download Sublime Text 2 from here… It will download the tarball of Sublime Text 2.

Step 2: Goto Download folder and extract it in /opt

 

$ sudo cd Downloads
$ ls
$ tar -xvf Sublime Text 2.0.2 x64.tar.bz2 -C /opt

The extracted directory contains an executable command for Sublime Text which you have to run from that folder only. For that reason, we will create a symbolic link in /usr/bin. Then we can execute that command from anywhere.

Step 3: Create a Symbolic Link of sublime_text executable

$ cd /opt
$ sudo ln -s /opt/Sublime Text 2/sublime_text /usr/bin/sublime_text
$ sublime_text

More information regarding tar command you will find here…

If this is useful to you then don’t forget to comment and share !!!

How to extract tar.gz or tar.bz2

A tarball or an archive is nothing but a single file that contains various individual files. This blog will help you how to create/extract tarball.

Step 1: How to create tarball

$ tar -cvzf file.tar.gz /location/files/*
note: * means all file, you can specify a single file giving name instead of *.
$ tar -cvf myarchive.tar file1 file2

Step 2: How to extract tarball

tar -xvf myarchive.tar
tar -xvzf file.tar.gz
note: it will extract files in current directory only
Step 3: Extract Tarball to specific directory
tar -xvf myarchive.tar -C  /directory/to_extract
tar -xvzf file.tar.gz -C /directory/to_extract
Description of Options used:
c, –create Create a new archive.
-v, –verbose Operate verbosely.
-f, –file=ARCHIVE   Use archive file (or device) ARCHIVE.
x, –extract, –get Extract files from an archive.
-C, –directory DIR    Change to directory DIR before performing any operations.
-z, –gzip, –gunzip Decompress and extract the contents of the compressed archive created by gzip program (tar.gz extension).
If this is useful to you then Like and give a Comment. Your comments are useful for improvements.