I am aware of this question: How can I prevent iPhoto from opening everytime I plug my iPad/iPhone?
And several others, but none of them present a "universal" solution, I don't want a fix for one situation, I want OSX to stop interrupting me, permanently.
The nature of my work mean I am constantly plugging lots of devices on my Mac.
Also, my Mac came with buggy USB ports, and I can't fix it or send it to repairs or exchange.
This mean it is constantly opening software or trying to do stuff automatically and causing problems, some examples:
When working programming iOS devices, it keeps opening iTunes, Photos, Camera Capture, and some other random apps when the USB ports problem make it mis-recognize the device, also the USB ports keep reloading the devices randomly sometimes, making the apps open again, sometimes with misread IDs, making OSX think is a new device and ignore past settings.
I almost ruined some device more than once by iTunes offering to sync or upgrade it, with windows that steal focus no less.
I am trying to see what is wrong with an old HDD that seemly works but stopped booting, but when I plug the HDD, OSX starts to work without any indication on the interface of what it is doing, except the HDD lights flashing, then after several minutes working slowed down, it showers me with dialog boxes (one offering to use the HDD as Timemachine, another asking if I wnana format it, another informing me it is damaged and unrepairable, and so on). Sometimes some OSX process on the background ends unmounting the HDD, and mounting it again (or automatically mounting it again if I umount it manually), then OSX do it all over again (including the dialog box plague).
OSX auto-mounts other people pendrives that I didn't necessarily wanted to mount, and then happily write random OSX crap (like .DS_STORE) on them, making the pendrive owners pissed off, and corrupting data (sometimes I want to plug pendrives to scan for lost data).
There are other issues too, but all of them has a single source cause: OSX automatically trying to do stuff when I plug anything on it. So how I tell it, to never do that? the only thing that should automount is the internal HDD that is needed to be mounted to boot in first place, I don't want any other device not absolutely necessary for the machien to function turning on automatically, for any reason, and don't want software reacting to me plugging and removing stuff either, even if I have to later manually mount USB drives with command line.