Awesome-Python-Scripts/Website-Blocker/README.md
2018-10-03 00:04:07 +05:30

21 lines
894 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# Website Blocker using Python
This is a program which blocks certain distracting website like Facebook, Youtube etc during your work hours.
## Libraby Used
time (datetime is imported from python)
## Host Files
Host is an operating system file which maps hostnames to IP addresses.
Using python file handling manipulation I have changed hostnames on the hosts files for a certain interval of day when I'm working and need no distraction and deleted it then after when the time is over.
## Location of host file
### Host file on Mac and Linux :
$ /etc/hosts
### Host file on windows :
$ C:\Windows\System32\drivers\etc
## Note
* Windows user need to create a duplicate of OSs host file. Now provide the path of the duplicate file in hosts_path mentioned in the script.
* For scheduling above script in Linux you have to open crontab in your terminal as a root.(use sudo command)