Monday, September 2, 2013

11th Week at OpenMRS

This week I mostly work with query view which allows manager to filter out record with given constraints. So after this feature, functionality wise module  works finished.I have small UX improvements as suggest by my mentor. Hope to finish up small UX changes in up coming weeks with documentation about the project.Please find query view UI below.

Monday, August 26, 2013

10th week at OpenMRS

This week has been a busy week for me.But I have managed to finish up the change key views in my module.Main functionality of these views is to enable manager to change the key associated with a integrity check.Through my module, default keys are assigned.But later if manager need to changes a key, it can be achieve via this views. I'm now currently working on custom query view implementations.Please find change key view snapshots below.
Key List
Change Key

Friday, August 23, 2013

Linux: Kill a process listening to a port

Some times we need to kill processes listening to a some port.More often address already in use messages occur due to some process already listening to a given port.

Method 1:
If you want to use backtick not regular tick

sudo kill 'sudo lsof -t -i:port' 

Eg: sudo kill 'sudo lsof -t -i:9000' //Kill process listnining to port 9000

Method 2: 
Some times above method doesn't work then you can use $() for command interpolation

sudo kill $(sudo lsof -t -i:port)

Eg: kill $(sudo lsof -t -i:9000) //Kill process listnining to port 9000

Sunday, August 18, 2013

9th Week at OpenMRS

During this week I have work on views for adding workflow stages and generating keys for integrity checks. For a integrity check, it's required to have a unique key for identify the each integrity check separately. I implemented this feature during this week.Another feature is that now manager is able to adding and customizing existing workflow stages in the module. Next week I'm planning to work on querying number of checks by set of constrains. See attached image to see the new views.

Integrity Check Key
Add workflow stages

Sunday, August 11, 2013

8th Week at OpenMRS

During this week I had worked on improving the UI and extra functions as discussed with during the meeting help on week before previous week. I have done the changes to history view of the page and now manager able to track of sequence of events associated with a particular record with time. Currently i'm engaged in generating a key for a integrity check which will be more useful in identify assigned records for a particular user by check key. Then user can distinguished records of distinct integrity checks clearly. Find my history view changes in below screenshot.
History View

Sunday, August 4, 2013

7th Week at OpenMRS

Happy Happy Happy!. Got the no reply mail saying you have successfully  passed the mid term evaluations. It's a result of weeks of hard works. I would like to thank my mentor Jeremy Keiper for guide and help me to success this project also I would like to thank my backup mentor Ada Yeung. Then I would like to thank all members in  OpenMRS developer community. We had mid term presentation during  Thursday. All the students presented their project works in front of OpenMRS team.Also we students got feedback for improve their project works. This is my first ever formal online presentation other than our first introductory session. Many thanks goes to Micheal Downy the in-charge of GSoC events of OpenMRS for organize this session. During that week I  prepared my presentation slides and created a video for project's functionality demonstration purposes. It has been a busy happy week. Please find resources for mid term presentations below.

Presentation :
Youtube video :

Sunday, July 28, 2013

6th Week at OpenMRS

This week is a busy week for me since i had our careers fair at university. Meanwhile i'm readying for the interviews, I have start work on check summary view of my module.In this view managerial level person can see the summary of the check assignments. Summary include user wise check summary, record stages wise summary and record status wise summary. Please find my screenshot below to get a clear understanding about how it works. Oh! Mid term evaluations!

Check Summary View

Sunday, July 21, 2013

5th Week at OpenMRS

Time flies and we have completed the 5th week at GSoC. During this week I have work on improving the record view of my module. I have finalized the database schema for my module. I have done changes to the views of the module according to the feedback received at the discussion with my primary mentor and the backup mentor. Past week I have refresh my knowledge in JQuery and learn new things to improve my user interface. I have added the record view of the integrity record below. Next week I'm planning to work in providing summaries for records with the time. Managerial level person will be mostly benefited from the summary feature. Mid evaluations coming closer and closer.Need to get ready :D !
Figure 1  :Record View

Saturday, July 13, 2013

4th Week at OpenMRS

It has been closed to a month since GSoC coding period started. This week I mostly engage in finalizing the data tables required to the module.During this week I have able to setup the database for my module. I have faced some problems during the initialization of the database.But with the good documentations available in the OpenMRS wiki and the community support it won't be a much problem to me to figure out and fix the issues.Meanwhile I have implement my service layer of the module. I  finished the manager view implementation of my module. My mentor Jeremy Keiper and backup mentor Ada Yeung had a wonderful discussion about the views of the module.I had a great feedback during our discussion.Now I continue to do modification required in the module according to the received feedback. Figure 1 shows the manager view UI of my module which enables managers to assign records to users to follow up and fix the data integrity violations in the openmrs database. Apart from assigning users, manager can remove assignees, track progress of a record through record summary view and summary of the whole check. Busy weeks coming ahead. 

Saturday, July 6, 2013

3rd Week at OpenMRS

This week is a fine week for me.I have studied about the configurations of a module of OpenMRS.As I previously mentioned in the post, for a module there will be a service layer and hibernate data access layer. For a module there are 4 major types of configuration files available. Please find the details of each configuration files. All the configurations are in the omod module's resources folder.

  • Config XML (config.xml)
This is the main configuration file of a module which is in XML language.In here module developer need to mention about about the module id,name,version,package,author,description,activator,updateURL as main configurations. Please find Figure 1  for more descriptive information about this configuration.

Figure 1:config.xml
  • Module application context xml (moduleApplicationContext.xml)
