NT has a hosts file, they just stuck it somewhere in system32.
Had to stick reddit and hackernews in there on my work PC long ago.
A better solution for me is a chrome extension that blocks it for 20 minutes at a time. Long enough to make decent progress and get started on work, but no so long that I resent it and give up.
Anecdotally, I used to follow a lot of these methods described here, but more specifically:
- Keeping a journal
- Reducing blue-light before bed
- Diet & excercise
- Meditations
I do agree that there is merit in each one of them, but absolutely nothing worked better than the "drugs" that was prescribed to me.
In fact, when first speaking to a specialist, it was like he already knew me. He knew my problems better than I did (goes to show that your problems aren't unique after all).
I do wish I had sought help sooner - my life changed dramatically in the time span of initial treatment to now.
1. Keep your phone on silent (or shut off) in a different room than your office (or wherever you're trying to work)
2. Install an app like Refine on your phone and block all social media and sites that you open up frequently (HN would possibly be an example)
3. Keep your phone in a different room before going to sleep.
4. If you like listening to audiobooks, consider getting an Amazon Echo. I like to listen to audiobooks before falling asleep and with the Echo you can set a sleep timer and then play an audiobook and it will stop playing after the sleep timer expires.
5. On your laptop (assuming you use Mac or Linux) add social media and other frequently visited non-productivity related sites to your /etc/hosts file.
Personally I try to avoid drugs for these kinds of things. In my view it's a matter of self improvement and self-discipline which are things that can be developed with effort.