Open source can also be a way to get the same job "interview" you'd get from moonlighting. This isn't an option for people who work on a highly proprietary code base, but if you can find the sort of job where you are allowed to release portions of your project as open source or make contributions to an open source project, you may end up creating a large network that is already very familiar with your coding ability, what it's like working with you, how you present information, and so forth. That's a lot more valuable than standing at a white board explaining how to detect cycles in linked lists.
But you could do it the other way around as well. Do some open source work for a company you're interested in joining/contracting for. For example, a developer wrote an iOS client library for our payments API. https://github.com/balanced/balanced-ios