There are two issues here: not getting distracted at work and getting excited about software development.
For the first one, only you can help yourself. If you are looking at the wrong sites, you need to get some URL blockers. But if you day-dream, there is not much that can be done except for some sort of tracked self-gamification of results. (Do X commits per day, etc).
Regarding getting deeper into software development even though you heart is somewhere else, try to find a cricket-related open-source project and contribute your knowledge there. You will get to exercise your (abstract) knowledge of the topic yet will need to learn new technologies to work with the software project. That can then get you interested in other IT aspects that are applicable beyond cricket. Or have a blog around cricket but build your own visualization/widgets to show the information you want to present/explain.
Often the best projects lie on the intersection of non-IT passion with strong IT skills. Recognize that and use it to your advantage rather than wasting it away in day-dreams.