Have regular breaks. your eyes hurt because the muscles focusing the eyeball is squeezing the eye forward (extrinsic ocular muscle activity).
HOMER: "... *my eye's hurt*"
LENNY: "You know its the inter-ocular pressure causing by the muscles trying to focus. Asthenopia is another name for it."
HOMER: "Huh?"
CARL: " Homer just take a break."
HOMER: "... I did. I just poked my eye to see what it was like."
So to stop your eyes hurting take regular breaks ~ http://en.wikipedia.org/wiki/Asthenopia & http://www.coopereyecare.com/eye_strain.htmhttp://lifehacker.com/software/featured-mac-download/enable-...
But I need it for linux...
Here are a couple of things to try during the breaks: (1) count to 30 while focusing on something more than 20 feet away; (2) close your eyes and place your hands over them for a count of 30.
I know it's sometimes hard to take breaks when in the throes of a hackathon, but you'll get better with practice. I try to be really anal, taking breaks even if I'm mid-line; that way, I know I'll get back to work when the break is over.
Idea being that focusing at things close by requires keeping your ciliary muscle stressed for long periods of time (try to focus on your palm as close to your face as possible, and then keep it there for a few minutes to feel this). Focusing at things far away requires complete relaxation of the eye. If you wear near vision glasses, your screen will hopefully be far enough that your eye is relaxed when focusing on it.
I've been using weak glasses for work for the last 5 years or so, and find it makes a huge difference after a day of coding.
Optimal orientation is with screen perpendicular to the window or light source to avoid reflections on the screen and light source behind the screen. Otherwise your eyes and brain will have to do allot of effort to focus on your screen.
Check also the screen quality. LCD flat screen are Ok. A long time ago I worked with a tube screen slightly out of focus and had terrible head ache by the end of the day even though I had no problem with my eyes. Changing screen solved the problem.
She said to use a heat pack/mask (as hot as you can handle for as long as you can handle) an then massage the eyelids (pressing down on the top, and up on the bottom) to try and get the wax plugs out (yuk). Then wash your eyes.
I also have a friend who forgets to blink when he concentrates hard (seriously). Needless to say his eyes hurt when he codes.
Whatever the cause, you should consider seeing an ophlamologist. I'm sure they can help you find a remedy.