Planet dgplug

July 29, 2015

Kushal Das

hdparm output from banana pi server

The question

Why did I chose a Banana pi server instead of a simple home desktop working as a storage box? This question was not only in my mind, but many of my friends asked me too.

Normally a desktop will give better performance than this ARM SOC, but that also includes more space, and money. I wanted to see how good/bad is this one compared to a desktop box I use as server (located somewhere in USA). I chose to use hdparm command to do simple testing, where I can make sense of the output.

Test on Banana Pi

[root@localhost ~]# hdparm -t /dev/sda1

/dev/sda1:
 Timing buffered disk reads: 268 MB in  3.01 seconds =  89.05 MB/sec
[root@localhost ~]# hdparm -T /dev/sda1

/dev/sda1:
 Timing cached reads:   772 MB in  2.00 seconds = 385.52 MB/sec

Test on my desktop server

[root@fedora-build ~]# hdparm -t /dev/sda1

/dev/sda1:
 Timing buffered disk reads: 434 MB in  3.01 seconds = 144.37 MB/sec
[root@fedora-build ~]# hdparm -T /dev/sda1

/dev/sda1:
 Timing cached reads:   22548 MB in  2.00 seconds = 11284.87 MB/sec

Is it too slow?

Maybe in many use cases, but not for my own backup needs.

by Kushal Das at July 29, 2015 08:52 AM

July 27, 2015

Kushal Das

Event report: FUDCon Pune 2015

Starting of the conversation

I don’t remember when I called Siddhesh for the first time to talk about organising FUDCon in India this year. But the discussion started, at first I wanted to bid with Durgapur as the venue. But after some discussion, we agreed that Pune is a better place in many cases which we want in a venue for FUDCon.

The bid and venue

I was in Kolkata, I was not directly involved with the bid. But the team did an amazing job in putting up the bid, doing many ground works. MITCoE was chosen as the venue, but we had few other college names in the list as backup.

Talk selection and website

Four of us (Siddhesh, Amit, Nipendra, and me) took the charge of selecting talks. After many long calls/videos chats we had the initial selected talk list, and it got published in the site on time. That reminds me to speak about the effort Siddhesh put up to fix our fudcon.in, I know how many sleepless nights he spent to get everything working as required.

Final ground work before event

I came down to Pune on 26th of May, and start working with rest of the organisers. My primary responsibility was related to final travel for the speakers/contributors, and doing the travel for the day of the events. Sanisoft helped us with the event schedule. Hasgeek stepped up to help with the video recording/streaming of the event.

Suprith came up as a volunteer, and he did a tremendous job while running around through out city, and getting best quotes for swag, and printing. Another super big help came from Rupali, who handled/worked on almost everything other than talk selection, and made sure that the event becomes a success

I spent two sleepless nights just before the event starts to make sure all speakers reach the hotel on time, and safely.

The event

Dennis Gilmore

Dennis Gilmore started the event with his keynote. We learned a lot about the future plans of Fedora release engineering team in that. After that we had the education panel with a opening event from the college authority.

Harish did the closing keynote on day one. Jiri did the opening keynote on day two. As you can see I am only talking about the keynotes as I was running around doing smaller tasks during the event. We also had Fedora Ambassadors APAC meeting during FUDCon.

Tenzin Chokden

The day two closing keynote was from Tenzin Chokden about the Tibetan Government and community in exile and how it safeguarded itself with help of open source tools and the Fedora community from the spying network called GhostNet. This was eye opening in different ways, showing the problems they face everyday, and about how the small contributions from the FOSS communities help them in bigger ways.

Day three was full with workshops and specialized groups. I gave a small 10 minutes talk about CentOS Cloud SIG in the Openstack track. Harish conducted an amazing workshop as GPG.

My job finished when the last speaker returned home safely. But this is not the end, we will be doing local event as follow ups to try to get more open source contributors. I was very happy to see many students who traveled more than one day to reach Pune for the event. If they continue their journey in the community, I am sure they will shine in their own career path.

Students from Amrita University

You can view the full photo set here.

Thank you volunteers

I don’t have words to praise the volunteers for the amount of work they put up for the conference. I can only say thank you all for everything. Just want to mention Siddhesh specifically. The community needs more leaders like you. I hope many will follow your path.

by Kushal Das at July 27, 2015 10:35 AM

July 26, 2015

Shakthi Kannan

International edition - i want 2 do project. tell me wat 2 do

This year, 2015, marks a decade of completion of my website shakthimaan.com! Thanks to the grace of God, the Almighty. Thanks also to my parents, friends and well-wishers for their wonderful support and encouragement over the years.

