Created
September 15, 2009 20:38
-
-
Save abachman/187630 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
127.0.0.1 localhost | |
127.0.1.1 adam-desktop | |
### @NOPROCRAST ### | |
127.0.0.1 news.ycombinator.com | |
127.0.0.1 youtube.com www.youtube.com | |
127.0.0.1 techmeme.com www.techmeme.com | |
127.0.0.1 techcrunch.com www.techcrunch.com | |
127.0.0.1 reddit.com www.reddit.com | |
127.0.0.1 hacker-newspaper.gilesb.com | |
127.0.0.1 icombinator.net www.icombinator.net | |
127.0.0.1 readwriteweb.com www.readwriteweb.com | |
127.0.0.1 gizmodo.com www.gizmodo.com | |
127.0.0.1 engadget.com www.engadget.com | |
127.0.0.1 tuaw.com www.tuaw.com | |
127.0.0.1 macnn.com www.macnn.com | |
127.0.0.1 arstechnica.com www.arstechnica.com | |
127.0.0.1 digg.com www.digg.com | |
127.0.0.1 wired.com www.wired.com | |
127.0.0.1 cnet.com www.cnet.com | |
127.0.0.1 zdnet.com www.zdnet.com | |
127.0.0.1 mashable.com www.mashable.com | |
127.0.0.1 boingboing.net www.boingboing.net | |
127.0.0.1 lifehacker.com www.lifehacker.com | |
127.0.0.1 gawker.com www.gawker.com | |
127.0.0.1 nytimes.com www.nytimes.com | |
127.0.0.1 tweetmeme.com www.tweetmeme.com | |
127.0.0.1 venturebeat.com www.venturebeat.com | |
127.0.0.1 torrentfreak.com www.torrentfreak.com | |
127.0.0.1 kottke.org www.kottke.org | |
127.0.0.1 daringfireball.net www.daringfireball.net | |
127.0.0.1 metafilter.com www.metafilter.com | |
127.0.0.1 codinghorror.com www.codinghorror.com | |
127.0.0.1 zenhabits.net www.zenhabits.net | |
127.0.0.1 macrumors.com www.macrumors.com | |
127.0.0.1 radar.oreilly.com | |
127.0.0.1 engadgetmobile.com www.engadgetmobile.com | |
127.0.0.1 gigaom.com www.gigaom.com | |
127.0.0.1 crunchgear.com www.crunchgear.com | |
127.0.0.1 news.google.com | |
### @NOPROCRAST ### | |
--- noprocrast script ------------------------------------------------------------------------ | |
#!/usr/bin/env ruby | |
def toggle_hosts | |
in_noprocrast_block = false | |
new_hosts = [] | |
toggle = :which | |
count = 0 | |
File.open('/etc/hosts').lines.each do |line| | |
if /@noprocrast/i =~ line | |
if in_noprocrast_block | |
in_noprocrast_block = false | |
else | |
in_noprocrast_block = true | |
new_hosts << line | |
next | |
end | |
end | |
if !in_noprocrast_block | |
new_hosts << line | |
else | |
if /^#/ =~ line | |
new_hosts << line.gsub(/#/, '') | |
toggle = :active | |
else | |
new_hosts << "#%s" % line | |
toggle = :inactive | |
end | |
count += 1 | |
end | |
end | |
puts "NOPROCRAST is #{toggle} for #{count} sites." | |
return new_hosts.join() | |
end | |
`cp /etc/hosts ~/hosts.$(date +%Y%m%d%H%M%S)` | |
`echo "#{toggle_hosts}" > /etc/hosts` | |
--- index.html ------------------------------------------------------------------------------- | |
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Really?</title> | |
<style> | |
body { | |
font-family: 'Helvetica Neue'; | |
font-size: 42pt; | |
font-weight: bold; | |
margin-top: 15%; | |
} | |
</style> | |
</head> | |
<body> | |
<center> | |
Get back to work. | |
</center> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment