I've been in your position, quit, and failed horribly. My primary weakness as a programmer is lack of focus/tendency to get distracted and as such I was forced to recognize that I work best in a (preferably small) company. As such, here's my advice:
Hack after hours and put it on github so people can see the commit history. If you're not motivated enough to write it in the evenings after working a full day, you're probably not going to be motivated enough to do your own startup/freelancing setup successfully.
Once you've made something interesting, find companies that interest you, email them and describe why you're interested in them, that you're looking to get out of the corporate world, and that you made this cool thing, are they or someone they know looking for a programmer. You'll be mostly unsuccessful, but having a job gives you plenty of cushion and it only takes one yes.
If you're really serious, fly out to SF for the YC open house coming up. I have no connection to YC aside from rooming with a guy in the program but can attest that getting an in on the YC network will at least get you under consideration at a bunch of places.
I had a similar history. My startup was beset by the fact that 90%+ of the time I was alone. I was the only one doing the coding... and to be honest, it got hard to stay focused. Working with someone, especially who is depending on me, I can work huge days for weeks at a time. Drifting alone for a month at a time... not as much. The experience raised my respect for pair programming tremendously, if nothing else.
Since you mentioned lack of focus/tendency to get distracted - do you ever wonder if you're not "startup material"? I mean this not as an insult, but an honest question, since I know I wonder it. I figure the "startup people" who are stuck in faceless corporate jobs are still working at the insane pace necessary for startup life - if not at work proper, then at home. Is there any truth to that?
What does someone who is "motivated enough" look like when taken out of a motivating setting? Are they typical overachievers throughout life or do they seem lazy without the tremendous urgency of that lifestyle? Some mix of both, something else?
He's got a really important point here: Lack of focus / effort is going to be your downfall if you're weak. Assuming you're a competent programmer, there's no shortage of clients willing to hire you as a contractor if you need the extra cash to pay the bills. When I went full-time, I loved it immediately and I know it was the best possible thing for me but I consistently have to work on my effort and concentration to keep producing and being able to work on my projects. (I work on my own projects/apps & design/front-end to pay the bills.)
Hack after hours and put it on github so people can see the commit history. If you're not motivated enough to write it in the evenings after working a full day, you're probably not going to be motivated enough to do your own startup/freelancing setup successfully.
Once you've made something interesting, find companies that interest you, email them and describe why you're interested in them, that you're looking to get out of the corporate world, and that you made this cool thing, are they or someone they know looking for a programmer. You'll be mostly unsuccessful, but having a job gives you plenty of cushion and it only takes one yes.
If you're really serious, fly out to SF for the YC open house coming up. I have no connection to YC aside from rooming with a guy in the program but can attest that getting an in on the YC network will at least get you under consideration at a bunch of places.