avoid blinking lights, sharp lights, cheese, chocolates, get regular and constant sleep. keep headache pill with you all the time. avoid stress and when you get attacked, go to a dark room and get sleep. these are the things which helped me a lot for relieving myself from its attacks.
I usually take off my contacts or glasses, take 2 panadols and stop surfing the internet or watching TV. I also find that looking at green things help a lot, not neon green though, something more organic and less bright.