TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Focus.py

112 pointsby _ikke_about 13 years ago

25 comments

TeMPOraLabout 13 years ago
I'm not sure if everyone noticed, but the primary interesting thing here is NOT that it blocks off domains at certain times (everyone and their dog wrote such scripts for themselves). The nice thing is that each rule is defined as a function, which means that you can put a bit more complex rules inside, or just add some logging and track every name resolution against given domain.<p>Which actually brings me to question: aren't domain-IP pairings cached by the browser?
评论 #3975534 未加载
评论 #3976835 未加载
spullaraabout 13 years ago
How is this at the top of HN? Apparently people that need this stuff sit on HN and vote it up. If you don't want to go to these sites I have some advice: Don't go to them.
评论 #3975531 未加载
评论 #3975612 未加载
评论 #3975461 未加载
评论 #3975378 未加载
评论 #3976311 未加载
ideamonkabout 13 years ago
Nice effort. Having tried RescueTime and more crazy tools last year, I realized it's in the doing. If you enjoy it nothing can distract you. If you really don't enjoy it from inside (i.e. if your ends are not aligned with the going), nothing can help you. It's better to alter your mindset about your work. Spending 3 days on that = lesser distractions for long time.
评论 #3975257 未加载
evmarabout 13 years ago
This, like other github themes, has bad CSS that makes the monospaced text come out as serif on Linux. I know the github crew uses Macs but it makes me a little sad to see they don't test on the system that spawned their namesake. :(
评论 #3975551 未加载
评论 #3975319 未加载
评论 #3975431 未加载
评论 #3975351 未加载
评论 #3975423 未加载
eblumeabout 13 years ago
Personally I use Chrome Nanny[1] for this sort of thing, but it's a pretty interesting idea.<p>1: <a href="https://chrome.google.com/webstore/detail/cljcgchbnolheggdgaeclffeagnnmhno" rel="nofollow">https://chrome.google.com/webstore/detail/cljcgchbnolheggdga...</a>
评论 #3975417 未加载
pbiggarabout 13 years ago
It's amazing that we, who like to think of ourselves as do-ers, need tricks to keep us focused on the goal. Not that I'm criticizing: I use no less than 3 similar tools at the same time, and I still have trouble. What is wrong with us!
pacomerhabout 13 years ago
It's funny how a distracting website recommends you tools to avoid being distracted. Suppose I'm using this tool to block HN, now I feel like I'm missing out on a new tool! Geez.
评论 #3975305 未加载
cdavenabout 13 years ago
I once spent a couple of hours writing a bash script that edited my /etc/hosts file (e.g. resolve facebook.com to 127.0.0.1), and then ran that using crontab to allow some breaks during the day.<p>It was fun, but then I had to go back to work. ;-)
jeezabout 13 years ago
On a similar note, can anyone suggest tools like rescuetime for firefox? The few apps that the Firefox Addons website suggests are all outdated (not compatible with ff4+).<p>Wouldn't a time tracker app with built-in pomodoro timer and website blocker be the ultimate tool? :) Maybe we could toss in functionality to take screenshots every few seconds and show it back to us at the end of the day.
darklajidabout 13 years ago
"After you identify the process listening on port 53, run sudo kill -9 with the process id."<p>-9 as in KILL? I don't do Python, so I cannot comment on the quality of the project. But this FAQ should be changed. People that know how to stop a process don't need a FAQ entry. People that don't know how to do that shouldn't be trained to think that this is a sensible way to stop a program.
评论 #3976090 未加载
Bjoernabout 13 years ago
I wrote myself a similar thing a couple of years ago but just leveraging the /etc/hosts file with some scripting.<p><a href="https://github.com/rennhak/ProcrastinatorsHelp" rel="nofollow">https://github.com/rennhak/ProcrastinatorsHelp</a><p>But believe me, if you want to doodle there is nothing going to stop you.
toxikabout 13 years ago
This is a great idea, BUT it'll slow your system so no thanks.<p>My tip to you guys is to turn off Internet access until you need it, close the browser. When you open Reddit, HN, Facebook or whatever - close it deliberately. Practice that. Move the cursor to the X, push it and MEAN IT.
fsckinabout 13 years ago
Couldn't this use /etc/hosts instead and be instant to change without the need for a DNS server?
评论 #3975303 未加载
评论 #3975282 未加载
tferrisabout 13 years ago
Great idea. Would like to have it precompiled, I don't have Python.
评论 #3975457 未加载
potomakabout 13 years ago
This could work great in conjunction with Tomatoes[1]<p>[1] <a href="http://tomatoes.heroku.com" rel="nofollow">http://tomatoes.heroku.com</a>
kmfrkabout 13 years ago
I use Freedom. (Costs money.)<p>Works really well: <a href="http://macfreedom.com/purchase" rel="nofollow">http://macfreedom.com/purchase</a>.
haartsabout 13 years ago
Just a heads up for Mac users: changing the /etc/resolv.conf didn't work for me. Changing it in System Preferences -&#62; Network did work.
yaixabout 13 years ago
Hard to read the page. A third of my netbook screen is covered by the style="position:fixed;" header.
ya3rabout 13 years ago
I really like the part where the author made it really hard to stop it! If you know what I mean.
khakimovabout 13 years ago
for fun I did this <a href="https://github.com/khakimov/freodom" rel="nofollow">https://github.com/khakimov/freodom</a> (yea, simple 127.0.0.1 in /etc/hosts), you can add this feature in your project:<p>- Automatically changes status to DND (skype/adium)
krat0sprakharabout 13 years ago
How can I make this work on Windows? My office laptop runs win7.
评论 #3975745 未加载
flazzarinoabout 13 years ago
technical countermeasure to a human behavior issue?
tutu12777about 13 years ago
Nsnsnsns
adamsilverabout 13 years ago
That's some pretty Python code...
drivebyacct2about 13 years ago
seems like there are easy ways of finding the pid.