This is the configuration file where developer need to mention about the web pages and web controllers mappings.Also in this section spring bean settings for services  need to be configured.

  • Liquibase (liquibase.xml)
This is the major configuration of databases.All the database table creations and adding constraints for the database tables according to the database design is need to be specify here.
  • Hibernate mapping files
Developer need to map the Pojo classes to the hibernate configurations.There will be hibernate classes for each pojo class.

Last I need to mention about the message property files in resource folder which used for the internationalization purposes.Developer need to include strings displayed in the web pages as property file entries and refer them through spring.

This week I have created my pojo classes and my manager front end. Busy weeks coming ahead.I always trying to give valuable information about module creating on each of my blog posts. 

Saturday, June 29, 2013

2nd Week at OpenMRS

It has been a two weeks gone in the GSoC coding period. Time running really fast. This week we had a GSoC project introduction session in the OpenMRS. We have to give a short introduction about out project in the OpenMRS weekly development forum.It has been a wonderful experience for me to give a online presentation through Adobe Connect. There are GSoC interns all around the world in the OpenMRS. It always good to know them and build a friendship each other.

My primary mentor Jeremy Keiper always guide me  with the project. This week I have setup my module.

In a openmrs module, there are two major packages are inside a openmrs module. They are known as "api" and the "omod". Module is more like a web application. "api" packages is the location which module contains non-web java classes. Mostly "api" package contains, data access classes of hibernate and spring bean services. "omod" package contains web related jsp files and controller classes. Controller classes use services expose from the "api" to build the presentation logic.

 There are two major ways of building a openmrs module.

  1. Using maven module archetype
Openmrs has extention for maven to create the structure of a module.Using this way,user can quickly build a openmrs module. Please refer to [1].

    2. Using basic module at openmrs git repository
Basic module available at openmrs repositories gives a structure of a module.User can clone the basic module and do necessary changes to the configurations to built their own module.(I use this way)
Please find basic module at github in [2]

You can see the following structure in a module as in figure 1;

Finally I have created my module at it's working. Busy days comes ahead. 
My module is available at [3].

Monday, June 24, 2013

1st Week at OpenMRS-The OpenMRS architecute

The June 17th is the beginning of the coding period of the GSoC.  Since this is my first GSoC it's bit of excited. Past couple of weeks I have followed couple of Spring and Hibernate tutorials to get familiar with Spring and Hibernate frameworks in order to develop my module. There is good Spring MVC tutorial find in [0]  and good hibernate tutorial can be find in [1]. Apart from that to get a good understanding about the OpenMRS,I have recommend you to follow tutorials available in [2] which are use in EHSDI training course.

During the first week I had a call with my primary mentor Jeremy and backup mentor Ada Yeung about the project.It was very successful and both mentors are really helpful.It's always nice to work with OpenMRS team. I think it's very helpful for any new comer to having understand about overall understanding about OpenMRS.Figure 1 shows the overally architecture of OpenMRS core. OpenMRS is a heavy data dependent application.

OpenMRS use hibernate as the data access framework.Hibernate framework is one of heavily adopted framework for implement the data access layer of many application.Hibernate provide high degree of standardization to the application.Then Spring framework use for implement the service layer. Spring
provides a comprehensive programming and configuration model for modern Java-based enterprise application[4].

Spring MVC architecture use to implement the front end user interfaces of the OpenMRS. OpenMRS is not a just a single application,it's comes with set of modules which are use in different services.As Figure 1 shows,there are set of core modules which are implement on top of OpenMRS core services.Anyone can implement a custom module using core services of OpenMRS.For more information about module creation please refer to the [5].

Figure 1:OpenMRS core architecture

Finally for anyone interested in my project,please find my project page in [3].More updates and UI mock ups and diagrams there in the project page.Next week I'm planning to study about the module setup.I will provide details about setting up a OpenMRS module next week.


Saturday, June 15, 2013

My GSoC project proposal for Data Integrity Workflow Module to OpenMRS


I still remember the first day I got to know about openMRS. It was the “WSO2 Con 2013” conference where Dr.Sanjeewa Weerwarna talked about the highly successive open source software in the world. There he talked about impact created by open source software while highlighting community service software such as openMRS and Sahana. That is the beginning of my thinking about contributing to openMRS. Personally I'm a person who likes to help for people. I am amazed with the impact to the society by the openMRS specially in African countries.I have involved in the openMRS community during past two months and was able to contribute to openMRS by solving some tickets with my potential. I must appreciate the help that was given by the community when I was approaching a ticket. Community is very friendly, very helpful and well experienced. Data security has been a major interested area of mine. I have gained a pretty good knowledge when I was discussing about solving tickets. I understand the fact that doing a GSoC project is not enough to contribute to openMRS for enhance people's lives but also the person has to be a part of the community while developing openMRS. Every contribution has a potential of saving life of a patient at least for extra one millisecond .I will definitely continue contributing to openMRS .GsoC will be just a start and a side kick for a long journey with openMRS. I am always be inspired by your moto “Write Code. Save lives.”

Community Interaction

I have been a member of openMRS since February this year.Since that I contributed to openMRS by solving JIRA issues and answering the questions raised in the mailing discussions and also in the IRC chat discusstions.I have gained a good experience while i’m learning new frameworks such as Spring and Hibernate.My goal is to be a long term contributer at the community.I have listed the JIRA issues which I involved at the past.Since I prety much interesting in Data technologies and Web services,I mostly participate in solving REST module and SYNC module tickets.It has been a remarkable experience.I will continue my interaction with the community by making all my works transparent throughout this project and I will also give my best effort in successing this project with having goal of helping people for giving them a better life.

