You would need PSN patch (sometimes breaks Cobra Emu's in Habib FW), and MM stealth if you're using it.
The last 2 posts pretty much summed it up. Only log in to PSN in-game, and never prior. Never launch homebrew while logged in, and don't play any FPS games as they're probably watched a lot more closely.
You can extract the PSID/CID from another PS3 dump or buy one from someone who has no need for online services. (Warning: This isn't worth it at all unless you have a trustworthy source. Most sites/sellers are scams, and since this isn't a tangible item, if you pay via Paypal, you aren't getting your money back). Also if you got a PSID/CID, there's no guarantee how many people are using it, so you could find yourself banned not even having been on PSN.
For what it costs in time/effort for getting banned, it's easier just to buy a 2nd hand PS3 for cheap and use it on OFW.