A minimalist tool for managing block-lists from the terminal.

Overview

mosaic

Block List

A minimalist hosts-based tool for managing block lists and ad-blocking.

This project uses the excellent and regularly updated Unified Hosts lists from Steven Black.

Why should you use Block List?

  • It is an extensible, small and simple tool; consisting of only fifty-five lines of code!
  • It will block this traffic across all programs running on the system.
  • It is written in Rust and hence can be depended upon to be fast and stable.
  • It is designed to be easily incorporated into shell scripts to automate or customize its behaviour to your liking.
  • A hosts-based block list such as this uses minimal system resources to block unwanted traffic in comparison to a browser extension.

Installation

Using Cargo (Rust)

cargo install block-list

More options will come in future!

Usage

Just use 'hosts' as the desired list if you only want ad-blocking.

sudo block-list /path/to/hosts your-desired-list

Examples

Basic usage:

sudo block-list /etc/hosts social

Pipe in a custom list:

cat someFile.txt | sudo block-list /etc/hosts

OR

cat someFile.txt | sudo block-list /etc/hosts social

Automatically update Block List at 10pm every day:

Open the root user's crontab file

sudo crontab -e

Then add the following line

0 22 * * * block-list /etc/hosts hosts

Use Block List to re-route a url to a different address:

Find the address using dig

dig duckduckgo.com

Coppy the IP address listed in 'Answer Section' to a file

# A custom Block List

# Re-route all requests from Google to DuckDuckGo
52.142.124.215 www.google.com
52.142.124.215 google.com

Pipe in the custom list to Block List

cat someFile.txt | sudo block-list /etc/hosts

Output

If successful, this command will append a new list or replace the current list at the tail of the supplied hosts file, eg:

Block List updated! πŸ”’
##
# Host Database
##
127.0.0.1	localhost
255.255.255.255	broadcasthost
::1             localhost


# Your list of addresses
1.2.3.4 somehost

... 

# Block List

0.0.0.0 some.custom.address.net
0.0.0.0 another.custom.address.xyz

0.0.0.0 some.malware.address.com
0.0.0.0 another.blocked.address.xxx
You might also like...
An utility application to help managing your C++ OI workspaces.

oi_helper oi_helper is an utility application to help managing your C++ OI workspaces. Why oi_helper We all know that we often need a project manager

An interface for managing collections of labeled items and generating random subsets with specified restrictions

An interface for managing collections of labeled items and generating random subsets with specified restrictions

Work-in-progress software for managing the Azeron keypad on any operating system.
Work-in-progress software for managing the Azeron keypad on any operating system.

azeron-cli A small, unfinished CLI application intended to manage the Azeron Cyborg. The code is still in a very messy state and doesn't look very rus

πŸ›œ TUI for managing bluetooth devices
πŸ›œ TUI for managing bluetooth devices

TUI for managing bluetooth devices πŸ’‘ Prerequisites A Linux based OS with bluez installed. πŸš€ Installation πŸ“₯ Binary release You can download the pre-

A terminal ASCII media player. View images, gifs, videos, webcam, YouTube, etc.. directly in the terminal as ASCII art.
A terminal ASCII media player. View images, gifs, videos, webcam, YouTube, etc.. directly in the terminal as ASCII art.

Terminal Media Player View images, videos (files or YouTube links), webcam, etc directly in the terminal as ASCII. All images you see below are just m

ask.sh: AI terminal assistant that can read and write your terminal directly!
ask.sh: AI terminal assistant that can read and write your terminal directly!

ask.sh: AI terminal assistant that read from & write to your terminal ask.sh is an AI terminal assistant based on OpenAI APIs such as GPT-3.5/4! What'

A simple and efficient terminal UI implementation with ratatui.rs for getting quick insights from csv files right on the terminal
A simple and efficient terminal UI implementation with ratatui.rs for getting quick insights from csv files right on the terminal

CSV-GREP csv-grep is an intuitive TUI application writting with ratatui.rs for reading, viewing and quickly analysing csv files right on the terminal.

A tool for automating terminal applications in Unix.

expectrl A tool for automating terminal applications in Unix. Using the library you can: Spawn process Control process Expect/Verify responces It was

Tool to draw low-resolution graphs in terminal
Tool to draw low-resolution graphs in terminal

lowcharts Tool to draw low-resolution graphs in terminal. lowcharts is meant to be used in those scenarios where we have numerical data in text files

Owner
Oliver Brotchie
Oliver Brotchie
A command-line utility which aligns a block of text within the terminal (or a specified number of columns), written in Rust.

align: a command line utility for aligning text. ⭐ Overview Aligns text within the terminal (or a specified number of columns). The text is treated as

Khalil Ouali 6 Aug 11, 2023
Rust low-level minimalist APNG writer and PNG reader with just a few dependencies with all possible formats coverage (including HDR).

project Wiki https://github.com/js29a/micro_png/wiki at glance use micro_png::*; fn main() { // load an image let image = read_png("tmp/test.

jacek SQ6KBQ 8 Aug 30, 2023
mhv is a minimalist hexadecimal viewer.

MHV How it works? The color legend ⬛ Null byte ?? ASCII Printable Characters ?? Space Characters ?? Control Characters ?? ASCII Extended Codes Install

JΓΊlio CΓ©sar de Brito Gardona 11 Dec 3, 2023
Tool for managing dotfiles directories; Heavily based on rcm.

Paro paro : to prepare, get ready / set, put / furnish, supply. Tool for managing dotfiles directories; Heavily based on rcm. TODO Rust Boilerplate CI

Rafael Delboni 7 Nov 20, 2022
A fast and robust MLOps tool for managing data and pipelines

xvc A Fast and Robust MLOps Swiss-Army Knife in Rust βŒ› When to use xvc? Machine Learning Engineers: When you manage large quantities of unstructured d

Emre Sahin 6 Dec 15, 2022
A Modern And Secure CLI Tool For Managing Environment Variables

Envio is a command-line tool that simplifies the management of environment variables across multiple profiles. It allows users to easily switch between different configurations and apply them to their current environment

Humble Penguin 536 Apr 16, 2023
booky is a minimalstic Tui tool for managing your growing book collection.

booky booky is a minimalistic TUI tool for managing your growing book collection. It is writtin in Rust and uses diesel as it's orm together with sqli

null 3 Jul 21, 2023
Uses the cardano mini-protocols to receive every block and transaction, and save them to a configurable destination

cardano-slurp Connects to one or more cardano-node's, streams all available transactions, and saves them to disk (or to S3) in raw cbor format. Usage

Pi Lanningham 16 Jan 31, 2023
Log-structured, transactional virtual block device backed by S3

mvps Log-structured, transactional virtual block device compatible with the NBD protocol. mvps stands for "multi-versioned page store". MVPS can store

Heyang Zhou 3 Dec 3, 2023
A utility for managing cargo dependencies from the command line.

cargo edit This tool extends Cargo to allow you to add, remove, and upgrade dependencies by modifying your Cargo.toml file from the command line. Curr

Pascal Hertleif 2.7k Jan 6, 2023