1. Who are you? What are you studying?

I'm Harsha Kumara. I'm a final year undergraduate of Department of Computer Science and Engineering of University of Moratuwa, Sri Lanka.

I’m a fast learner, having good innovative and interpersonal skills.I am a person who loves to take challenges and work hard to achieve them. I’m a highly passionate about FOSS, also interested in SOA,Web services,Data security,cloud computing and distributed systems.

My Blog :

2. Please provide the URL to your wiki personal space.

3. Why are you the right person for this task?

I already have nearly four years experience in Java technologies and MySQL.I worked on several projects in my university and my internship programe at WSO2[1] and still working on projects based on Java technologies. Internship programe is a compulsory module and part of my undergraduate course. In WSO2, I worked as a trainee software engineer.WSO2[1] implementations mostly based on Java technologies.So I gained an extremely good background of software engineering process and Java based technologies. OSGi ,SOAP web services ,Modula Architecture and Cassandra NoSQL database are major key areas which I have gathered as experience in my internship program at WSO2. Since WSO2[1] is a open source software company,I have got experience of the open source culture. During my internship with WSO2, I have engaged with many projects which I have listed under in my Java experience. I am also an engineering undergraduate of University of Moratuwa and I am having a good mathematical background too. I have also got a good knowledge on database applications, specially with MySQL. I have developed several desktop application using MySQL and Java and I have listed them under my Java experience.

4. Do you have any other commitments we should know about?

I will be having the semester-end examination at the University Of Moratuwa in Sepetember.I attest that I will give my 100% contribution to the project. I guarantee that my willingness about contributing to openMRS will lead me to do better at the project. I always love to help people. Since openMRS is addressing humanity factor, I always cherish the opportunity to be at openMRS and my target is to become a long term contributor for openMRS. My contributions won't be limited to the GsoC time period. I assure you that it will be just a beginning of a long journey.
5. List your Java experience.

I have been using Java as my primary language since the time when I enter to the University. So I have got nearly 4 years of experience in Java and also I used MySQL several times during implementation of my projects both in the university and WSO2.

[1] During my internship at WSO2 I have created a web interface for the Cassandra NoSQL Nodetool management console.This project was to enable access to management and monitoring operations of Cassandra through a web interface. By default Cassandra database management operations like backup, flushing and cluster monitoring services expose through JMX interface. Since JMX is not secure, I have use SOAP Web services to access with management and monitoring operations provided in Cassandra. There are three back-end components and a front-end component of the project. Front end is the web interface which written using java servlet pages (JSP).

Project source code : Backend Components' at WSO2 repositories
Project source code : Frontend Component at WSO2 repositories

[2] During my internship at WSO2 I have participated in the test automation hackathon of WSO2 ESB product. WSO2 ESB is a well known enterprise service bus(ESB) around in the world.It had been a great privilege for me to work on writing platform wide tests in WSO2 ESB. There was a test framework in WSO2 known as “clarity framework” which built upon testng test libraries. I have written nearly 25 platform wide test cases using this test framework.
Project source code: ESB Test module at WSO2 repositories

[3] During my internship period, I have created the test module of WSO2 Storage Server(SS) and wrote several platform wide test cases using “clarity framework”.
Project source code : SS Test module at WSO2 repositories

[4] During my internship at WSO2, I have improved the Electronic Medical Record(EMR) Sample web application available in WSO2. EMR web application is consist of back-end Cassandra NoSQL database. I have done several back-end and UI improvements including data validation enhancements in the EMR web application.
Project source code: EMR sample at WSO2 repositories

[5] I have created Android application for my 3rd year software engineering project. Using my application, user can find nearby important places like fuel stations, restaurant, schools and etc. It provides with an interface for user to specify name of important place with the radius of searching area. Afterwards user will have a list of suggestions for specified places and he can choose places from the list. Then he will shown the travel path to selected place in the map along with distance and travel route. I have used Google Maps API for support with my application.
Project source code :

[6] I have implemented hall management system and student management system during my early years of my university life. Hall management system is a application for manage hostel facilities in a university and student management system. It is a client server application for manage student affairs in an academic institute. Both of these applications implemented using Java and have MySQL backend.
Project Source Code: Student Management Systematically
Project Source Code: Hall Management Systematically

[7] I have created a Intelligent gaming client for gaming competition at my university. It was a multi client server based Tank (Military Tank) game where clients need to be fully automated and score from grabbing treasures while fighting with other clients in the game.

Project Source Code:

[8] I had been involved in several other projects at university and I am happy to provide those information upon your request.. I am listing following projects and events here as my conclusion.

Trip Planner was a group project which allows user to plan their journey by specifying their preferences during the journey.
I participate twice at IEEE extreme programming completion and obtained global ranks under 500 .
Source code:Trip Planner

6. List your web interface experience.

During my internship at WSO2, I have created the frontend of the Cassandra Management Admin Component which is based on JSP pages. I already mentioned about this under java experiences section at [1].

Project source code : Frontend Component at WSO2 repositories

7. List any previous experience working with open source projects. (This experience is not a requirement.)

I have completed my internship at WSO2 which is a open source company.I contributed to WSO2 in many ways by engaging with projects and enhancing documentation support in many projects. I have listed my open source contribution under java experience because there I have used Java for programming.
Currently I'm doing my final year research project on integrating OGC's geospatial standards like WPS, WFS to Apache Airavata which is a open source scientific workflow management system.
Furthermore, I had involved a little in phpmyadmin development where I provided some patches to existing issues.

