The simple way not to get towed away is not to park in a
towing zone. How simple is that.
However, we are not all do-gooders, and sometimes there's simply no parking to be found. You have to park in an illegal spot. But how not to get towed away? I have spoken to some towers (people who tow, not tall buildings), and this is what I came up with:
They can only tow you away when you park in a legal fashion in a place where you're not allowed to.
So if you parallel park in a towing zone, they'll tow you away. However, if you park all squiff, diagonally on the sidewalk with one tire still on the street, they simply can't get the towing truck properly aligned with your car to tow it away. (I assume that in your country they do not tow away by attaching a hook to the front of the car, but pitchfork the car onto the towing vehicle. This is how they do it here, in Israel, anyhow.)
Actually, all you have to do is park half on the street and half on the sidewalk and they won't be able to tow your car away, unless the sidewalk is very low. This is because they can't get the pitchfork in properly. However, they might get ambitious and try anyway. The surest way not to get towed away is simply to park at 90 degrees to the curb. Yes, it's ugly, yes, it's disgusting. Yes, it works. There's no way they can tow you away like that. You say you'll get a parking ticket? Well, inspectors will give you a ticket anyway if you park in an illegal zone (at least in Israel, you get a ticket AND get towed.) So what do you have to lose?
I personally like to leave a note for the pedestrians, apologizing for standing on the sidewalk. It's not their fault that I park like that. (P.S. Important note - I always make sure there's enough space on the sidewalk for a wheelchair/pram to pass.) I write "Sorry I'm blocking the sidewalk, but this is the only way not to get towed." Maybe one day, this will piss off an inspector so much they'll bring in a helicopter with a big magnet to tow me away. That would kick ass!