Archive for the ‘tips and tricks’ Category

TechTip: Moving a Project Between Git Repositories

I tend to write these so that I do not forget them, and possibly to help others who may be face similar challenges. The question is why would somebody want to do this, well usually its because of a change in Git hosting providers or probably change in project ownership.

The process is as follows:

  1. Check the configuration of the remote repository
    local-box:change-url ssmusoke$ git remote -v
    origin (fetch)
    origin (push)
  2. Rename the url of the current remote repository from origin:
    local-box:change-url ssmusoke$ git remote rename origin oldrepo
    local-box:change-url ssmusoke$ git remote -v
    oldrepo (fetch)
    oldrepo (push)
  3. Create a new origin pointing to the new remote repository
    local-box:change-url ssmusoke$ git remote add origin
    local-box:change-url ssmusoke$ git remote -v
    oldrepo (fetch)
    oldrepo (push)
    origin (fetch)
    origin (push)
  4. Sync the project to the new remote repository (if any issues occur the old url is still available)
  5. Delete the old url (only after confirming that everything works fine with the new url)
    git remote rm oldrepo

OpenMRS Module Development Learnings – 102

My team mates and I are completing a number of OpenMRS workshops focused on improving our module development capability. This blog post captures the unwritten lessons that we have picked up as a way of giving back our lessons to help others in the community (and will be moved to the OpenMRS Wiki once the lessons have been internalized and consolidated, as that is its natural home).
The approach is based on the following OpenMRS community articles:
  1. Creating Modules –
  2. Creating your First Module –
