I find the pomodoro technique really useful.
Just the simple thing of having a countdown timer going makes me focus on the task at hand and restricts my procrastination to the breaks, which I also limit in length using the timer.
I'm currently using 45min working periods with 15min breaks, I've found that's the best balance for me after experimenting with various combinations.