One thing that no one's really mentioned yet: remove as many interesting things from your environment as possible. If your only choice is between boredom and doing what you're supposed to be doing, you're a lot more likely to be successful.
It's hard to actually do it, and it's hard to be bored. Being bored is... well, boring. Your brain will have all sorts of impulses and drives to derive any kind of entertainment from anything.
But if you stick with it, it's one of the best strategies to make yourself do something.