The safest way is to just have your passwords listed in a random file on your computer. Its open if your computer is compromised, so just name it something innocuous and don't leave it on your desktop or in my documents.
[rant]
Alternatively, you can do what I do at work and just list all of your passwords for the company servers on a sheet of paper tacked onto the wall of my cubicle. It might piss IT off, but it pisses me off to have to remember passwords on over 20 different machines that change every 30 days, have to be 10+ characters with a number and symbol and you can't use the same password twice. Sure that works fine for my manager who only uses his personal machine, but for someone that has multiple web server clusters, database clusters, file servers, and multiple test vms for each of those it is insane. Oh and if I get a password wrong 3 times I am locked out of that machine until I contact IT, who will take minimum 24 hours to get back to me.
[/rant]
Not that I'm bitter or anything.