8. Please provide links to websites created by you and/or source code examples.
[1]My final year project web site using HTML and JavaScript

9. Do you have experience with Spring/Hibernate/DWR/HL7/Tomcat/MySQL/AOP? (Experience with any/all is not a requirement.)

I have a solid knowledge in MySQL since I had created several applications on top of MySQL database. I already followed database systems(CS 3042) course at my University. I have also used MySQL in some desktop application with Java/JDBC at university. I have used Tomcat during my internship at WSO2, to deploy electronic medical record sample web application which I was involved in doing some improvements. I have experience working for openMRS during last two months. So I have a fair amount of knowledge with Spring and Hibernate. I already resolved many tickets which I have listed below in several modules, during past one and half month. So I have fair amount of experience with the openMRS code base too.

10. What is your preferred method of contact and how should we reach you with it? (phone, email, Skype, IRC, IM, etc.)

I prefer email, IM ,Skype and IRC.

IM(Google Talk) : harsz89
IRC nickname : harsz89
Skype : harsha.kumara5

11. If you have visited our IRC channel, please include your IRC nickname in your application.
Nickname : harsz89 (primary nickname)
(harsha89-use when primary nickname not available)

12. Provide ticket numbers of any patches/code you have committed to the OpenMRS code base
I worked on both intro and other levels of tickets.

Committed tickets

META-236 intro ticket
Title :Minor UX improvements on Improve UI on export package details page
Link :

SYNC-289 intro ticket
Title :Show current time on the overview page
Link :

Title :Catalog call should take parameters to limit output
Link :

Label :RESTWS-367 intro ticket
Title :Update request should return updated object
Link :

Label :Tickets at code review

SYNC-293 intro ticket
Title :Add quick link on history page to "Most recent all committed"
Link :

SYNC-272 intro ticket
History of Changes: Records per page should not set "firstRecordId" if not previously set
Link :

Title :FindMethod and FindMethodOnResource should be accessible from BaseDelegatingSubclassHandler
Link :

On progress ticket
RESTWS-281 -Currently working on
Title :REST does not expose relationships or relationship_types
Link :
Status : 40% completed

Won’t fix ticket
RESTWS-287 -Ticket won't fix after discussion
Title :null values returned in GET request
Link :
Status :Ticket mark as won’t fix after discussion

Project Proposal


Preserving data integrity is one of major key feature and a challenge with a very data dependent software. OpenMRS is a very data intensive application where it manages a numerous amount of data of patients. Data integrity module origin as solutions to solve the data integrity problems associated with a database. Module provides a way to create, manage and review data quality audits. This facilitate users to view or download the results of an integrity check. It also have the functionality to ignore certain known results that should not be included in the total count. The module contains a strong chart UI for representing the history of an integrity check's findings and link directly to encounters, patients, observations and more from the results. Data integrity module has became an indispensable component in openMRS which ensure the data quality of the openMRS database.

Preserving integrity of large databases which includes millions of records will not be an easy task to handle. So there is a major need of module which enable more users to participate in the process of handling data integrity problems in the openMRS database. This is originating the concept of Data Integrity Workflow module which provides several key functions to achieve collaborative data integrity preservation.

  • Create a new module according to the Module Creation wiki page 
  • Apply for a repository in openMRS and a JIRA project
  • Allowing a manager to assign individual results or entire groups of results to another user for follow-up.
  • Allow an user to log in and see whether he/she has assigned records to work on.
  • Allow a record to move through workflow stages, such as In Progress, Waiting on Information, Verified, etc.
  • Provide summaries for seeing workflow stages and progress over time.

  • With this module it will enable efficient management of integrity checks results in a large scale deployments.It is always not easy to handle and fix the results of integrity checks by a single person within a system. Data integrity workflow module is a smart solution for divide and fix the issues arise from each integrity check.
  • Including an user friendly UI will be highly benefited for the module users. Users can simply assign or view their tasks by a single click.
  • Faster integrity problem solving capability is another benefit of this module.


I have went through the functions provide in Data Integrity module before looking at this project. So I have a clear view about the functionality of Data Integrity module and the objectives of newly implementing module.

Working with tricky SYNC module by solving some tickets were great experience to me to get familiar with data handling in openMRS.So I think that will be a great advantage for me to have a good start with this project.

Goals and Deliverables
  • JIRA project associate with the new module
  • Source code with technical wiki in openMRS
  • Module information page along with user guide in openMRS wiki
Project Implementation Plan

Main Tasks

Manager view design and implementation

  • Manager is a person who can run and create integrity checks.After an integrity check executed. There will be a set of results which are integrity concerns of the database. In this workflow module, there are set of functions need to have with the manager. I have listed functions below
  • Assign user to entire record or set of records
  • Manager needs to know the person assign with the each record and working status of the record(In progress,Waiting for information or other status) 
  • Remove the assignment of user with a record or set of records
  • Change the working status of a record

User view design and implementation
  • User is a person who work in a particular set of records of an integrity check. After manager assign records in a integrity check for user, will go through each of the record and fix the integrity problems. There are set of functions need to be provided with user’s interface. I have listed them below
  • User needs to view the records 
  • Update the status of each of record
  • Providing some description associate with the fix
  • Provide summaries with record workflow status
With the above tasks I mentioned earlier,The summary of a record will be associate with it’s work flow status and set of descriptions given by the user.The manager need to have a page to view the summary reports.

Project Timeline

