i've done this kind of thing for spans of a year or two. besides the advice you're probably already getting, i'd say going running regularly helps a lot. when i was running, i'd be have a lot more energy throughout the day and night; when i wasn't i'd want to nap when i got home.
finding a cofounder is also a big productivity boost. find one early -- the more progress you make by yourself the harder it is to get someone else excited about "your" idea. if you're moonlighting, it's easy to put this off, but you're only hurting yourself long term. (i used to believe the single founder thing was doable for a while, but all of pg's counterarguments are right.)