Skip to main content
Webnull
======
A tool for putting hosts into a blackhole.

Webnull is a command line program that lets you stop your computer from being able to reach certain websites.

Usage: `sudo webnull deny example.com`

Above, example.com will be added to your hosts file and routed to localhost. The next time you try to visit example.com your browser won't be able to find it.

Later, `sudo webnull allow example` will re-allow access to the site for five minutes.

`sudo webnull allow -am` will allow access to all blocked sites until tomorrow morning.

See `webnull -h` for full usage.

Installation
--------------
`pip install webnull`


Usage
---------
```
$ sudo webnull deny example.com
$ sudo webnull deny https://example.com/foo/bar
$ sudo webnull allow example.com
$ sudo webnull allow -t 30 example.com
$ sudo webnull allow -a
$ sudo webnull allow -am
```


Development
=========

Dev Mode
--------------
Dev Mode protects your live hostfile during development
```
$ cp /etc/hosts dummyhosts
$ export DEV_MODE=1
$ ./webnull.py allow ...
```

Testing
----------
```
$ brew install python
$ easy_install pip
$ pip install virtualenv
$ virtualenv venv
$ source venv/bin/activate
$ pip install watchdog
$ python setup.py test
```

Releasing
-------------
```
$ python setup.py sdist bdist_wheel
$ twine upload dist/* [-r testpypi]
$ rm -rf dist/*
* tag the release
* bump the version number
```

This code has only been tested on macOS with python 2.7

It will only work on systems that use an /etc/hosts file.


Release files for webnull 1.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for webnull 1.0.1
File Size Uploaded
webnull-1.0.1.tar.gz 4.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for webnull 1.0.1
File Interpreter ABI Platform
webnull-1.0.1-py2-none-any.whl Python 2 none any Details

Total release size: 11.1 kB

Release files / webnull-1.0.1.tar.gz

Download URL webnull-1.0.1.tar.gz
Size 4.6 kB
Tags Source
SHA-256 checksum
How to use checksums
385ccaacf2061fddb8ac954986fec05c59e32d2ffa8c1829f6f5f431b3a101fd
BLAKE2b-256 checksum
How to use checksums
4a04871a2f7692700d8f0bd0add610d9e4badfb802f39f9e51fd0224d547fb1f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / webnull-1.0.1-py2-none-any.whl

Download URL webnull-1.0.1-py2-none-any.whl
Size 6.5 kB
Tags Python 2
SHA-256 checksum
How to use checksums
36fb867fc8eb849761cf94fb95464008956313ba7bf2cc0d823a172cbabac6de
BLAKE2b-256 checksum
How to use checksums
3043c40a4020bd4682bded69cb75837605e0df8d33ff78b34e990b9503e4495c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

1.0.1 This release

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page