1. Get a new job doing something more to your taste. Easy if your skills, salary expectations and local job opportunities are compatible. Remember though it's a job, so it will always have some bad parts. Or do a startup if you don't have money worries.
2. Stay and do what you are told (with an occasional moan!) This is a pretty common scenario for a lot of people.
3. Try and change things. Slowly... This may require compromise and improving your communication and influencing skills to people who may not have technical knowledge but have some kind of power.
Good luck!