I am also happy to announce the launch of the international hard cover edition of my book, “i want 2 do project. tell me wat 2 do”, for worldwide distribution. You can order the book at:

The topics covered in the book include:

  • Mailing List Guidelines
  • Attention to Detail
  • Project Communication
  • Project Guidelines
  • Development Guidelines
  • Methodology of Work
  • Tools
  • Reading and Writing
  • Art of Making Presentations
  • Sustenance

The “Mailing List Guidelines” sample chapter is available for download from:

http://shakthimaan.com/downloads/book/chapter1.pdf

The home page for the book is at:

http://www.shakthimaan.com/what-to-do.html

Kindly forward this information to your friends who may also benefit from the same when working with free and open source software.

July 26, 2015 04:45 PM

July 23, 2015

Arpita Roy

A Month and Three Days More

Hi all :)

There was no reason for the break i took this time except one – i was a little busy with the summer training and returning back to college.
Yes , finally the “Happy Days” i was leading are over as college came back into being. The fruitful days are up :( and yes and yes that is saddest part till now.

As i discontinued writing up , i couldn’t  fully share things bout the summer training.
The topics covered after the last day were productive enough and included sessions of topics i never had quite a knowledge of.. Well , i would say i am still working on them.

DAY 7th – DAY 8th — 8th July’15 & 10th July ’15

The next sessions consisted of Version Control System.. basically Mercurial and Git.
We were given proper hands-on session to know about them and it was very properly explained as well
( I shall ( though not very soon ) ) would provide blogs on all i know about VCS as i have yet to learn a few more things.

DAY 9th – DAY 10th — 13th July’15 , 15th July’ 15 & 17th July’ 15

After VCS , Sayan and rtnpro ( their IRC nicks ) gave us details about how to create web pages.. It wont be quite tough to catch that the topics covered were – HTML and CSS.
The third was about CSS properties.
We came to know about a lot of properties used in CSS ( shall provide a blog on this too :) )
The sessions were fun and we were stuffed with all the basics of the above two :)
We successfully created our web page ( which was given as an assignment )

DAY 11th – Day 12th — 20st July’ 15 & 22nd July ‘ 15

And the most awaited , ” python” was finally introduced amongst us.
The first was just an hour session and contained only  few basics. The second day of python contained about – Functions , Modules and Looping.
Most of which i knew about and also we were given two codes to write during the session itself :)

P.S – Happy Days are yet alive as long as there is something so much exciting happening along !


by Arpita Roy at July 23, 2015 03:46 PM

July 10, 2015

Shakthi Kannan

Introduction to Haskell - Type Classes and User Defined Data Types

[Published in Open Source For You (OSFY) magazine, October 2014 edition.]

Haskell is purely a functional programming language and it enforces strictness with the use of types. In this article, we shall explore type classes and user defined data types.

Consider the elem function that takes an element of a type, a list, and returns ‘true’ if the element is a member of the list; and if not, it returns ‘false’. For example:

ghci> 2 `elem` [1, 2, 3]
True
ghci> 5 `elem` [1, 2, 3]
False

It’s type signature is shown below:

ghci> :t elem
elem :: Eq a => a -> [a] -> Bool

The type signature states that the type variable ‘a’ must be an instance of class ‘Eq’. The class constraint is specified after the ’::’ symbol and before the ‘=>’ symbol in the type signature. The elem function will thus work for all types that are instances of the Eq class.

The word ‘class’ has a different meaning in functional programming. A type class is a parameterised interface that defines functions. A type that is an instance of a type class needs to implement the defined functions of the type class. The Eq class defines functions to assert if two type values are equal or not. Its definition in Haskell is as follows:

class Eq a where
    (==), (/=)           :: a -> a -> Bool

    x /= y               = not (x == y)
    x == y               = not (x /= y)

The keyword class is used to define a type class. This is followed by the name of the class (starting with a capital letter). A type variable (‘a’ here) is written after the class name. Two functions are listed in this class for finding if two values of a type are equal or not. A minimal definition for the two functions is also provided. This code is available in libraries/ghc-prim/GHC/Classes.hs in the GHC (Glasgow Haskell Compiler) source code.

The example works for integers ‘2’ and ‘5’ in the example above, because they are of type Int, which is an instance of Eq. Its corresponding definition is given below:

instance Eq Int where
    (==) = eqInt
    (/=) = neInt

The keyword instance is used in the definition followed by the name of the class Eq, and a specific type Int. It uses two primitive functions eqInt and neInt for checking if the given integers are equal or not. The detailed definition is available in libraries/ghc-prim/GHC/Classes.hs in the GHC source code.

