To start with, don't let your job and your boss define who you are: it is a job not your life.
Develop tacticts that work for yourself and your present circumstances and keep up your mood
(remember Harvard Business Review
In practice you could:
- Manage upwards - try to understand what is important to your boss and why, what makes him/her tick,
make yourself valuable and develop a positive working relationship.
- Manage yourself - focus on what you can control and do it well.
- Leave - if neither option one or two work, then change your job.
Remember the 3 questions:
Do you like yourself?
Do you like what you do every day?
Do you like how you do what you do?