Try to find other real problems to work on that are different from your current boring parts? The new problems might eventually become boring as well, but often the change and fresh perspective is enough to pique your interest in a motivational and productive way.