There are a number of pre-defined type classes available in the Haskell platform.

The Ord type class denotes types that can be compared. The compare function will need to be implemented by types that want to be instances of this class. The resultant values of ‘compare’ are GT, LT, or EQ. For example:

ghci> 'p' > 'q'
False
ghci> 3 > 2
True

Its type class definition is as follows:

class (Eq a) => Ord a where
    compare              :: a -> a -> Ordering
    (<), (<=), (>), (>=) :: a -> a -> Bool
    max, min             :: a -> a -> a

    compare x y = if x == y then EQ
                  else if x <= y then LT
                  else GT

    x <  y = case compare x y of { LT -> True;  _ -> False }
    x <= y = case compare x y of { GT -> False; _ -> True }
    x >  y = case compare x y of { GT -> True;  _ -> False }
    x >= y = case compare x y of { LT -> False; _ -> True }

    max x y = if x <= y then y else x
    min x y = if x <= y then x else y

The Ord type class needs to be a sub-class of the Eq class because we should be able to test for equality of two values if they need to be compared. This is also defined as a constraint in the class definition. Seven functions are provided and a minimal definition given in the code snippet. The instance definitions for Char and Int types are available from libraries/ghc-prim/GHC/Classes.hs in the GHC source code.

The Enum type class is for types whose values can be listed in an order for which you can find predecessor and successor elements. For example:

ghci> succ 'a'
b
ghci> pred EQ
LT

The class definition for Enum is given below:

class Enum a where
    succ                :: a -> a
    pred                :: a -> a
    toEnum              :: Int -> a
    fromEnum            :: a -> Int

    enumFrom            :: a -> [a]
    enumFromThen        :: a -> a -> [a]
    enumFromTo          :: a -> a -> [a]
    enumFromThenTo      :: a -> a -> a -> [a]

    succ                   = toEnum . (+ 1)  . fromEnum
    pred                   = toEnum . (subtract 1) . fromEnum
    enumFrom x             = map toEnum [fromEnum x ..]
    enumFromThen x y       = map toEnum [fromEnum x, fromEnum y ..]
    enumFromTo x y         = map toEnum [fromEnum x .. fromEnum y]
    enumFromThenTo x1 x2 y = map toEnum [fromEnum x1, fromEnum x2 .. fromEnum y]

The instance for type Ordering for the Enum class is as follows:

instance Enum Ordering where
  succ LT = EQ
  succ EQ = GT
  succ GT = error "Prelude.Enum.Ordering.succ: bad argument"

  pred GT = EQ
  pred EQ = LT
  pred LT = error "Prelude.Enum.Ordering.pred: bad argument"

  toEnum n | n == 0 = LT
           | n == 1 = EQ
           | n == 2 = GT
  toEnum _ = error "Prelude.Enum.Ordering.toEnum: bad argument"

  fromEnum LT = 0
  fromEnum EQ = 1
  fromEnum GT = 2

  -- Use defaults for the rest
  enumFrom     = boundedEnumFrom
  enumFromThen = boundedEnumFromThen

You can find the definition and instance definitions for Char and Ordering in libraries/base/GHC/Enum.lhs in the GHC source code.

The Show type class lists a show function to display or print data. For example:

ghci> show 3.1415
"3.1415
ghci> show True
"True"

The above code works for both ‘Float’ and ‘Bool’ because there are instance definitions for each in the Show type class.

The read function for the ‘Read’ type class takes as input a ‘String’ and converts it to an appropriate data type, if possible. For example:

ghci> read "1" + 2.0
3.0
ghci> read "False" || True
True

You will find the class definitions and instances for Show and Read in libraries/base/GHC/Show.lhs and libraries/base/GHC/Read.lhs respectively. The .lhs file is a literate Haskell source file in which you can combine both text and code. You can also find the definition for a class, a function or type inside GHCi using ’:i’. For example:

ghci> :i Eq
class Eq a where
  (==) :: a -> a -> Bool
  (/=) :: a -> a -> Bool
  	-- Defined in `GHC.Classes'
instance Eq Integer -- Defined in `integer-gmp:GHC.Integer.Type'
instance Eq Ordering -- Defined in `GHC.Classes'
instance Eq Int -- Defined in `GHC.Classes'
instance Eq Float -- Defined in `GHC.Classes'
instance Eq Double -- Defined in `GHC.Classes'
instance Eq Char -- Defined in `GHC.Classes'
instance Eq Bool -- Defined in `GHC.Classes'
...

