Ryan Hayden

July 14, 2023

How to Setup a Distraction Free Computer for Writing

Recently, I finished a project that has been on my mind for a year or so. I wanted to have a computer in my study to use for writing and note taking, where distractions were just about impossible.

When I say distractions, I'm talking about the normal subjects like:

  • Social media
  • News
  • Search Engines
  • Shopping
  • Youtube

But also things you wouldn't think of like:

  • Applications I don't need
  • App stores
  • Music
  • Terminal access

Basically, I wanted a computer that was as close to a word processor as possible and where I could access a few specific sites (blueletterbible and wikipedia) I use for study and NOTHING ELSE. I wanted a computer I could safely keep in my study that wouldn't be constantly singing the siren song of the internet, but where I could access what I need from the internet.

Here is how I pulled it off:

The Computer

IMG_1731 Small.jpeg

The computer is actually an old Mac Mini from several years ago. I'm not sure which version of Mac OS it runs, and it doesn't matter, because I'm not using Mac OS on this at all. It was just an old computer I had lying around that I know would be quiet in my office.

I paired it with an extra keyboard and mouse I found, and a square dell monitor I pulled out of a closet. (Eventually, I'm going to get an e-paper monitor for this.)

The Operating System

The reason I didn't really care much about what computer I used is because my requirements for it were so low. 

  • 98% of the use of this computer is running one app - Obsidian - which is just a text editor.
  • I need internet access to sync my notes.
  • I need a browser capable of pulling up wikipedia and blueletterbible.org
  • I need a pdf viewer and printing utility for occasionally printing my notes.

That's it. So I downloaded Ubuntu and overwrote the old version of Mac OS. (Again, this thing has been buried in a closet for years, and I have several powerful macs in other places.) 

hudiV1JElIOeNNSTcnVRLCQ-Ekr_COZepxM_UBWmBZyDUeP3wzE9cGUyB8zZMNPiyQQXkmEmOssKNvs1VMvx58N5ay.jpeg


The Setup

In order to get this machine setup as distraction free I needed to do four things:

1. Download Obsidian

This is not hard. I just connected to the Ubuntu Software store and searched for it. 

2. Block distractions in the /etc/hosts file

The /etc/hosts file is a file on every Mac/Linux/Windows computer that acts as kind of a DNS server for your machine. You need to have administrator access to use it, and can get to it by typing sudo nano /etc/hosts in the terminal (on mac or linux).


Because this acts as a DNS server for your computer, you can overwrite where certain domains go for your entire computer. So I just added these lines to the top of the /etc/hosts file and saved it.

127.0.0.1 twitter.com
127.0.0.1 www.twitter.com
127.0.0.1 m.twitter.com
127.0.0.1 facebook.com
127.0.0.1 www.facebook.com
127.0.0.1 m.facebook.com
127.0.0.1 youtube.com
127.0.0.1 www.youtube.com
127.0.0.1 m.youtube.com
127.0.0.1 google.com
127.0.0.1 www.google.com
127.0.0.1 duckduckgo.com  
127.0.0.1 www.duckduckgo.com\
...etc.


Basically, I made a list of any site I would ever be tempted to waste time on, and set the DNS on that machine to point that site at 127.0.0.1 (or localhost.)

Now I guess you could find IP addresses for those sites and go to them directly through IP, but I don't know them and that probably wouldn't work for most of them. So this is a good enough solution to keep me off of the time wasters on this computer.

3. Setup another account

The third step was creating a second user account on the machine for me to use. In Ubuntu, you can choose "administrator" or "standard" accounts, and I chose the standard account and set the machine to automatically boot into this standard account.

(This is a random screenshot I found on the internet - ignore the arrows.)

Add-a-User-account-using-Ubuntu-22.04-GUI.png

This account follows all of the rules setup in the DNS file and cannot install software. It's limited to the software installed (which is just the default minimal ubuntu stuff and obsidian.) Crucially, I cannot access or edit the /etc/hosts file from this account.

The last step is...

4. Have my wife change the admin password

The last thing I did was ask my wife to change the admin password to something I didn't know. (She'll keep track of this.) This way, if I want to install software or change the hosts file, I need to ask her. It's a pretty good incentive to just keep the computer doing what I set it up for.

Conclusion

I now have a completely adequate computer in my study for access my knowledge management system and doing some writing, but that isn't a temptation for me to be distracted to other things I don't need to be doing in there. I can go into the study for the deep work of study and writing, and know that distractions won't follow me in there.