May 27-Jun17
  • Discuss about the final project deliverables with the mentors and update the project requirements documents according to it.
  • Improve the user interfaces for manager and user while researching about possible approaches. 
  • Getting more familiar with hibernate and Spring framework.

Jun 17-Jun 25
  • Finalyse the user interfaces in the project
  • FInishing re-designing and creating necessary table schemas
  • Explore more about writing module in openMRS
Jun 25-Jul 29

Implement the first phase of the project
  • Goal-Finishing manager view implementations
  • Modifying existing page of manager to meet with current requirements
  • Perform necessary changes in backend
  • Creating pages for view report summaries
  • Finalise the manager view implementations
  • Get a initial start of implementing user view

Jul 29 -Aug 2
Mid evaluations

Aug 2- Sep 9

Implement the second phase of the project
  • Goal-Finishing user view implementations and finalise the project
  • Polishing first phase implementations according to feedback
  • Implement the user view front end pages
  • Perform necessary changes at the backend
  • Finishing user view implementations
  • Writing test cases and test the project for verify its’ functionality
  • Creating wiki pages for the module

Extra week for finishing and wrap up project work

Final evaluations

Data Integrity Workflow Module
UI Mockups

Wednesday, May 29, 2013

Selected as a GSoCer at OpenMRS

One of happiest and memorable movement in my life was when I received the e-mail from the Google saying Congratulations! Your proposal "Data integrity workflow module" submitted to "OpenMRS" has been accepted for Google Summer of Code 2013. GSoC is one of  dream in my life. Finally I have achieved it. My heartfelt thanks goes to Jeremy Keiper who is the primary mentor of my GSoC project for providing solid feedbacks to improve my proposal.  Also I would like to give my thanks to Michael Downey  who is the GSoC projects in-charge in OpenMRS and to the all the members in the OpenMRS community to the help given in succeed my proposal. I would like to say that OpenMRS community is very very helpful and very friendly. “Write Code. Save lives.” is the motto of the OpenMRS. I have inspired by the this motto and it implies contributions to OpenMRS will lead to enhance the medical conditions of millions of users of OpenMRS. I invite all visitors of my blog to consider contribute for OpenMRS. The amount of mental satisfaction gain by contributing to the OpenMRS is incomparable. Writing code is only a one way to contribute to the OpenMRS and yet there are many ways anyone can help for OpenMRS to fly above the sky. I'll put my maximum effort to success my GSoC project and it will be a remarkable experience for me. I congratulate for the each of other GSoC student in OpenMRS and wish them a good luck with their projects. GSoC will be a beginning of long journey with OpenMRS. It's a great opportunity to be a part of OpenMRS family.

Interesting days yet to come.:D. Waiting to get to know about community more. It will be fun and interesting. :D :D. Wanna try? Come and Join with OpenMRS community. Being at OpenMRS will be a great privilege, remarkable experience and also fun for anyone. Come and feel the difference. Don't be late come and join with the happy family. :)

                                                                          Let's do it.

Sunday, March 3, 2013

GIT basics for start working on a open source projects

GIT is kind of pretty amazing version control system which allow user to manage their software development in a very handy manner.Subversion was another popular version control system which was one of another well known piece of software.Since GIT become a handy piece of software the popularity among the version control systems move towards to GIT.For get deep understanding about the GIT I recommand this link to study about GIT.GIT has very flexible source code managing architecture which allow users to manage and version their source codes.
                                                                                                         During this tutorial I try to give an brief idea about using GIT for contribute open source software development.I assume you have basic GIT knowledge which you can get from any tutorial.

Github is a GIT deployed environment which allow you to deploy your source code.This allow users to go through the publicly available repositories and start contributing to existing opensource software.Make sure you signup for a account in Github.Let's start!.

Fork a repository

Fork a repository means taking a snapshot of opensource software source code which is available publicly in a Github account which manage by set of people to your own repository which is manage by Github.You  only have read access to the source code of the publicly available open source software. After you forking it's like your own repository which you can do changes to the source code in your repository.

Forking from openMRS reporting module which is publicly available in Github

Above image I do as example.I'm going to fork from this link.You can see the fork button in right hand top corner which allow you to simply fork the repository to your own repository on Github.After words you direct to your own repository location.

After forked
After you can see your own repository.Then you can clone it by your Git client of your computer.The cloning link is the one which appear in the image after "Git Read-Only" phrase.

Note: After forked you need to manually update the branches of your fork with original open source repository.After forked there won't any automatic communication happen with open source software code repository and your forked one.You only take snapshot of the open source software code base which create a copy of the current instance of the repository to your Github repository.

Now you can think you have your own repository of open source code base at that instance.


Now you take a copy of your own repository to your working environment which is your computer.

Command :
       git clone <repository location>

                                   git clone

Now you have your own snapshot at your computer.Let's start working on it.

Note: Always origin is point to the location where user clone the repository from remote GIT location

Useful commands

  • git remote -v 
          This command will output the locations of origin and other remote repositories.

git remote -v output
  • git branch -a
          This command will output the all the branches in your local git repository where star ("*")  
           symbol points to currant working branch.
