I've told my dog I will shot him in the head if he attempts #1 or #2 within 10 feet of my speakers. It's worked so far but he hasn't gotten old and broken down like me yet.
I've had that same conversation with every pet I've had, it works surprisingly well.