Atul Summer Internship Report
Atul Summer Internship Report
CERTIFICATE
Atul pratap singh tomar 1814310057
DECLARATION
I hereby declare that the Summer Training Report entitled WEBSITE BLOCKER USING
PYHTON is an authentic record of my own work as requirements of Summer Training during
the period from MAY 2020 to JUNE 2020 for the award of degree of B.Tech. (Computer
Science & Engineering), IMS ENGINEERING COLLEGE, GZB.
(Signature of student)
Atul pratap singh tomar
1814310057
Date: 17-03-2020
Head of Department
(Signature and Seal)
Atul pratap singh tomar 1814310057
ACKNOWLEDGEMENT
About Institute :
Their Associations :
1. 50+ colleges are collaborated with us.
2. Successfully placed 800+ students.
3. Transformed life's of 1500+ students by career counselling in
getting jobs.
4. 40+ MNC’s are collaborated with us.
5. 80+ consultancies are associated with us.
Atul pratap singh tomar 1814310057
CONTENT
⮚ Abstract
⮚ Introduction
o Objective
o Project Description
o Project Implementation
o Process
o The hosts file
o Configuration
⮚ Benefits of Website Blocker
⮚ Prerequisite
⮚ What is python
⮚ What is Host File
o Working of host file
o Location of hosts file
⮚ Scheduling
o Scheduling in Windows
o Scheduling in Mac
⮚ Source Code
⮚ Snapshots
⮚ References
Atul pratap singh tomar 1814310057
Abstract
Introduction
we are going to build a real-time most popular python
application known as website blocker.This application can be
used to block the websites so that the user can not open them
during the specific period.
python.
Objective:
The objective of Python website blocker is to block some
certain websites which can distract the user during the
specified amount of time.
In this, we will block the access to the working time in this
python application is considered from 9 AM to 5 PM. The time
period except that time will be considered as free time.
The list of some particular websites during the working hours so
that the user can only access those websites during the free
time only.
Project Description:
Atul pratap singh tomar 1814310057
Project Implementation:
1. We know that every system/PC has a host file whether it is
Mac, Windows or Linux and write commands to get a host file.
Atul pratap singh tomar 1814310057
Process:
To block the access to a specific website on the computer, we
need to configure the hosts file.
The hosts file:
The hosts file is a local file which was used to map hostnames
to IP addresses in the old days. Although the DNS service is
used nowadays to map the hostnames to the IP addresses, the
host file is still very complex and can be used to configure the
mapping of the IP addresses locally.
Location of hosts file:
The location of the hosts file varies from operating system to
operating system.
Windows: C:\Windows\System32\drivers\etc
mac and Linux: /etc/hosts
Configuration:
Since the hosts file contains the mapping between the host
names and IP addresses, let's look at the content of our hosts
file first stored as /etc/hosts as we use CentOS 7 (Linux).
Atul pratap singh tomar 1814310057
As we can see in the above image, the mappings are saved for
the localhost with the IP address 127.0.0.1.
For testimony, let's edit the content of hosts file and add some
of the following lines to it. To make changes to
the /etc/hosts file, we will need to change its permissions.
$ sudo chmod 777 /etc/hosts
1. 127.0.0.1 www.facebook.com
Atul pratap singh tomar 1814310057
Prerequisite:
● Python 3.x installed
● Basic knowledge of Python
● Host file
What is python:
Atul pratap singh tomar 1814310057
Scheduling:
Scheduling in Windows:
Scheduling of above script is little bit trick but I will guide you
step by step-
1. First of all change the extension of your script from “.py” to
“.pyw”.
Atul pratap singh tomar 1814310057
3. Click on “create task”. Fill the name of your choice and flag
“Run with highest privilege”.
Atul pratap singh tomar 1814310057
Scheduling in Mac:
Source code
# Run this script as root
import time
from datetime import datetime as dt
while True:
print("Fun hours...")
time.sleep(5)
Atul pratap singh tomar 1814310057
SNAPSHOTS
REFERENCES
1. www.google.com
2. www.wikipedia.org
3. geeksforgeeks.org
4. python.org
5. hackerrank.com
6. w3schools.com