git branch -a output

  • git fetch --all
          This command will fetch the all the branches from remote repositories to your local repository.
  • git remote add {name}  {url}
          This command is very useful in GIT.This allow users to add remote repositories to the user local    
          repository which is at user's computer.By default cloned repository has one remote location 
          which is known as origin.But when user need to add repository location where user fork the 
          source code for get the on going changes of the original repository,user needs to add that location   
          to their local GIT repository. 

                           git remote add upstream

  • git remote set-url {remote name} {new location}
         This also another important command in GIT.Think there is a situation user want to change the 
          remote repository location of a particular remote.So above command comes to play at that 
                      git remote set-url origin ssh://

  • git remote rm {remote name}
           When user need to remove a remote git repository location.User needs to use this command.

          example: removing remote name as upstream
                        git remote rm upstream

  • git reset --hard
           This command will discard any changes in your working branch.
  • git pull --rebase {remote name} {branch name}
         This command used to get the changes of the user specified remote and the user specified  
          branch.Command the '--rebase' option reverts any of your commits which are not in user 
          specified remote and the branch then fast forwards your local branch to user specified remote and 
          the branch and finally applies your commits on top of that. This allows you to avoid merge 
          commits and keep the history linear, but must not be used if you want others to work with you on               
          a branch in your fork.
          example: Pulling from remote known as upstream and branch known as master
                              git pull --rebase upstream master

Continue on opensource software contributing

          Most of the time for contribute to the open source software you may need to work on issues which are known as tickets.Those are can be bugs or new features of the open source software which are manage by a issue tracker.If you want to start on working ticket or experiment something on your own,you better to make a new branch from existing branch in the repository.Most of the time it will be the master branch which need to be branch again.The new branch can be work as new independent branch where changes on that branch will not effect to the other branches.Let's see how it going.

  1. You need to create new branch from the existing branch
           command: git checkout -b {new branch name} {existing branch}
           example :git checkout -b working_branch master

     2. Cleaning the currant branch  
           command: git clean -df
     3. To proceed,user need to be up to date with remote original repository branch.Update with the  
         remote original repository known as upstream and the branch master
           command : git pull --rebase {original remote repository} {branch name}
           example:Update with the  remote original repository known as upstream and the branch           
                                   git pull --rebase upstream master
Now you have a brand new branch which you can work on your own.

    4. If you want to push the created branch to your remote repostory which is Github you can execute  
        following command.
         command  :git push {remote name} {newly created branch name}
         example  :git push origin working_branch

   5. Now user can work on their own on the newly created branch.I

   6. If user wants switch between branches they can execute following command

       command:git checkout {branch name}
       example:git checkout master

  7. If you have uncommitted changes and git refuses to merge, you can stash your changes, perform a   
      pull and then unstash them.Follwong commands need to be executed.

                           git stash
                           git pull --rebase upstream master
           git stash pop

  8.After finishing your works you can push the changes into your branch in the repository.

Create the pull request

After user user done with the changes.User needs to make a pull request to the original branch.This pull request indicates your changes done in the source code and let commiters of original repository of open source software to evaluate the quality and the accuracy of user's changes and commit it to the original repository.
Pull requesr

Above image you can see the pull request button which you allow to create the pull request.Follow the steps after you clicking it.

Deleting the branch

After you have done your works you may merge the created branch into the your master branch or simply update your master branch after user's changes applied to the original repository branch and delete the newly created branch.

  1. Delete the branch need to you to switch from currant branch to another branch.Then execute following command
           command: git branch -D {newly created branch name}
      example: git branch -D working_branch

    2.Push changes to the remote  to delete the created branch from remote repository too.

             command: git push {remote} :{newly created branch name} 
             example: git push origin:working_branch

Saturday, March 2, 2013

Changing permissions (ownership) of directory or file including access permissions in Ubuntu

Sometimes users may need to change the permissions of a directory or a file in order to prevent of unauthorized accesses.If sometimes you need to give access to some user on file or a directory which owns by the root, then you need to give the permission to that particular user.Let's see how this goin to work.

Changing the ownership of filename

To change the ownership of a single file, you can run following command with specifing username and user group. 

         sudo chown <username>:<groupname> <filename>

         example :

                        sudo chown harsha:harsha textfile.txt

To change the ownership of a single file with only specifying username only you can run following command.

          sudo chown <username> <filename>

          example :
                        sudo chown harsha textfile.txt

Changing the ownership of directory
To change the ownership of a directory you can following command which recursively apply the ownership changes to sub directories and files also.

         sudo chown -R <username>:<groupname> < directory >
         example :
                              sudo chown harsha:harsha textDirectory/

By only username

         sudo chown -R <username> < directory >

         example :
                        sudo chown harsha textDirectory/

Access permissions
In the above posts I have describe how to change the ownership of a directory  or file.But for a movement if you change the ownership to root and let only root can access the directory and files you may need to change the access permissions to particular directory.

If you want to get a quick understanding about the permission matrices which  show the read write and execute permissions in Linux I recommand this link will provide better understanding.Numbers coming along with "chmod" command are the way of expressiong permissions.

How To change permission of file folder so only root can access open it

Step 1
  •  Change the ownership of the directory / file to root
       sudo chown root:root <direcotry or filename>
                sudo chown root:root textDirecotry/
