My solution whenever focusing on goals / deadlines: edit hosts file (as root/admin, when necessary)
127.0.0.1 reddit.com www.reddit.com
127.0.0.1 news.ycombinator.com
127.0.0.1 twitter.com
127.0.0.1 other social / news domains...
The little bit of friction required to undo this is enough to remind me to get back to being productive.
Also, Pomodoros for pacing.