ghci> :i read
read :: Read a => String -> a 	-- Defined in `Text.Read'

ghci> :i Int
data Int = GHC.Types.I# GHC.Prim.Int# 	-- Defined in `GHC.Types'
instance Bounded Int -- Defined in `GHC.Enum'
instance Enum Int -- Defined in `GHC.Enum'
instance Eq Int -- Defined in `GHC.Classes'
instance Integral Int -- Defined in `GHC.Real'
instance Num Int -- Defined in `GHC.Num'
instance Ord Int -- Defined in `GHC.Classes'
instance Read Int -- Defined in `GHC.Read'
instance Real Int -- Defined in `GHC.Real'
instance Show Int -- Defined in `GHC.Show'

Let’s suppose you input the following in a GHCi prompt:

ghci> read "3"

<interactive>:5:1:
    No instance for (Read a0) arising from a use of `read'
    The type variable `a0' is ambiguous
    Possible fix: add a type signature that fixes these type variable(s)
    Note: there are several potential instances:
      instance Read () -- Defined in `GHC.Read'
      instance (Read a, Read b) => Read (a, b) -- Defined in `GHC.Read'
      instance (Read a, Read b, Read c) => Read (a, b, c)
        -- Defined in `GHC.Read'
      ...plus 25 others
    In the expression: read "3"
    In an equation for `it': it = read "3"

The interpreter does not know what type to convert ‘3’ to, and hence you will need to explicitly specify the type:

ghci> read "3" :: Int
3
ghci> read "3" :: Float
3.0

A type synonym is an alias that you can use for a type. ‘String’ in the Haskell platform is an array of characters defined using the type keyword:

type String = [Char]

You can also create a new user data type using the data keyword. Consider a Weekday data type that has the list of days in a week:

data Weekday = Monday
             | Tuesday
             | Wednesday
             | Thursday
             | Friday
             | Saturday
             | Sunday

The data keyword is followed by the name of the data type, starting with a capital letter. After the ‘equal to’ (‘=’) sign, the various value constructors are listed. The different constructors are separated by a pipe (‘|’) symbol.

If you load the above data type in GHCi, you can test the value constructors:

ghci> :t Monday
Monday :: Weekday

Each value constructor can have many type values. The user defined data type can also derive from type classes. Since the primitive data types already derive from the basic type classes, the user defined data types can also be derived. Otherwise, you will need to write instance definitions for the same. The following is an example for a user data type ‘Date’ that derives from the ‘Show’ type class for displaying the date:

data Date = Int String Int deriving (Show)

Loading the above in GHCi, you get:

ghci> Date 3 "September" 2014 
Date 3 "September" 2014

The above code will work even if we swap the year and day because the syntax is correct but the semantics are not!

ghci> Date 2014 "September" 3 
Date 2014 "September" 3

You can also use the record syntax that can give you helper functions:

data Date = Date { day :: Int
                 , month :: String         
                 , year :: Int
                 }

This gives you three helper functions to retrieve the day, month and year from a ‘Date’.

ghci> let d = Date {day = 14, month = "September", year = 2014}
ghci> day d
14
ghci> month d
"September"

You can also make data type definition more explicit with types:

data Date = Date Day Month Year deriving (Show)

type Year = Int

type Day = Int

data Month = January 
     | February
     | March
     | April
     | May
     | June
     | July
     | August
     | September
     | October
     | November
     | December
     deriving (Show)

Loading the above in GHCi, you can use:

ghci> Date 3 September 2014
Date 3 September 2014

To support printing the date in a specific format, you can implement an instance for the ‘Show’ type class. You can also add a check to ensure that the day is within a range, and the year and day cannot be swapped:

instance Show Date where
    show (Date d m y)
         | d > 0 && d <= 31 = (show d ++ " " ++ show m ++ " " ++ show y)
         | otherwise = error "Invalid day"

Loading the code in GHCi, and running the following:

ghci> show (Date 3 September 2014)
"3 September 2014"
ghci> show (Date 2014 September 2)
"*** Exception: Invalid day

Suppose, you wish to support different Gregorian date formats, you can define a data type GregorianDate as follows:

data GregorianDate = DMY Day Month Year | YMD Year Month Day

You can also define your own type classes for functions that define their own behaviour. For example, if you wish to dump the output of a date that is separated by dashes, you can write a ‘Dashed’ class with a dash function.

class Dashed a where
    dash :: a -> String

instance Dashed Date where
    dash (Date d m y) = show d ++ "-" ++ show m ++ "-" ++ show y

Testing the above in GHCi will give the following output:

ghci> dash (Date 14 September 2014)
"14-September-2014"

Haskell allows you to define recursive data types also. A parameterized list is defined as:

data List a = Empty | Cons a (List a) deriving (Show)

Lists for the above definition can be created in GHCi, using the following commands:

ghci> Empty
Empty
ghci> (Cons 3 (Cons 2 (Cons 1 Empty)))
(Cons 3 (Cons 2 (Cons 1 Empty)))

July 10, 2015 10:45 PM

July 09, 2015

Sayan Chowdhury

Fedora Meetup 2015

Fedora July Meetup 2015 happened at Hasgeek office, Indiranagar on July 04, 2015 at 06:30 PM.

Attendees:

  • Sayan Chowdhury
  • Ratnadeep Debnath
  • Lalatendu Mohanty
  • Nitish Bharadwaj
  • Devyani Kota
  • Praseetha KR
  • Sharat MR

Topics discussed:

  • Introduction to Fedora and what's new in Fedora 22
  • Reproduce Bugs on Vagrant(libvrt) and identify missing features
  • Introduction to RPM Packaging
  • Fedora Hubs

It's good to know more and more people are turning up for the meetup. I would like to thanks Hasgeek for giving us space to host our event. Stay tuned for updates on Fedora India mailing list .

See you, next month!.

July 09, 2015 10:48 PM

FUDCon India 2015

I spent the last weekend of June at FUDCon India. FUDCon is the Fedora Users and Developers Conference organized in different parts of the world. The last FUDCon APAC that happened in India was in 2011 which i could not attend because of my college. Being a Fedora user for 6 years now I always wanted to attend one FUDCon. FUDCon APAC this year was held at MIT College of Enginnering Pune.

I submitted talks on "fedmsg" and an 101 workshop on Flask. Flask being one of the primary framework in most of the fedora-infra project. rtnpro and I thought of introducing the guys with basics of Flask and how to get started with Fedora Infra

Day 0

rtnpro and I reached Pune late night.

Day 1

I reached the venue MITCoE pretty early at around 7:30am. I helped the voluteer setups the standees. The event started with the key note by Dennis Gilmore on Delivering Fedora for everything and everyone. The keynote was followed by Education Panel where the panel discussed on open source and education.

After that I headed to attend the talks on DNF. Parag gave an introduction to fedora's new package manager and how it was architecture was re-built

Vaidik in his talk on Vagrant for Effective DevOps Culture talked on how Wingify utilizes vagrant for setting up their dev environment close to the prod environment.

After the talk I headed over to the speaker's lounge and worked on my talk presentation.

The last talk that I attended was Introduction to networkd.

Day 2

The day started with a really good talk by Jiri Eishchmann on Present and Future of Fedora Workstation

He discussed on what all it takes to ship a Fedora Workstation. He also told that MP3 patent expires this September, so Linux distributions like Fedora can start playing MP3s by default. This was a good news. Later after the talk I discussed with him the issues of gaming in Fedora.

The talk was followed by tuxology talk on Kernel and Userspace Tracing with LTTng and Friends and rejy's talk on Be Secure with SELinux Gyan. Need to say the talk and the presentation was really good.

nigelb's talked on how to start contributing to Mozilla.

After that I had my talk lined up. I spoke on the

  • How Fedora Infrastructure leverages the Fedmsg(Federated Message Bus)?
  • How Fedmsg works?
  • Projects on top of Fedmsg
  • How to start working on Fedmsg?

In the hallway I spoke with juhp on how to get started with Haskell and the projects in fedora that I can start helping.

After my talk I attended the talk on Getting Started with IOT development using Fedora on ARM by Rajesh and Achieving Community Goals with Fedora by Tenzin.

After the conference, speakers and volunteers headed for the FUDPub. The FUDPub was total fun.

A re-quote from FUDPub 2011 "Best FUDPub Ever" - Jared Smith :)

Day 3

The day started at the speaker lounge with me writing a Telegram bot to push the fedmsg messages to the application. Praveen Kumar and I worked some some vim and flask thingy too.

After that I moved over for the workshop. rtnpro and I gave a Flask 101 workshop and how to search for easyfixes in the fedora infra. Due to lack to time we could needed to skip a few topics. But the workshop turned out to a good one.

Post lunch I created my GPG key. I created many of them in the past but never kept a backup of any :( I got to know what's actually is a key-signing party.

Finally Rupali gave a thank you speech to all those who made FUDCon India 2015 successful. Kudos to all the participants, speakers and volunteers who made this event a grand success. In the end - I am really happy to be part of such a great event where I got to meet so many fedora contributors and learnt so many things in a matter of three days.

More pics coming soon :)

July 09, 2015 04:29 PM

July 07, 2015

Arpita Roy

Ignited :D

:) :) :)

And yes , i am bearing this smile right now ( there is no reason being sad anymore )
This is Happiness afterall – A long summer holiday where you get a spare time after lots of struggle , sit with your laptop and read and read and read :)

DAY 6 – 6th July ‘ 2015

Today was the first hands-on session we had.
Though i found all the sessions amazing so far , but today was cherry on the top :)
We were provided an email to get *python-sphinx* on our systems.
Today’s session was all about documentation and not a lot of efforts was required to do that ( i mean to create our first documentation ) using sphinx. It was fun and every dgplug member enjoyed ( observed it from the feedback )
Here is a little more about sphinx – http://sphinx-doc.org/tutorial.html#setting-up-the-documentation-sources ( This is what i went through ) to know more bits of sphinx.

P.S – Looking forward for a new day , that involves more learning :)


by Arpita Roy at July 07, 2015 02:57 PM

June 25, 2015

Samikshan Bairagya

Travelling to FUDCon, Pune 2015

Right now I’m at Kempegowda International Airport, Bengaluru looking forward to spending an exciting weekend at FUDCon, Pune. It seems my flight is delayed by almost an hour and this is a good time to have a look at the schedule more closely. Why am I looking forward to an ‘exciting’ weekend at Pune? Well, just have a look at the schedule and you’ll understand why. The schedule is packed with a wide range of talks and workshops on really interesting topics.

For a conference having such an interesting schedule its important to prepare a schedule of your own to try and take back as much as possible. This is a screenshot of my schedule for the next 3days. Oh! And I haven’t mentioned that I’m looking forward to FUDPub too that is scheduled on Saturday evening IIRC. ;)

My FUDCon Pune schedule

I myself would be talking on kernel ABI breakages along with an introduction to how its stability is tracked through genksyms currently and how an alternative could be possible through spartakus. That would be tomorrow after at 12:30 pm. I really hope my talk can live up to the standards that will be set by other speakers.

I guess its time to check-in for my flight now. Also the free WiFi is almost timed out. So see you at FUDCon, Pune 2015.


by Samikshan Bairagya at June 25, 2015 03:14 PM

June 19, 2015

Subho

My Final Year Project aka Online FIR/GD lodging system.

Hello all, this post will be a small one. I will be discussing about my College Final Year project in here. The topic for my project was Online FIR/GD Lodging System. Since I have worked with Flask before, I chose Django 1.8 to try something new. Learning the basics of Django wasn’t much difficult. Now my college stuff is over but i have decided to add on a few more features.

about THE Application

Its a simple web-app with a Form to fill up the details necessary for lodging an FIR/GD. The main problem with this kind of application is the identity of the user.So to properly identify i decided to use approved ID Proofs by the Government for different organizations i.e Voter ID Number, Aadhaar ID Number, Ration Card Number, PAN Card Number. Obviously this a prototype so I had the freedom to use dummy data for users Aadhaar, Voter and PAN card in database tables. For Practical implementation it surely needs access to the above mentioned databases from the government. So a user can choose any two ID proof out of the 4 and fill in the details. The two ID card data must have same name and birth date for the user to be identified. Next the Report(FIR/GD) form is to be filled by the person. Also currently he needs to explicitly select the Police Station he wants to lodge the report to. According to the city and state the police stations gets shortlisted. Next the form is submitted. I did not use User Auth in this application. We already have the user identity but we need ways to contact the user, hence phone number and email needs to be filled in the Form. Next comes the verification of mobile number. I really didn’t want to spend much on this so decided to use Site2SMS API which allows you to send limited Free SMS. So sending OTP via Site2SMS API. Since the OTP are short-lived (5 minutes) i decided not to use database to avoid overhead due to frequent writes and decided to use Redis instead. The TTL feature made my work of expiring OTPs easy. Finally sending a pdf document report via email. I used xhtml2pdf to generate the pdf’s and again saving money by using Gmail for sending out emails. ;) That pretty much sums up the application. You can check out the SourceCode.

Future Plans

– Right now all I have done is for the user who wants to lodge an FIR/GD. The police portal exists but the Reports are not updated instantly. I am planning to use Django Signals to work with django-socketio to update the new Reports instantly just after they are inserted into database.

– Chalk out a way to automatically register the FIR/GD to the correct police station depending on the location of event

– This can be most handy when used as a mobile application. So either create an API and mobile application or make the design responsive to suit any device.

– And finally to write Unit tests. ( This is my new year resolution) :P

P.S.- Suggest some cool name for this app.
P.P.S.- You are most welcome to request a feature or add a feature and send a PR on Github.

This year Fudcon is from 26th. Will be attending it and maybe meeting some of you. Next post will be on FUDCON 2015. Till then Happy Coding. :)


by subho at June 19, 2015 08:04 PM

June 01, 2015

Arun Sag

Note to self: Resizing byobu to terminal size (tmux)

Often byobu reattaches to old session where the tmux windows are smaller than the terminal size

KaGZa

To fit the tmux window to terminal size run

Ctrl+a :attach -d

Reference: https://superuser.com/questions/905954/tmux-detaches-from-one-side-when-force-to-adjust-redimension


by sagarun at June 01, 2015 05:58 PM

April 26, 2015

Chandan Kumar

[Event Report] April Python Pune Meetup 26th April, 2015

After a successful Python Sprint in March, 2015, we hosted April Python Pune meetup, 2015 on 26th April, 2015 at Zlemma Analytics Pvt. Ltd., Baner Road, Pune (India). This meetup focused on python packaging workshop, writing simple automation scripts using fabric and interacting with MySQL and sqlite database using python.

About 35 people attended this meetup. Most of them were professionals.

The meetup started at 10:30 A.M. with package your python code workshop where we explained :

  • Why should i package my python code
  • Tools Required for packaging
  • Get familiar with pip, virtualenv and setuptools
  • Python Project Structure
  • Create a dummy project and package it
  • Create a source distribution
  • Register yourself on Pypi and upload package.

For that i had created a dummy project myls <https://pypi.python.org/pypi/myls/0.0.1> and explained the above steps.

After a small break, Suprith presented a talk on "My first automation script using Fabric". He started by introducing what is fabric, how it is different from other automation tools like Ansible, salt, puppet and chef and showed how to use fabric to write simple automation script.

https://pbs.twimg.com/media/CDf_rKNVIAAKnFL.jpg

The last talk was presented by Tejas on how to interact with MySQL and sqlite database using python and how to add crawled data from a website using beautifulsoap and crawler and store in the database. Here is the source code of the above demo.

https://pbs.twimg.com/media/CDgGP0qUsAAyxm9.jpg

By 01:30 P.M., Suraj had demonstrated his cool python application speedup, a simple python program to speedup internet speed on your LAN and Hardik demonstrated about his final year project on how to scan new virus on a windows machine by reading system calls over .exe files and analyzing those calls using data mining.

https://pbs.twimg.com/media/CDgPNOZVIAAU1d6.jpg

Finally, this awesome meetup came to an end at 02:00 P.M.

Below is the upcoming plan of 3 month meetup i.e from May, 2015 to July, 2015.

  • Workshop/Talk on Flask, Data Analytics, Automation using selinium and Robots and Security
  • Hackathon - Craft your idea into a real program and contribute to your favorite upstream OpenSource Python project.

Thanks to Ajit Nipunge and Zlemma for providing the venue arrangements, speakers and attendees who made the meetup successful.

https://scontent-ams.xx.fbcdn.net/hphotos-xfp1/v/t1.0-9/11022545_1096377710379800_7168577211865849237_n.jpg?oh=59e8e4bbdcbb8191e8e198e356474ff2&oe=559C630F
https://fbcdn-sphotos-d-a.akamaihd.net/hphotos-ak-xpa1/v/t1.0-9/11196286_1096377740379797_1897433608276007575_n.jpg?oh=99eb2ba9f513930113cc74d7e1cc27f7&oe=55E1DBF6&__gda__=1440951708_bb0a1c3eb8a6b4550de09ce67f7f6b8b

by Chandan Kumar at April 26, 2015 05:23 PM

April 24, 2015

Sanjiban Bairagya

My experiences at conf.kde.in 2015

Last year I really wanted to attend conf.kde.in but couldn’t because my train tickets were not confirmed by the time it started. So, I had made up my mind right then, that I will definitely attend it the next year by all means. So, this year I applied and was accepted as a speaker too. But tragedy struck again, when some college issues clashed with the date of my flight, so I had to reschedule it once, and then one more time due to one more clash, after which I could finally reach Amritapuri in the evening of Day 1 of conference when it was already over. So, yes I was sad as I had missed the first day, but that also meant that I should make the best of the second day for sure.

The second day of conference started with some great south-Indian breakfast, where I met up with some of the important people like Shantanu, Sinny, Pradeepto and others. The first talk for that day was supposed to start from around 10:00 am, and I was the one to speak in it. I spoke on the ‘Interactive Tours’ feature that I had implemented in Marble last year, and it was pretty well received (I hope). My talk was followed by the rest of the other talks of the day, which were all pretty awesome, and very interesting as well. I got to meet Devaja, Rishab, Pinak, and the rest of the speakers during the talks, and I loved to interact with each one of them.

metalk

metalkside

melisten

After a couple of talks after mine, I was asked by Sinny Kumari whether I would like to volunteer in a qml workshop which was being held in one of the labs. I didn’t wanna miss this opportunity, so I said “yes”, and went to the lab with her. The workshop started in a few moments, after everyone settled down. It was Shantanu who was explaining most of the stuff, using his computer screen as a projection, with me, Sinny, Pradeepto and Pinak helping the attendees in their computers in case they needed help or had some query. It was a very productive session, amazingly led by Shantanu, and I loved every moment that was spent in it.

Well, the day ended with an awesome lunch, and a few more talks for the day. We were often approached by students from their college, asking us about our experiences with KDE, and how to start contributing. I answered them with my personal experience with Marble, and it went really well, with some good feedback from both parties. People were very enthusiastic and I loved spending time and exchanging information with them. After the end of all the talks, we went out for some sightseeing, rode a boat :P , saw some awesome views from a high building rooftop, went to the beach, had lots and lots of fun.

group

groupbeach

and then finally came back, where we were invited to a lab, where each of the speakers and the students were saying their last viewpoints about the conference, what they liked about it, what could be improved. We told them about our awesome experience and that we would love to come back here again. Speakers who were still in college were asked how they keep open-source contributions alive in their respective institutions, I told them about our the GNU/Linux users’ group of my college and the events that are organized by it. Pradeepto told us some really interesting and funny stories about KDE, which were really both fun and motivational to listen to.

last2

last3

After all was said and done, all the speakers were given a certificate of appreciation, along with some books, and we walked back to the guesthouse. We had our very final celebration at night after returning back, with an awesome chicken and beer party in one of the rooms, till 1:30 am in the night. I think it would be fair to say that this was the best day of my life, and I am very glad to have bunked Durgapur for my flight the previous day, otherwise I would have missed out on all of these amazing moments, which have now turned into memories for life. Thanks to KDE, and especially to Dennis, without whom I wouldn’t even be in this position right now. Thanks to the organizers of conf.kde.in and everyone else associated with it, for making my day special. I would love to come back to the next conf.kde.in and the next and the next. Thanks a lot! :)


by sanjibanbairagya at April 24, 2015 05:29 AM

April 18, 2015

Souradeep De

Disabling an nvidia graphics card with bbswitch on Fedora

bbswitch is a kernel module which automatically detects the required ACPI calls for two kinds of Optimus laptops. It has been verified to work with “real” Optimus and “legacy” Optimus laptops.

kernel-headers and kernel-devel are needed to install bbswitch with dkms. Now, installing with dkms ensures that bbswitch is going to survive future kernel upgrades.

sudo yum install kernel-headers kernel-devel dkms

Download the latest stable version of bbswitch, extract, and install with dkms.

wget https://github.com/downloads/Bumblebee-Project/bbswitch/bbswitch-0.5.tar.gz
tar -xf bbswitch-0.5.tar.gz
cd bbswitch-0.5
sudo make -f Makefile.dkms

The nouveau driver needs to be unloaded before bbswitch can be loaded. If nouveau driver is being used somewhere, then the way around is to blacklist nouveau, and rebuild initramfs.

A simple lsmod can reveal if nouveau driver is being used:

lsmod | grep nouveau

You can also try unloading nouveau:

sudo modprobe -r nouveau

If the above fails, we are heading over to blacklisting nouveau and rebuilding initramfs.

su -c "echo 'blacklist nouveau' >> /etc/modprobe.d/disable-nouveau.conf"
sudo mv /boot/initramfs-$(uname -r).img /boot/initramfs-$(uname -r)-nouveau.img
sudo dracut --omit-drivers nouveau /boot/initramfs-$(uname -r).img $(uname -r)

If all goes well, reboot.

Nouveau driver can now be easily removed and bbswitch can be loaded once the system has restarted.

sudo modprobe -r nouveau
sudo modprobe bbswitch

Once, bbswitch is loaded, disabling and enabling the graphics card is just a walk in the park:

sudo tee /proc/acpi/bbswitch <<< OFF    # disable
sudo tee /proc/acpi/bbswitch <<< ON     # enable

Verifying the status of the card is as easy as:

cat /proc/acpi/bbswitch

Filed under: General, Tweaks Tagged: bbswitch, nvidia

by desouradeep at April 18, 2015 08:54 PM