Ah the old hosts file blocklist trick. I tried that 20 years ago, but my dopamine craving brain wasn't fooled. Paul Graham tried owning two computers, one without internet https://paulgraham.com/distraction.html . That too didn't work for him. My current strategy is to only use an RSS reader in my browser. HN posts with x upvotes, a few twitter accounts, a few facebook accounts, a few youtube channels, and a few substacks are all I see. No ads, no infinite feed. Every hour or so I can go to the feed trough and consume a few posts. Feels healthier. The distractions are there but the faucet is limited to a drip.
What I found works best for me is to read more. Reading (hard copy) trains my ability to stay focused, and it translates into my ability to focus on work. Twitter/Hackernews/Reddit are still a click away, but I just don't fiend it as much.
For those that would try to talk themselves out of it and ^C the process, it could be useful to make things a little bit harder by putting the process in the background :)
There are multiple ways to achieve this:
nohup focus.sh &
nohup stands for "no hang up". It will run a command/script in such a way that it ignores the SIGHUP signal. The SIGHUP signal is typically sent to a process when the terminal is closed or the session is terminated [0].
Another way could be to put the process in the background and then use `disown`, which removes the job from the shell's job table [1], effectively disassociating it from the shell session. This prevents the job from receiving SIGHUP signals just as before.
./focus.sh &
disown
Finally
setsid focus.sh
This will launch the script in a new session [2], so that when you close your terminal it won't receive your current session's SIGHUP signal.
A very good StackOverflow explanation [3].
EDIT: actually, ^C the process already is a bit of a PITA since you would then need to manually put back the original /etc/hosts file :D
One thing I'd add to this is to schedule it in the future. Sometimes, you can't bring yourself to block all websites right now, but you can happily make it a problem for your future self. I've written a similar script to do this and had success with it.
This is an excellent application of George Ainslie’s concept of future reward discounting. Very powerful concept that can be fruitfully applied to all sorts of things in life: http://www.picoeconomics.org/
Good point. I tried it without it, and for some reason it didn't work. I didn't feel like figuring out why, so I left it. (My excuse was that in the future using an env var could let me set my default checking duration for the day/session without editing and reloading my .bashrc; obviously I'd have to check whether it was already set rather than just overwriting it, though.)
For me, procrastinating by looking at websites is usually a sign that something else is wrong, e.g. I don't really see the purpose of the task I'm supposed to be doing. When I'm excited by a task I find I don't procrastinate. Unfortunately it's not always possible to choose just the exciting tasks for my plate!
precisely. And for me I am at my most vulnerable when I am context-switching for this reason.
One of the most important keys to keep in mind is: always have a clear, delineated next action. Such that no thought is even necessary to know what you need to do. And plan the next step out /before/ you need to perform it, not in the moment of.
I think so—there are multiple trillion dollar companies out there whose business model is to take your focus. If you can out compete a trillion dollar company, that’s pretty good, right?
I think a better way to think of this is breaking habits. While some people do an innate struggle staying on task, there's also a large portion of people who have built the habit of task switching and just need a tool to help them break that habit.
In today's world: yes. The flip side of some types of ADHD is hyperfocus, where you can simply lose hours doing something and forget to eat sleep or drink, you're so focused on a thing.
I've wondered this as well. For all my faults, I can quite easily focus on a single task for an extended period of time.
In fact, if I've got a project that I'm actually interested in, it'll consume weeks or even months of my time, to the point where I have to make an extra effort to break my focus on spend time doing other things (like going outside).
if you’re on iOS, i found that the focus feature + screen time limit is pretty good at this. basically you can block out any notifications that you want for a set period of time. but yea, it still doesnt stop you from physically reaching out to your phone
Try the app called Opal. Similar thing but you can always skip the block. The trick is that each time you skip the block, there’s a longer and longer cooldown period to skip it again.
sudo hyperfocus-like-I'm-a-sophomore-again
Sorry but 10 years of effort and no software trick helped me stop procrastinating, except pulling the cables off the router or going to a library.