This is kind of weird, but when I need to stay motivated, I often do something that has nothing to do with the task. Say I need to get motivated to write an article.. Well, I'll go see a movie (given that time permits). If I say, "Hey, I gave myself this treat, now I need to get down to business" then it makes it much easier to get it done. I try not to go the route of, "If I get this done, I'll treat myself to a movie after" because then my work tends to suffer because I might rush it. So, I go for the opposite method of positive reinforcement.