for me: start programing in the morning and don't check my email or any "leisure" websites (like hacker news) until after lunch. I've found that I only have about 5 hours of hard-core coding in me in a day, so I try to use that up in one block in the morning and work on non-coding B.S. afterwards...
I agree with pg: coding is like writing. I use the same strategies trying to stay productive as a coder that I did fighting writer's block while working as a technical writer...
managing a running server, on the other hand, is not like writing...
it's a %$#%ing nightmare ;-)