As you develop the module it is important to keep testing and verifying whatever you do especially when the module involves user interface components, extending the OpenMRS UI. The process we ended up using was as follows:
  1. Setup a module using the module creation command line utility
  2. Downloaded Spring Loaded from its maven repository
  3. Downloaded and setup OpenMRS standalone from picking a version greater than 1.11.x which supports debugging options
  4. Once the standalone version is installed, open the and add the following variables to the vm_arguments: (should all be one line – separated here for clarity)
    • -Xdebug -Xnoagent -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8000
    •{absolute path to root folder of the module}
    • -javaagent:{absolute path to spring loaded jar}
    • -noverify -Dspringloaded=inclusions=org.openmrs.module.modulepackage..* (note the two trailing dots before the *)
  5. Setup newly the module into an IDE (tested with IntelliJ & Eclipse)
  6. Installed a FileSync utility, RemoteSynchronizer for IntelliJ & FileSync ( for Eclipse
  7. Setup sync for the omod webapp folder into the standalone webapp folder located at WEB-INF/view/module/{modulename}
Our development workflow is smoothened out since any changes to Java classes & JSPs are automatically applied & reflected in the standalone app.
Additional Tips and Tricks
  1. Tomcat – Change the following init params in web.xml:
    • modificationTestInterval from 4 to 0, so that JSPs are automatically recompiled
    • development is true (this is the default)
  2. Intellij – the Java classes are not automatically recompiled on saving changes so there is need to run mvn package -DskipTests
  3. Follow the OpenMRS conventions as much as possible by cloning openmrs-core to see how the design of the interfaces, service layers is done. This will help get access to lots of the magic that happens behind the scenes.
  4. Java 8 will give you trouble, stick to 1. 7 as we did not try 1.6 anywhere.

Trunk or Branch based development

An interesting discussion that I had with my team mates over the last few days, whether we should create branches then merge later or keep working on the trunk within our Git based version control process. As the team is small, we are in the same premises but different locations, we agreed to move to work exclusively on the mainline for the following reasons:

  1. Reduce the amount of work having to remember which branches are active, so branches are an exception rather than the rule
  2. Adding practices like a CI pipeline (that’s additional work for all of us to setup) will provide a needed stability in the long-run as some of the projects are expected to be long running
  3. Working on the main line forces us to talk to each other, rather than IM away, so design decisions are shared across the team
  4. Branches discourage refactoring mostly due to the pain of merging refactored changes, and the fact that not everyone can benefit from the refactoring as soon as its completed – thanks to Twitter – Chris Ford

We used the following resources as research:

1. Martin Fowler – Feature Branch – also talking about Feature Toggles –

2. Apologists Defense of Trunk based development –

3. What is Trunk Based Development

4. Shades of Trunk based development –

What do you use with your team and why?

GeekDIY – Manually Upgrading Samsung S4 to Stock Android Lollipop 5.0.1

I would not consider myself an early adopter, neither am I a laggard, but somewhere in the middle for software upgrades. So when I heard that my Samsung Galaxy S4 would be getting Android Lollipop in December 2014, I was over the moon. What made me envious was that my colleagues with LG, Nexus and Sony devices were getting this update over the holidays.

So patiently I waited stalking the net for news on when my S4 would get an OTA update but no avail, 4 months later I am still feeling left out till, I found this post S4 Stock Lollipop came up in my Google+ feed (yes I use that) which led me to look for options of manually updating my phone to an official stock android for Samsung phones.

This led me to a guide How to get Android 5.0.1 Lollipop on the Galaxy S4  which walked me through the process.

75 minutes later, I had Lollipop 5.0.1 installed on my S4, now to understand how the new notifications & other enhancements can be leveraged for my day to day use most especially the battery life improvements.

My biggest worry was bricking the phone, so I followed the instructions to the letter, and ensured the laptop running Odin was on UPS just in case of power outage.

Tech Tip: Fixing Camera Troubles on Mac

When you use your Mac camera across multiple applications, Go-To-Meeting, Skype, Fuse, Facetime etc, you will find that it tends to not work at times and only a reboot can fix that. Well it happens because probably one of the applications did not release the camera. To fix follow the steps below:

1. Open a Terminal  (yes that black window where you can type magic commands). You can go to the Search in the top-right hand corner and type Terminal

2. Type the command below: sudo killall VDCAssistant

3. You will need to enter your password

Obviously you will ask, do I have to remember this command all the time, not really. Next time you open the terminal, click the up arrow on your keyboard and the command will appear.

Hope this helps somebody else as it does me everyday

Service Provider Dilema – How to Choose and Live with Your Choice

The dilema and rants of “Service Provider” quality of support and services is one we go through day by day. This morning I awoke to a rant by a Tweep on the costs of certain bank services, in this case US$2.5 (UGX 6,500) for an over the counter withdrawal. I smiled because I has been hit with a similar charge for a statement on my account at US$4.7 (UGX 12,000) per month (irrespective) of the number of transactions.

So then I started thinking, yes its going to get me into trouble, how does a consumer (non-technical) but who knows what they want live with service providers. Personally I follow a couple of rules of thumb:

  1. Serenity Prayer: God grant me the serenity to accept the things I cannot change; courage to change the things I can; and wisdom to know the difference.
    • I cannot change the service provider however, though I can get them to listen to me
    • The service is mass market so is not optimized for my particular convenience and usage, so I may need to modify some of my behavior to suit my needs
    • If the service is not working for me I can change it, but I must be willing to pay the price for the change
  2. If you make your bed, you need to sleep in it
    • Once you select a service provider, you may need to adjust to their shortcomings in order to make the best usage of their style of service delivery
    • The cost of changing service providers is usually high, so either stick to the one you have or pay it and move on
  3. Research your service providers before committing to them
    • The reality is you never have enough time, but if you do focus on the basic service you need and your special needs (those on which you cannot compromise)
    • Most times the service provider you choose will be based on a referral or positive feedback so accept that you will not know enough when you jump in
    • Read social media on experiences (spend the time now, and you will know better later)
  4. Use multiple service providers
    • This may not always be possible hence  #1, #2 and #3 above
    • If its possible however, you need to determine what each provider is best at focus on that, and mitigate where they are weak. I use 3 different Telecom providers for mobile phone & data services, because over the three plans I am totally covered for voice and data needs.
  5. All service providers cost the same
    • Even with different service offerings, always check the exceptions which is where you will get hit the most (#3 – Research)
    • Henry Ford recommended creating a product or service that caters for 80% of the populations basic needs, leaving 5-10% who have special needs and are willing to pay extra to get it…. Pick a service where you fall in the 80% and it will work for you most of the time
  6. The best tool for the job is the one you know how to use well
    • In the new consumer driven information age, this is true, learn to use your service providers as tools, at times they change to you, other times you change to suit them

How do you manage the relationships with your service providers? How do you deal with their shortcomings?

Mac Conversion for Windows Guy – Baby Steps

Ha ha ha, most would balk at the thought, have I gone over to the dark side? Have I lost my mind or has the evil empire taken control over me? Many would ask other would run scared to the hills, but well I have decided to make the switch mainly because of the battery life … My last laptop was a 17″ HP Envy 3D – a beast of a machine not very field friendly I think I developed a hunchback lugging it around, and abysmal battery life (what do you expect from a desktop replacement), quad core, 8GB RAM, 17″ screen, and hot as hell.

Many of my friends and collegues have made the switch bragging to me that once you go Mac u never go back… So he not being one who balks away at a challenge I made the jump to a Macbook air… So here is my story actually my 2-3 week journey all summarized …

Unpacking, the box was slim and lightweight … The packaging was I should say magnificent (black) and the air stood out. Only the laptop, and power cables … that’s all! I was stumped so simple ….

Starting up was smooth I was asked for a language, my contact details, whether I wanted icloud and how to use the trackpad. The trackpad was a little bit of trouble since was I was used to click and drag, yet the trackball requires using one or two fingers in a specific direction. I am still getting the hang of it but its impressive that I can get more without having to revert to the mouse.

Having used Windows from the venerable 3.1 (oh yes that old) through 3.1.1 (Windows for Workgroups) then 95, 95 Second Edition via 98 missed the Millenium train landed on Windows 2000 the best release yet. It was a big push to XP but an easier migration to Windows 7 when for the first time a newer version required less resources than an older version. I missed Vista thankfully and not sure if I will go 8, but the jury is still out on that one. I am finding that Mac OS is more like my Android smartphone so it may not be as difficult as I think it will be.

So next step was installing apps, my list is old fashioned but here goes:

  1. Google Chrome – oh yes the beauty is that I can sync directly with my personal Windows laptop
  2. Skype – who does not use it
  3. MS Office for Mac 2011 – I am an MS Outlook super-user without it I feel lost.
  4. Macintosh Explorer ( as a compliment to Finder which is very hard to use, no way to navigate outside system defined folders

The next step was to sync the Google Calendars (both personal and work) with my MS Outlook without needing to use ICal, as I would love to track everything in MS Outlook on the Mac, Windows and my Android smartphone, so that I can create events anywhere and have them auto synced.

I have to say that the battery life is really not overrated, it is goooddd!!! 1.5 hours on using a full charge and I have used 23% of my battery which means I can safely push 6 – 8 hours of power usage, which to me does not make me hostage to a power outlet …

The Air also has a 256GB SSD which provides an almost immediate bootup, and many times I am shocked when I restart whether I did so and usually do it a second time just to be sure.

The trackpad is the most amazing productivity aspect, by using a combination of 2 or 3 fingers, I can access anything and I mean any dashboard, scroll, zoom, slide between windows and apps (I still have to learn many of them though). I now find myself trying to use the gestures on my Windows laptop … so the brain is still in a state of limbo …

The user interface while not so alien needs some getting used to as I am currently getting confused when moving between Windows and Mac …

Please do share your experiences too …

%d bloggers like this: