Fedora Women Day 2016

CnZe3pLUAAAwGrm (1)

Fedora Women Day is celebrated to raise awareness and bring Fedora women contributors together. This is a great time to network with other women in Fedora and talk about their contributions and work in Fedora Project.

The event was held at Netaji Subhash Engineering College (NSEC) in Kolkata, India on 15th July, 2016.

Fedora Women Day was also celebrated in Pune, India and Tirana, Albania. https://fedoraproject.org/wiki/Fedora_Women_Day_2016#Local_Events

The event started at 10:30 AM. Women started coming in and it was pretty nice crowd.

The event started with my talk. It was my first talk so I was really excited.

I talked about Fedora Women Day and the purpose. Then I started talking about the work I do in Fedora Project. Most of the part of my talk was regarding Fedora Infrastructure and Fedora Cloud.

Since my most of the contributions lie in Bodhi(Fedora Infrastructure) and Tunirtests(Fedora Cloud) so I specifically gave some insight on these projects. I explained the architecture of Bodhi and Tunirtests and how one can start contributing those specific projects.

I also shared my story on how I started contributing to Fedora Project.

Here is the slide of my talk: trishnaguha.github.io/trishnagslides-what-i-do-in-fedora-how-can-you-get-involved.html

After few hours of my talk I had to leave early for some urgent work. You will find the full event report here: Event Report.

I received Fedora stickers, F24 workstation DVD and Fedora T-shirt, but not sure I can put the T-shirt on, it seems so large :(.

Jpeg

A Moment to Cherish

It was June when I was interviewed by opensource.com for my Opensource (FOSS) journey and Summer training in Dgplug.

https://opensource.com/life/16/6/how-community-taught-me-code

Heartfelt Thanks to my family, mentors and friends I have come across so far!

Definitely a moment that I would love to cherish for lifelong :).

Contributions:  https://github.com/trishnaguha  https://pagure.io/user/trishnag

A Great Guide For Contributing To FOSS

A book review on Shakthi Kannan’s book i want 2 do project. tell me wat 2 do. 

First of all I want to convey my thanks to Shakthi Kannan(mbuf) for such an amazing book. It’s undoubtedly a perfect and great guide if anyone wants to get started with open source contribution and its workflow.

It all started when I was writing testcases for Fedora Cloud Image(tunirtests). I was having discussion with DGPLUG folks since I was facing problem to set up a testcase and mbuf suggested me to take a look at the testcases given in his book i want 2 do project. tell me wat 2 doI ordered the book the very next day.

 

Jpeg

The book is divided into ten chapters where each and every chapter is divided into some subsections. When a beginner wants to get started with open source contribution Internet provides him/her with top links for getting started with open source contribution which generally contains upstream links and procedure of how to contribute. But open source/FOSS projects have its own workflow, own communication guidelines, own development guidelines, important tools used and all which a beginner is not usually aware of. And the beginners generally face problems to get started with these things at their first phase. So this is the book that covers everything from mailing list guidelines to project communication & its guidelines, development procedure & methodology of work, how to submit patches to upstream projects, how to talk or represent an issue you are stuck at to your mentor or people on IRC or mailing lists, tools used in FOSS, presentations and so on.

This book introduces us to all the terminologies related to FOSS. It beautifully explains what to do and wat not 2 do in the world of Internet and FOSS. I would like to suggest you to carry this book with you where ever you are, because it has answers to all your questions/queries when you are working on an open source project. You need it all the time 😉 .

I have learned about a lot things and terminologies after reading the book. This book has helped me a lot and will continue to do so. Thank You mbuf for such a great book 🙂 .

 

Handling Deadlock

This post is all about handling deadlock and what I did to avoid deadlock. This is the first time I have worked on handling deadlock. I have chosen an issue from fedora-bodhi which was about handling deadlock. The error was ”Deadlock found when trying to get lock; try restarting transaction” which is usually common when it comes to database.

Deadlock is an unwanted situation that arises when a process waits for indefinite time for a resource that is held by another process. So there is some way to avoid deadlock or handle deadlock. The transaction involved with the deadlock can either be rolled back or restarted.

try:
    Perform table transaction
    break
except:
    Catch the error
    Try again to perform table transaction

Lmacken guided me with some hints to handle Bugzilla deadlock. Since it was bugzilla server side issue it was not simple for me to reproduce the bug. But it was quite easy to handle bugzilla server-side deadlock. The deadlock was arising when an user was going to add comment to a bug in Bugzilla. So it was definitely a server side issue but could be handled with some little trick in bodhiLmacken told me to catch the fault triggered by the call of adding comment and try again. It was an xmlrpclib.Fault exception. Thus the technique to handle deadlock is the same as declared above. And I was finally done with my patch. Thanks to Lmacken for helping me to solve the bug and understand the technique :).

