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.

[0]-http://static.springsource.org/docs/Spring-MVC-step-by-step/
[1]-http://www.mkyong.com/tutorials/hibernate-tutorials/
[2]-https://wiki.openmrs.org/display/RES/EHSDI+Training+Course
[3]-https://wiki.openmrs.org/display/projects/Data+Integrity+Workflow+Module
[4]-http://www.springsource.org/spring-framework
[5]-https://wiki.openmrs.org/display/docs/Creating+Modules

Saturday, June 15, 2013

My GSoC project proposal for Data Integrity Workflow Module to OpenMRS


Introduction

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 : http://harshcreationz.blogspot.com

2. Please provide the URL to your wiki personal space.
https://wiki.openmrs.org/display/~harsha89

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.
[1]-http://wso2.org/

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
http://svn.wso2.org/repos/wso2/carbon/platform/branches/4.1.0/components/cassandra/org.wso2.carbon.cassandra.cluster/
http://svn.wso2.org/repos/wso2/carbon/platform/branches/4.1.0/components/cassandra/org.wso2.carbon.cassandra.cluster.mgt/
http://svn.wso2.org/repos/wso2/carbon/platform/branches/4.1.0/components/cassandra/org.wso2.carbon.cassandra.cluster.proxy/
Project source code : Frontend Component at WSO2 repositories
http://svn.wso2.org/repos/wso2/carbon/platform/branches/4.1.0/components/cassandra/org.wso2.carbon.cassandra.cluster.mgt.ui/

[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
http://svn.wso2.org/repos/wso2/carbon/platform/branches/4.1.0/products/esb/4.7.0/modules/integration/tests/

[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
http://svn.wso2.org/repos/wso2/carbon/platform/branches/4.1.0/products/esb/4.7.0/modules/integration/tests/

[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
http://svn.wso2.org/repos/wso2/carbon/platform/branches/4.1.0/samples/emr-sample/

[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 : https://github.com/harsha89/android_google_maps

[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
https://github.com/harsha89/hall_management_system.git
Project Source Code: Hall Management Systematically
https://github.com/harsha89/student_management_system.git

[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:
https://github.com/harsha89/ai_client.git

[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
https://github.com/harsha89/trip_planner.git




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
http://svn.wso2.org/repos/wso2/carbon/platform/branches/4.1.0/components/cassandra/org.wso2.carbon.cassandra.cluster.mgt.ui/


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
Link: http://projectdhara.net78.net/


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 :https://tickets.openmrs.org/browse/META-236

SYNC-289 intro ticket
Title :Show current time on the overview page
Link :https://tickets.openmrs.org/browse/SYNC-289

RESTWS-284
Title :Catalog call should take parameters to limit output
Link :https://tickets.openmrs.org/browse/RESTWS-284

Label :RESTWS-367 intro ticket
Title :Update request should return updated object
Link :https://tickets.openmrs.org/browse/RESTWS-367

Label :Tickets at code review

SYNC-293 intro ticket
Title :Add quick link on history page to "Most recent all committed"
Link :https://tickets.openmrs.org/browse/SYNC-293

SYNC-272 intro ticket
History of Changes: Records per page should not set "firstRecordId" if not previously set
Link :https://tickets.openmrs.org/browse/SYNC-272


RESTWS-253
Title :FindMethod and FindMethodOnResource should be accessible from BaseDelegatingSubclassHandler
Link :https://tickets.openmrs.org/browse/RESTWS-253

On progress ticket
RESTWS-281 -Currently working on
Title :REST does not expose relationships or relationship_types
Link :https://tickets.openmrs.org/browse/RESTWS-281
Status : 40% completed

Won’t fix ticket
RESTWS-287 -Ticket won't fix after discussion
Title :null values returned in GET request
Link :https://tickets.openmrs.org/browse/RESTWS-287
Status :Ticket mark as won’t fix after discussion

Project Proposal

Abstract

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.


Objectives
  • 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.

Benefits
  • 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.

Notes

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

Sep9-Sep16
Extra week for finishing and wrap up project work

Sep16-Sep23
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.

Cloning

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

Command :
       git clone <repository location>

                 example:
                                   git clone https://github.com/harsha89/openmrs-module-webservices.rest.git

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. 

        example:
                           git remote add upstream https://github.com/openmrs/openmrs-core.git

  • 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 
          movement.
         
         example:
                      git remote set-url origin ssh://newhost.com/usr/local/gitroot/myproject.git

  • 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           
                                master
                                   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.

      commands:
                           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
Done!

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>
         
         example:
                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>
        
         example:
                              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

examples:

$ 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/catalina.sh jpda start

Done!
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

Done!

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} 

example:

$ su - testuser

Done!