Skip to content

Instantly share code, notes, and snippets.

@eik3
Created December 20, 2010 16:39
Show Gist options
  • Save eik3/748605 to your computer and use it in GitHub Desktop.
Save eik3/748605 to your computer and use it in GitHub Desktop.
how to prevent your computer from talking to facebook
# use the 127.0.0.2 address of the loopback interface so that it doesn't interfere with other servers on localhost
echo '127.0.0.2 blog.facebook.com static.ak.connect.facebook.com www.facebook.com facebook.com static.ak.fbcdn.net connect.facebook.net creative.ak.facebook.com ads.ak.facebook.com ads.ak.facebook.com.edgesuite.net' | sudo tee -a /etc/hosts
# run a tiny ruby/rack app with unicorn to reply with an empty HTTP 200 response on all requests
sudo unicorn -D -l 127.0.0.2:80 -e 'lambda { |env| [ 200, {"Content-Type" => "text/plain"}, "" ] }'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment