Set specific, detailed, short-term goals for yourself. For example: I'm going to go x amount of days/hours without eating anything from the vending machine, or I'm going to walk at least 30 minutes every day. Don't make the goal longer than a week or so, and make them attainable. As soon as you meet one, set another that's slightly harder. Write them down. You'll be more accountable and more likely to work toward them if you write them down AND tell someone about them.
Hope that helps! It can be tough to get back on track on your own!