While it is nice to imagine there are things one can do to lessen the adverse impact of a bad boss, the harsh reality is that most of these things will either be ineffective or will get you fired (of course, you’ll be fired for a quite different reason). I’ve seen a couple of techniques that seem to work well for the right people. One is strong physical intimidation; basically putting the fear of god into the manager and making them very much want to keep out of one’s way. The other is to kill the bad boss. This is, however, apparently regarded as illegal in many jurisdictions so it doesn’t appear in many case studies or in lists of recommended strategies.
It is, nevertheless, 100% efficacious.