Blocking FB

Sometimes I get this feeling that people are spending way too much time on facebook.  I don't like that.  Not at home, at least.  I'd rather have the family spend some time with the family.

Sometimes, I want to block it.

And I do.

To block facebook, add the following lines to your hosts file:


127.0.0.1 www.facebook.com
127.0.0.1 facebook.com
127.0.0.1 static.ak.fbcdn.net
127.0.0.1 www.static.ak.fbcdn.net
127.0.0.1 login.facebook.com
127.0.0.1 www.login.facebook.com
127.0.0.1 fbcdn.net
127.0.0.1 www.fbcdn.net
127.0.0.1 fbcdn.com
127.0.0.1 www.fbcdn.com
127.0.0.1 static.ak.connect.facebook.com
127.0.0.1 www.static.ak.connect.facebook.com


The path to the hosts file in Windows (whether it's NT, XP, Vista, 7 or 8), is as follows:
%systemroot%\system32\drivers\etc\
where %systemroot% is usually c:\windows unless you installed Windows on a different partition.

You can't really navigate to the file and edit the thing.  Newer versions of windows wil complain about you not having sufficient privileges to do so.

So, what you want to do instead is open the menu (press the windows button, super, or whatever you want to call it), type:  notepad.exe, right click the icon, and select "run as administrator."

In the open notepad, go to file > open, and navigate to the hosts file.  This way, it will let you edit and save it.

 In linux, it's a lot easier than that.

the file is located at /etc/hosts

You can't edit as a normal user, so you need to gain root privileges.

you can do any of the following, depending on your distribution, desktop environment, window manager, etc:

gksu gedit /etc/hosts
gksudo gedit /etc/hosts
kdesu kate /etc/hosts
kdesu kwrite /etc/hosts
gksu leafpad /etc/hosts
gksudo leafpad /etc/hosts

Replace gedit/kate/kwrite/leafpad with mousepad, medit, geany, or whatever text editor you happen to be using. If a non-graphical editor is preferred, you could do sudo, su, or sudo su, either way,  it works.

If you're using a non-graphical editor, I'd take it you don't really need instructions to get to where you need to get ;)

Optionally, If you know how to add rules  and exceptions to your router, it's an even better choice.  You can just blacklist the aforementioned sites, and FB is a goner :)