Step 2             

  • Change the permissions so that only the owner of the file can read/write/execute it.(There is no point of applying permission for all the directories,cause if particular user cannot access root directory,then user won't be able to access the files and directories inside the root directory)
                 sudo chmod 700 <direcotry or filename>
                              sudo chmod 700 textDirecotry/

If file is a executable file you may give "sudo chmod 700" instead of "sudo chmod 600".

Details about permission numbers

  • chmod 700 
The directory’s owner can read or write files in that directory as well as change to it.
All other users (except root) have no access.
  • chmod 771 
Same as for the owner. All other users can change to the directory, but not view or change files
in the directory. This can be useful for server hardening,where you prevent someone from listing directory contents,but allow access to a file in the directory if someone already knows it’s there.
  • chmod 777 
All permissions are wide open.
  • chmod 0000 
All permissions are closed. Good to protect a directory from errant changes.
However, backup programs that run as non-root may fail to back up the directory’s contents.
  • chmod 666 
Open read/write permissions completely on a file.
  • chmod 644 
Only the owner can change or delete the file, but all can view it.

The first 0 in the mode line can usually be dropped (so you can use 777 instead of 0777).
The -R option is a handy feature of the chmod command. With -R, you can
recursively change permissions of all files and directories starting from a
point in the file system. Here are some


$ sudo chmod -R 700 /tmp/test Open permission only to owner below /tmp/test
$ sudo chmod -R 000 /tmp/test Close all permissions below /tmp/test
$ sudo chmod -R a+rwx /tmp/test Open all permissions to all below /tmp/test

Friday, March 1, 2013

How to start Apache Tomcat or Jetty Server using maven plugin in remote debugger mode in Ubuntu/Linux

Debugging is one of major requirement of a software debugging process.To fix a bug developer may need to find the exact bug and fix it.Debugging provides efficient way to analyse the variables and execution path of the code.Apache tomcat and Jetty are two of well known server which act as a container for web applications.So debug a web application server need to start in debugger mode.Here simple steps to start tomcat in debugger mode.

In bash console of Ubuntu execute following arguments.

Apache tomcat debugging mode

export JPDA_ADDRESS=8000
export JPDA_TRANSPORT=dt_socket
bin/ jpda start

User can remotely connect through the port 8000 for debug the application!

Jetty debugging mode

Jetty server can start through maven plugin.So in order to enable remote debugging in jetty user can follow the following way.
Just two steps.

step 1
export MAVEN_OPTS="-Xdebug -Xnoagent -Djava.compiler=NONE - Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=n"

step 2

mvn jetty:run


Server listen on port 8000 until debugging client connecting to the server.
Simple as that!

Thursday, February 28, 2013

How to change the currant user to different user in Ubuntu

When you working,sometimes you may need to change current user to some other user.Here the procedure you need to follow is simple.In bash console in Ubuntu

$ sudo su            (you need to enter the root password)
$ su - {username} 


$ su - testuser


Wednesday, January 2, 2013

Windows Command Line (cmd) commands

Active Directory ADmodcmd Active Directory Bulk Modify

 CSVDE Import or Export Active Directory data 
 DSACLs Active Directory ACLs
 DSAdd Add items to active directory (user group computer) 
 DSGet View items in active directory (user group computer)
 DSQuery Search for items in active directory (user group computer)
 DSMod Modify items in active directory (user group computer)
 DSMove Move an Active directory Object
 DSRM Remove items from Active Directory

Batch Files

CALL Call one batch program from another• CHOICE Accept keyboard input to a batch file CLIP Copy STDIN to the Windows clipboard CLS Clear the screen• CMD Start a new CMD shell COLOR Change colors of the CMD window• DOSKEY Edit command line, recall commands, and create macros ECHO Display message on screen• ENDLOCAL End localisation of environment changes in a batch file• EVENTCREATE Add a message to the Windows event log EXIT Quit the current script/routine and set an errorlevel• FOR /F Loop command: against a set of files• FOR /F Loop command: against the results of another command• FOR Loop command: all options Files, Directory, List• GOTO Direct a batch program to jump to a labelled line• IF Conditionally perform a command• IFMEMBER Is the current user a member of a Workgroup LOGEVENT Write text to the event viewer LOGTIME Log the date and time in a file MAPISEND Send email from the command line MORE Display output, one screen at a time PAUSE Suspend processing of a batch file and display a message• PROMPT Change the command prompt• REM Record comments (remarks) in a batch file• RUN Start | RUN commands RUNAS Execute a program under a different user account SET Display, set, or remove session environment variables• SETLOCAL Control the visibility of environment variables• SETX Set environment variables SORT Sort input SHIFT Shift the position of batch file parameters• SLEEP Wait for x seconds START Start a program, command or batch file• TIMEOUT Delay processing of a batch file TITLE Set the window title for a CMD.EXE session• WAITFOR Wait for or send a signal WMIC WMI Commands :: Comment / Remark•

Disk Management

BOOTCFG Edit Windows boot settings BCDBOOT Create or repair a system partition BCDEDIT Manage Boot Configuration Data CONVERT Convert a FAT drive to NTFS CHKDSK Check Disk - check and repair disk problems CHKNTFS Check the NTFS file system DEFRAG Defragment hard drive DISKPART Disk Administration DISKSHADOW Volume Shadow Copy Service DriverQuery Display installed device drivers FORMAT Format a disk FREEDISK Check free disk space (in bytes) LABEL Edit a disk label MOUNTVOL Manage a volume mount point NTBACKUP Backup folders to tape SFC System File Checker VOL Display a disk label•

Files and Folders

ASSOC Change file extension associations• ASSOCIAT One step file association ATTRIB Change file attributes BITSADMIN Background Intelligent Transfer Service CACLS Change file permissions CD Change Directory - move to a specific Folder• CIPHER Encrypt or Decrypt files/folders COMP Compare the contents of two files or sets of files COMPACT Compress files or folders on an NTFS partition COMPRESS Compress individual files on an NTFS partition COPY Copy one or more files to another location• CSCcmd Client-side caching (Offline Files) DEL Delete one or more files• DELTREE Delete a folder and all subfolders DIR Display a list of files and folders• ERASE Delete one or more files• EXPAND Uncompress files EXTRACT Uncompress CAB files FC Compare two files FIND Search for a text string in a file FINDSTR Search for strings in files FORFILES Batch process multiple files FSUTIL File and Volume utilities FTP File Transfer Protocol FTYPE File extension file type associations• iCACLS Change file and folder permissions MD Create new folders• MOVE Move files from one folder to another• MKLINK Create a symbolic link (linkd) OPENFILES Query or display open files POPD Return to a previous directory saved by PUSHD• PsFile Show files opened remotely PUSHD Save and then change the current directory• QGREP Search file(s) for lines that match a given pattern RECOVER Recover a damaged file from a defective disk REN Rename a file or files• REPLACE Replace or update one file with another RD Delete folder(s)• RMTSHARE Share a folder or a printer ROBOCOPY Robust File and Folder Copy SHARE List or edit a file share or print share SHORTCUT Create a windows shortcut (.LNK file) SUBINACL Edit file and folder Permissions, Ownership and Domain TAKEOWN Take ownership of a file TOUCH Change file timestamps TREE Graphical display of folder structure TYPE Display the contents of a text file• WHERE Locate and display files in a directory tree WINDIFF Compare the contents of two files or sets of files XCACLS Change file and folder permissions XCOPY Copy files and folders

Group Policy/Windows Installer

DevCon Device Manager Command Line Utility GPRESULT Display Resultant Set of Policy information GPUPDATE Update Group Policy settings MSIEXEC Microsoft Windows Installer PsInfo List information about a system PsShutdown Shutdown or reboot a computer REGSVR32 Register or unregister a DLL SHUTDOWN Shutdown the computer SLMGR Software Licensing Management (Vista/2008) WUAUCLT Windows Update


ARP Address Resolution Protocol BROWSTAT Get domain, browser and PDC info DNSSTAT DNS Statistics GETMAC Display the Media Access Control (MAC) address IPCONFIG Configure IP NET Manage network resources NETDOM Domain Manager NETSH Configure Network Interfaces, Windows Firewall & Remote access NBTSTAT Display networking statistics (NetBIOS over TCP/IP) NETSTAT Display networking statistics (TCP/IP) NSLOOKUP Name server lookup PATHPING Trace route plus network latency and packet loss PsPing Measure network performance PING Test a network connection ROUTE Manipulate network routing tables TRACERT Trace route to a remote host


KILL Remove a program from memory PATH Display or set a search path for executable files• PsExec Execute process remotely PsKill Kill processes by name or process ID PsList List detailed information about processes PsGetSid Display the SID of a computer or a user PsSuspend Suspend processes SCHTASKS Schedule a command to run at a specific time SOON Schedule a command to run in the near future TASKLIST List running applications and services TASKKILL Remove a running process from memory TLIST Task list with full path


CON2PRT Connect or disconnect a Printer MODE Configure a system device PRINT Print a text file PRINTBRM Print queue Backup/Recovery PRNCNFG Display, configure or rename a printer PRNMNGR Add, delete, list printers set the default printer RUNDLL32 Run a DLL command (add/remove print connections)


REG Registry: Read, Set, Export, Delete keys and values REGEDIT Import or export registry settings REGINI Change Registry Permissions

Remote Desktop

CHANGE Change Terminal Server Session properties Query Process Display processes (TS/Remote Desktop) Query Session Display all sessions (TS/Remote Desktop) Query TermServer List all servers (TS/Remote Desktop) Query User Display user sessions (TS/Remote Desktop) MSTSC Terminal Server Connection (Remote Desktop Protocol) RASDIAL Manage RAS connections RASPHONE Manage RAS connections Reset Session - Delete a Remote Desktop Session TSSHUTDN Remotely shut down or reboot a terminal server WINRM Windows Remote Management WINRS Windows Remote Shell


CASPOL Code Access Security Policy Tool. NETSVC Command-line Service Controller PORTQRY Display the status of ports and services PsService View and control services SC Service Control SCLIST Display Services

System Information

NOW Display the current Date and Time DATE Display or set the date• HELP Online Help LOGMAN Manage Performance Monitor MBSAcli Baseline Security Analyzer MEM Display memory usage MSINFO32 System Information NTRIGHTS Edit user account rights PERFMON Performance Monitor PsLogList Event log records SYSTEMINFO List system configuration TIME Display or set the system time• TypePerf Write performance data to a log file VER Display version information• VERIFY Verify that files have been saved• WINMSDP Windows system report WHOAMI Output the current UserName and domain

User Administration

ADDUSERS Add or list users to/from a CSV file CERTREQ Request certificate from a certification authority CleanMgr Automated cleanup of Temp files, recycle bin CON2PRT Connect or disconnect a Printer CMDKEY Manage stored usernames/passwords DELPROF Delete user profiles DIRUSE Display disk usage GLOBAL Display membership of global groups LOCAL Display membership of local groups LOGOFF Log a user off MOVEUSER Move a user from one domain to another MSG Send a message PERMS Show permissions for a user POWERCFG Configure power settings PsLoggedOn Who's logged on (locally or via resource sharing) PsPasswd Change account password SHOWGRPS List the Workgroups a user has joined SHOWMBRS List the Users who are members of a Workgroup SUBST Associate a path with a drive letter USRSTAT List domain usernames and last login Commands marked "•" are Internal commands only available within the CMD shell. All other commands (not marked with "•") are external commands. External commands may be used under the CMD shell, PowerShell, or directly from START-RUN. See also: An A-Z Index of the Windows CMD command line Microsoft Help pages: Windows XP - 2003 Server - 2008 Server