Habits are hard to break but I've also found it surprisingly easy to manipulate yourself by putting an annoying obstacle in the way. For getting work on time I can't snooze-beat the combination of a wake up light and a distantly located mobile alarm.
On internet use restriction the best solution so far has been to use a simple electronic plug timer connected to a laptop without a battery. Zap - no internet for you.
There ought to be a solution that installs itself into the computer's firmware though. Most of us on HN install new operating systems at a much higher rate than the typical user so having a persistent solution would be huge.