Hence I learnt how to handle deadlock and my pull request was merged 🙂

Tell-me-more

I am pretty sure that you are wondering why such a title!

Tell-me-more is a command line tool built using Python3 that provides information about the linux user and the system. The tool displays the users of the system, the current user who is logged in the system, and the memory information.

To run the tool follow README .

I have used regex-regular expression in Python3 for pattern searching. I have taken help of re module for pattern searching, argparse module for taking command line argument.

Check the source code in github to stay updated.

Finds the users


def bash_users():
    with open('/etc/passwd', 'r') as fobj:
        f = fobj.readlines()
        pattern = '/bash'

        for i in f:
            m = re.search(pattern, i) #searches if the given pattern is in i
            if m:
                print("%s" % i.split(':')[4])
            else:
                pass


Finds details of the memory of your system



def memory_details():
    with open('/proc/meminfo', 'r') as fobj:
        f = fobj.readlines()
        pattern = '^Mem' #All the strings starting with Mem

        for i in f:
            m = re.search(pattern, i) #searches if the pattern is in i
            if m:
                print("%s: %d MB" % (i.split(':')[0], int(i.split()[1])/1024))  #Displays the memory in unit MB
            else:
                pass

See howitworks for a demo of Tell-me-more. Fork me on github to contribute for this project. Thank you 🙂

Making of an index page

Continuation of static site generator….

Each and every blog has an index page that contains 5-6 posts of your blog posts, like wordpress has 10 posts in the index page/ Home page by default. I used to wonder how wordpress shows only the last 10 of my posts in its index page. And yes finally I’ve figured out the way 😉 . We are working on static site generator/ static blog generator in dgplug for the last 10 days and on the last Wednesday kushal shoot an assignment of making an index page to us. His question was a bit confusing, all the folks of dgplug were really confused. Because we were not thinking what kushal was thinking, so he decided to elaborate more on this Monday.

But I couldn’t wait for 3-4 days to solve the assignment, thus guessing what kushal was thinking I finally did something and kushal finally said that it matched with at least what he thought. kushal guided me with what else I have to include in the script and I followed him. Hence I was almost done with the index page of static site generator. Let me share with you what I have done 🙂

from markdown2 import Markdown
import os

def index_page(source_path, destination, N):
    files = []
    for f in os.listdir(source_path):
        if f.endswith('.md'):
            files.append(f)
    return files
    with open(destination, 'w') as d:
        for source in files[:N]:
            with open(source, 'r') as s:
                smd = s.read()
            markdowner = Markdown()
            dest = markdowner.convert(smd)
            d.write(dest)

index_page('source_dir_path', 'index.html', 2)

This script searches for all the .md / markdown files in the source directory and makes a list of it. Then converts it to html as needed. According to this script the index page is having 2 posts.

Thanks for your time :). Can’t wait to contribute a project on static site generator in my github.

Finally the irc bot can save the channel’s logs

Finally batuli can save the channel’s logs. I can still remember the very first day when I and sanketdg joined the irc channel ##testbot to work for irc bot batuli and I asked sanketdg “Won’t batuli save the logs of the channel as batul does for dgplug?” , sanketdg replied to me “Make it save the logs if you can!”.

I couldn’t ever imagined that making batuli save the logs of the channel could be done in so simple way. Ah yes, I spent my days studying about logging module and twisted log module. And i took help of twisted log module to make batuli save the channel’s log and sent a pull request. But sanketdg told me to make it simple and he suggested me to use logging module, yes he was pretty correct. The script was looking pretty complex. Hence I started working with logging module. On the next morning suddenly an idea came to my mind. I asked myself that why I am using these logging modules to save the channel’s log, I also have other options in Python . Because, Python is such a programming language with what you can do just anything. Coding in Python is nothing but playing with it 😉 . And what I did is just append the message of user to a file. There couldn’t be any simpler way to make your bot save the logs. Let me share it with you 🙂

with open(args.filename,'a') as fobj:
    fobj.write('\n' + time.strftime('[%d-%m-%Y %H:%M:%S]') + \
            ' <' + user + '> ' + msg)

To take command line argument, I have used argparse module instead to sys module to make the command line interface more interactive with user and it was an idea of sanketdg  🙂

So I am really happy that batuli now saves the logs of ##testbot. Join our channel ##testbot on irc.freenode . Fork us on github . Follow README section to know how to use batuli , just give it a try and I am sure that you will love it 😉