The alcohol part was relatively easy. All I did was top persuade myself that I am actively training for racing etc and that alcohol would adversely affect that. It provides a convenient excuse when out "I can't, I'm training" which is far more socially acceptable than "I'm a self righteous teetotaller".
As for smoking, I've never been able to give that up.
..d