How to use Chomper Internet blocker for Linux to increase productivity

Chomper is a free and open source Python cli for Linux desktop. It lets you block access to distracting websites for specified periods of time. The program is intended to help you with issues being productive on a desktop due to Internet distractions. One can set a period to block websites. Until that timer expires, you will be unable to access sites.

How to install Chomper Internet blocker for Linux desktop

Obviously, you must have Python 3.6 and pip3 installed on your system. For testing purpose I am using Ubuntu Linux 17.10. If pip3 is not installed, run the following apt command/apt-get command:
$ sudo apt install python3-pip -y
Install pipenv:
$ pip3 install --user pipenv
export PATH="$HOME/.local/bin:$PATH"

Clone the repo:
$ git clone
Type the following commands:
$ cd chomper
$ make init

To activate this project’s virtualenv, run the following:
$ pipenv shell
mitmproxy is an interactive console program that allows traffic flows to be intercepted, inspected, modified and replayed. Type the following command to start proxy server:
$ mitmdump
Sample outputs:

Proxy server listening at http://*:8080

You need to exit mitmdump by pressing Ctrl-C. There should now be various certificate files in ~/.mitmproxy
$ ls -l ~/.mitmproxy
Sample outputs:

total 24
-rw-rw-r-- 1 vivek vivek 1318 Feb 20 11:30 mitmproxy-ca-cert.cer
-rw-rw-r-- 1 vivek vivek 1140 Feb 20 11:30 mitmproxy-ca-cert.p12
-rw-rw-r-- 1 vivek vivek 1318 Feb 20 11:30 mitmproxy-ca-cert.pem
-rw-rw-r-- 1 vivek vivek 2529 Feb 20 11:30 mitmproxy-ca.p12
-rw-rw-r-- 1 vivek vivek 3022 Feb 20 11:30 mitmproxy-ca.pem
-rw-rw-r-- 1 vivek vivek  770 Feb 20 11:30 mitmproxy-dhparam.pem

Next import these certificates to your web browser:

Google Chrome

Go to Settings > Advanced Settings > Manage Certificates > Authorities. Click import, select mitmproxy-ca.pem, tick all three boxes, and click OK.


Go Preferences > Privacy and Security > Certificates > View Certificates > Authorities. Click import, select mitmproxy-ca.pem, tick all three boxes, and click OK.

Enable IPv4/IPv6 traffic forwarding

Edit /etc/sysctl.d/99-sysctl.conf file:
$ sudo vi /etc/sysctl.d/99-sysctl.conf
Make sure following entries are set/uncommented:

Reload the sysctl changes using the following command:
$ sudo sysctl -p

How to use Chomper

Simply use config file as follows:
$ cat ~/chomper/data/rules.yaml
Sample outputs:

  - block_type:
      - whitelist
  - addresses:
  - block_type:
      - whitelist
  - addresses:
  - block_type:
      - blacklist
  - addresses:
  - block_type:
      - whitelist 
  - addresses:

Customize file as per your needs.

How to run script

Run it as follows to allow coding sites for 30 minutes and block everything else:
$ ~/chomper/bin/chomper coding 30

Chomper is an Internet blocker for Linux desktop works, but it is not very user-friendly for new users. If you are a sysadmin or developer, it should be easy to set up. I am looking forward to seeing a GUI option for the Chomper. For more info see the official project github repo here.

🐧 Get the latest tutorials on Linux, Open Source & DevOps via RSS feed or Weekly email newsletter.

🐧 0 comments... add one

CategoryList of Unix and Linux commands
Disk space analyzersdf duf ncdu pydf
File Managementcat cp mkdir tree
FirewallAlpine Awall CentOS 8 OpenSUSE RHEL 8 Ubuntu 16.04 Ubuntu 18.04 Ubuntu 20.04
Modern utilitiesbat exa
Network UtilitiesNetHogs dig host ip nmap
OpenVPNCentOS 7 CentOS 8 Debian 10 Debian 8/9 Ubuntu 18.04 Ubuntu 20.04
Package Managerapk apt
Processes Managementbg chroot cron disown fg glances gtop jobs killall kill pidof pstree pwdx time vtop
Searchingag grep whereis which
User Informationgroups id lastcomm last lid/libuser-lid logname members users whoami who w
WireGuard VPNAlpine CentOS 8 Debian 10 Firewall Ubuntu 20.04
0 comments… add one

Leave a Reply

Your email address will not be published.

Use HTML <pre>...</pre> for code samples. Still have questions? Post it on our forum