7 ms·
Get-shit-done - Easy way to stop distractions
- mrtron 15y agoI permanently blocked all from my laptop and only surf from my iPad now. Works great for me.
- john2x 15y agoCurious, how do you permanently block the sites?
- georgieporgie 15y agoI think it just means that the sites stay redirected in his hosts file.
- mrtron 15y agoCorrect. If I ever catch myself surfing to a website from my laptop, it gets bookmarked for my iPad and blocked in my /etc/hosts.
- chriswoodford 15y agothis comment thread is turning into quite the social experiment. is ADD a prerequisite for being a good programmer/hacker/etc...?
- jcromartie 15y agoI've ported this to a Bash script which is simpler and more extensible. It uses env variables to facilitate customization. https://gist.github.com/955437 https://gist.github.com/955437
- swah 15y agoHow does this compare to Programming, Motherfucker?
- rebelidealist 15y agoFor mac users, the Self Control app works really well. http://visitsteve.com/made/selfcontrol/ http://visitsteve.com/made/selfcontrol/
- bajsejohannes 15y agoI do this, although only by saying sudo cp hosts.play /etc/hosts or sudo cp hosts.work /etc/hosts It's simple, and surprisingly efficient.
- ianl 15y agoThe only problem with this method is that if you modify your hosts file, you have to modify both.
- StavrosK 15y agosudo cp /etc/hosts /etc/hosts.bak && cat hosts.work >> /etc/hosts sudo cp /etc/hosts.bak /etc/hosts Note: I just wrote this now with no testing whatsoever.
- pyre 15y agoJust create a Makefile or something that cats together hosts.common and hosts.work or hosts.play. all: cat hosts.common hosts.work.in > hosts.work cat hosts.common hosts.play.in > hosts.play Make common changes to hosts.common and easily build your final hosts files. play: cat hosts.play | sudo tee /etc/hosts > /dev/null work: cat hosts.work | sudo tee /etc/hosts > /dev/null
- macrael 15y agoHow often do you modify your hosts file? I only ever find myself adding more things to block to it.
- crocowhile 15y agoI did this in the past too. The amazing thing is that it actually cures the addiction, not just the symptoms. On the first day you find yourself clicking on the reddit bookmark like an idiot every 20 mins, only to be redirected to localhost. After a few days the impulse is gone and you can actually go back to a non censured /etc/hosts: your self control is back. YMMV.
- mvalle 15y agoDoes this work with Chrome? I believe Chrome does it's own dns resolution and skips the host file. (I defiantly know it won't resolve localhost if you're offline)
- JoeAltmaier 15y agoDoes it have a timer to keep me from modifying it every 2 minutes?
- iuguy 15y agoYou should be able to use an asynchronous cron scheduler to implement something like Pomodoro with this. Combined with the right notification tool this could work quite well.
- calloc 15y agoUse FreeBSD, set the kernlevel to something above the minimum, and add the flags to the file so it can't be changed, then until you reboot you won't be able to modify the hosts file =)
- datasink 15y agohttps://github.com/killsaw/Timeguard https://github.com/killsaw/Timeguard A similar script, but with an 'addsite whatever.com' command.
- pfarrell 15y agohttps://addons.mozilla.org/en-us/firefox/addon/leechblock/ https://addons.mozilla.org/en-us/firefox/addon/leechblock/ does windows of access, allows for x minutes, has grouping. Course, it's FF only where hosts file gets your whole connection.
- rodh257 15y agoStayFocusd for Chrome Users - https://chrome.google.com/webstore/detail/laankejkbhbdhmipfmgcngdelahlfoji https://chrome.google.com/webstore/detail/laankejkbhbdhmipfm... latest version has a neat feature which tracks links from blocked pages. Ie if I give myself 15 mins of HN a day, but end up wasting 2 hours because I only spend 10 secs on HN opening up tabs to read, it now tracks that. Any links you click from HN will count towards your time limit.
- Zachhack 15y agoleechblock has helped my compulsive reddit habit :/
- thurn 15y agoFor Mac users, SelfControl is a GUI approach to this idea: http://visitsteve.com/made/selfcontrol/ http://visitsteve.com/made/selfcontrol/
- guywithabike 15y agoOne of the best features is that it runs on a timer and you can't cancel it prematurely. Even if you restart.
- rimantas 15y agoYou can. It uses ipfw, and I think you can reset the rules. At least I managed when I tried it, but this was some 3 years ago.
- jgv 15y agoAlso if anyone wants to hack on it, SelfControl is on Github: https://github.com/slambert/selfcontrol https://github.com/slambert/selfcontrol
- ericmoritz 15y agoI used StayFocusd for a day or two and realized I was a lost cause when I found myself opening its sqlite database in my Chrome profile to add time to the clock.
- aniket_ray 15y agoUnfortunately you can just right click and disable extensions on chrome. Since the exit barrier is so low, I was always able to exit even when I shouldn't have.
- m0wfo 15y agoThis will obviously leave me continuously trying to access hacker news while preventing me from doing so. My continued attempts will block all other operations [i.e. work] hence creating a race condition. Far preferable is the event-driven technique whereby I make a cursory attempt at doing some real stuff until the HN bot tweets something of fleeting interest, at which point I defer said real stuff to a background thread to be completed in an asynchronous fashion.
- skid 15y agoIsn't the point of this approach to be _difficult_ to switch back and forth? Next thing you know there will be a chrome extension that swaps your hosts file and you will be separated from procrastination by a single click.
- georgieporgie 15y agoI found it useful to force myself to manually comment/uncomment lines in my hosts file. It gives a critical few moments for a bit of humiliation to set in, as you realize how desperate you are for diversion. On the other end, it gives a moment to mentally pat yourself on the back for eliminating the distractions.
- JacobAldridge 15y agoNowhere near as broad-ranging, but I'll make the note for HN users not aware of it - if HN is your sole (main?) distraction, you can use the noprocrast feature on your user page. Change to Yes, add a max time you allow yourself to visit HN and then the min time you want to be forced to be away. As I say, nowhere near as broadly applicable or useful as the OP, but worth noting especially if (like me) HN is your distraction of choice and you have minimal technical skills.
- keefe 15y ago>if (like me) HN is your distraction of choice and you have minimal technical skills. this is a small and interesting portion of mindspace
- calloc 15y agoThe noprocrast feature stops working very well when you use Safari. It has the web page preview stuff, and every-time that refreshes the noprocrast kicks in. Since it does that way more often than I visit the site the site is continuously in noprocrast mode.
- lionhearted 15y agoAfter playing with noprocrast, I found very good settings for me are maxvisit: 20 minaway: 1 That means, every 20 minutes HN kicks me off for one minute. I leave it like that constantly - it means if I'm spending time on here nonstop for an hour or two, I get a couple little reminders to ask myself if I really want to be on here. If I do, it's not a big deal to get up and make myself a tea or whatever until 1 minute passes, if not I close the tab and get to business, and it's low enough that I don't cheat by logging in with another browser or Chrome Incognito Mode.
- crpatino 15y agoIt is not the greatest distraction, but a significant fraction of it (#1 distraction, and about 3x as big as #2, according to RescueTime). While it is not a huge problem, and there is lot of value I extract from this site, culling seems like a good idea. A daily quota would help me avoid the high hitters and still keep myself "well read".
- keefe 15y agotreating the symptoms rather than the disease is only a good choice for short term or for incurable diseases
- eswat 15y agoYou may be right. But repeating an action forms a habit, or in this case learning to not repeatedly open up HN or Reddit can become a long-term habit for anyone with the right mindset.
- keefe 15y agomy main point being that if they stop with HN/Reddit something else will fill that gap. Not working is the issue.
- rbxbx 15y agoSorry to be the guy decrying PHP, but the only arguments I've found in it's favor are it's ubiquity and being sometimes "the right tool for the job" if you're quickly hacking together a dynamic webpage. Surely a simple cli app isn't the right job for this tool. Now, all that said, it _does_ work, and blahblahblah.
- yogsototh 15y agoYep, beware I didn't even tested it: #!/usr/bin/env zsh (($#<1)) && { print -- "usage: $0:t (play|work)" exit 1 }>&2 blacklist=( reddit.com ycombinator.com slashdot.com ) hostfile=/etc/host if [[ $1 = "play" ]]; then if [[ ! -e $hostfile.orig ]]; then cp $hostfile{,.orig} else print -- "You're already playin" >&2 exit 1 fi cp $hostfile{.orig,} for elem in $blacklist; do print -- "127.0.0.1\t$elem" >> /etc/host print -- "127.0.0.1\twww.$elem" >> /etc/host done fi if [[ $1 = "work" ]]; then cp $hostfile{.orig,} \rm $hostfile.orig fi /etc/init.d/networking restart
- robinduckett 15y agoThank god! Let me just waste some time getting this installed and then I'll waste some more time testing it, then I'll waste some more time posting this comment to hacker news.
- sbkirk 15y agoSo distracted by this.
- huherto 15y agoJust a quick hack. I added timer-applet in ubuntu. I work on 30 mins intervals and then rest 5 mins. It is pretty handy.
- MauriceFlanagan 15y agoSimilar to this, I use eternity time tracker on my iphone to work in 30 minute intervals. During the interval, no email, news sites etc. It has worked really well for me.
- rch 15y agoI might as well plug tasktop - it's great.
- patrickk 15y agoThankfully this was the first link on the HN homepage. Just reading the articles and comments made me feel sufficiently guilty to stop reading any more :)
- yahtzee 15y agoAlso, the StayFocusd google chrome extension works well - https://chrome.google.com/webstore/detail/laankejkbhbdhmipfmgcngdelahlfoji https://chrome.google.com/webstore/detail/laankejkbhbdhmipfm...
- agj 15y agoWhy such interest in this script? Besides being written in php, it's also a fairly kludgey approach to managing /etc/hosts. Is it the vulgarities? #!/bin/sh [ $UID -eq 0 ] || { echo "You're not root, asshole."; exit 1; } [ -f "/etc/hosts.$1" ] || { echo "/etc/hosts.$1 doesn't exist, asshole."; exit 1; } cat /etc/hosts.{$1,tail} > /etc/hosts ... sudo ~/bin/stopfuckingoff play
- thyrsus 15y agoIt was a sad day when Red Hat removed the insults from sudo.
- deleted 15y ago[deleted]
- adnam 15y agoI once wrote a similar script which was configurable and it installed as a service. It would periodically scan /etc/hosts to check I wasn't cheating. $ sudo /etc/inid.d/procrastination-ctl start OK. $ sudo /etc/inid.d/procrastination-ctl stop You need to wait 59 minutes before you can stop. Managed to waste a whole day on that one.
- tgandrews 15y ago> Managed to waste a whole day on that one I love the irony.
- jarin 15y agoI took a really simple approach: removing HN, Facebook, Clicky, and Google Reader from my bookmarks bar. Having to type them in manually instead of compulsively clicking is enough to limit me to an hour or two of dicking around per day.
- FaceKicker 15y agoI don't even use bookmarks because it would take longer to click a bookmark than typing "n" for HN (or "r" for reddit or "f" for facebook) and letting Chrome auto-complete and pressing enter, so this wouldn't help me that much.
- jarin 15y agoOh, I guess I would call myself a "burst typer", so I usually find it faster to just type all or most of the domain than to type one letter and check to see if Chrome got the right thing. But of course that requires a little bit of effort, so it's still just enough to make me consider whether to go there or get some work done. I just subconsciously don't trust one-letter autocomplete I guess.
- kami8845 15y agoin firefox i have 'red' <down> <enter> already ingrained for reddit, same with 'new' for HN ... it's automatic and you can't tell me typing it all out is faster :P
- koenigdavidmj 15y agoFirefox's AwesomeBar makes this hard. Hacker News is just a 'control-t y tab enter' away.
- yeag123 15y agoA Chrome extension that I use pretty regularly for this sort of thing is Stay Focused: http://goo.gl/gHWFQ http://goo.gl/gHWFQ
- sriram_sun 15y agoI'd call it git-er-done
- rbarooah 15y agoSafari users might like http://www.mindfulbrowsing.com http://www.mindfulbrowsing.com
- lani 15y agooh no !! i checked the list of sites being blocked, now have more of them to check up on ....
- idonthack 15y agoIs this really worthy of HN frontpage? Seriously, who among us couldn't write something similar in 5 minutes or less?
- dananjaya86 15y agoA crude implementation of Get-shit-done in Python. https://github.com/dananjayavr/get-shit-done https://github.com/dananjayavr/get-shit-done
- radu_floricica 15y agoUse to use cumbersome hacks with block lists in routers, but I discovered the SiteBlock extension for Chrome: make a list of "dangerous" sites, and give yourself a fixed time per day to visit them. In my casa, one hour works fine (although I'd probably prefer 2 :p) Address: https://chrome.google.com/webstore/detail/pfglnpdpgmecffbejlfgpnebopinlclj https://chrome.google.com/webstore/detail/pfglnpdpgmecffbejl... Website Blocker seems to be similar, but without a time limit: https://chrome.google.com/webstore/detail/hclgegipaehbigmbhdpfapmjadbaldib https://chrome.google.com/webstore/detail/hclgegipaehbigmbhd...
- neurolysis 15y agoFor anyone interested, I rewrote this entirely in bash. https://github.com/cdown/ncrast/blob/master/ncrast https://github.com/cdown/ncrast/blob/master/ncrast http://aur.archlinux.org/packages.php?ID=48731 http://aur.archlinux.org/packages.php?ID=48731
- chriswoodford 15y agoi'm actually surprised at the amount of time people spend procrastinating on something to help them stop procrastinating... or even more surprising might be the amount of time i've spent procrastinating by reading about people who've procrastinated by making tools to aid their procrastination... ...I'm going to get back to work :)
- ajarmoniuk 15y agoBlock reddit in /etc/hosts. Memorize reddit's IP.
- ivankirigin 15y agoI do this, and my scripts have actually gotten kind of complicated. To start, it's a command line utility. I need to answer the question "Do you want to waste your time?" with "yes" to turn off the filters. Then I didn't bother running in a way that the script had permissions to edit /etc/hosts so I need to enter my system password every time I want to make a change. I also automatically turn the filters on every hour. I also log both the number of times I turn the filters off and whether the filter is on at about 1pm. I'm running a test right now to not turn on the filters automatically every hour and there is already a noticeable decrease in productivity in my rescuetime. I'm about to update the logger to use the google charts API to save a historic graph of performance to a directory that is used as my desktop background.
- djbriane 15y agoDoes it block Outlook because thats the real reason I can't get anything done these days.
- bearwithclaws 15y agoThrow in some ASCII art to make things sweeter: figlet -f univers time to work! | boxes figlet -f starwars game time! | boxes -d dog
- keeganpoppen 15y agoInstead of doing work, I got stuck modding this to get better behavior for Mac. First I tried to figure out what the $restartNetworkingCommand mac equivalent was (dscacheutil -flushcache for those who are curious). This works pretty well for non-Chrome browsers (i.e. browsers that don't have absurd caching behavior). Then, given that Chrome (which maintains its own DNS cache-- a decidedly not absurd caching behavior, I acknowledge) is my browser of choice, I also set out to fix it so I didn't need to restart Chrome. This endeavor I have accomplished using one of my favorite jank-tastic tactics: running applescript from the command line. So here is my (Mac OS X 10.6+?) change: $restartNetworkingCommand = 'dscacheutil -flushcache; osascript <<EOF tell application "Google Chrome" make new tab at end of tabs of window 1 with properties {URL:"chrome://net-internals/#dns"} activate delay .5 set URL of active tab of window 1 to "javascript:document.getElementById(\'clearHostResolverCache\').click()" end tell delay .5 tell application "System Events" to keystroke "w" using {command down} EOF'; This, of course is made even more jank-tastic by manually sending command-w to close the window-- googling the proper command was more difficult than just doing it live :). So yeah-- clearly I needed this script before reading this post, but if I had it probably would have done some terrible things to the space-time continuum... I guess I'll just amortize the one-time cost by actually using the script. Starting now.
- keeganpoppen 15y agoyikes-- that formatting got butchered... anyone know if there's a better way to put code in comments?