Do the Job in Order to Get the Job
From AndrewMoore
A while back, I read a book called Ask the Headhunter which in part describes how to act in a job interview to increase your chances of getting the job. One of the things it recommended you do is to ask the potential employer what specifically you would be working on if you worked there. When he tells you, then you describe how you would do that. The book refers to this as something like "doing the job in order to get the job," and it makes a bit of sense.
Somewhat coincidentally, I currently work for a private company that pays me to contribute code to an open source project. My company is not the only contributer to that source base; there are many other individuals who contribute. It's a pretty good setup since I get to work on open source code and still have a paid position. I've been asked a few times by friends how I got such a position and how I would do it again. I've come up with a couple of suggestions.
First is to have some code that you can share with potential employers. If your current code is owned by your current or former employer and you can't share it with a potential employer, then you need something else to show people. One good way to get this is to write some open source code. Either start a project to write something you want written, or contribute to an existing open source project. This is a great thing to do as a hobby a few hours a month while you're actually employed. That way, you're building a publicly available body of evidence of your engineering abilities before you need to show it to someone.
If you don't want to do this type of work for free, there are plenty of ways to get paid in the short term for writing open source code. For instance, you can apply for a grant from TPF. If you can't think of anything good to write, look around a bit more. This recent post on the cpan-testers-d list shows people looking for someone to write open source code for money.
Since my employer uses and contributes to this open source project, if we were to hire another engineer, one of the first places we would look is at recent contributors to the same code base. They already have experience with the problems we're trying to solve and the body of code that we're working on. This brings me to my second point. If you have a particular field in which you're interested in working, contribute to something in that field. Even better, if you can find an open source project in your field of interest that has a commercial contributor, contribute to it for a while. Then, ask that company if they will hire you. You can demonstrate that you can do that specific job well, so they're much more likely to hire you. Getting a job at a company that writes code to deal with widgets is a lot easier if you've already been writing code to deal with widgets that they can look at.
If I were interested in another engineering job, I'd use my open source code as an example of what I could do, and if I had a particular field or company in mind, I'd make sure my open source code was relevant to them.