Oh those were the days! It's 1:40am and I'm up working - 4am is an average bed-time for me these days thanks to uni work.
My advice is to have a nice glass of cold water - if you get dehydrated you'll feel sleepy. Just force yourself to sip it every paragraph or something.
Get up and go for a walk every hour/half hour/whatever you're comfortable with - preferably out in the cold. The temperature is a bit of a system shock and should jerk you awake, and not staring at a computer screen/pad of paper and looking at stuff further away gives your eyes an "active rest".
And pull the plug out of your internet connection

- at least for the hour/half-hour you are working and then give yourself a break where you can use it.
Anyway, I think that's enough procrastination for now, I really should be working...ooh, some fresh paint (it's more interesting than my sodding essay)!