Giter VIP home page Giter VIP logo

scripttiger / hosts-bl Goto Github PK

View Code? Open in Web Editor NEW
39.0 5.0 3.0 37 KB

Simple tool to handle hosts file black lists that can remove comments, remove duplicates, compress to 9 domains per line, add IPv6 entries, as well as can convert black lists to multiple other black list formats compatible with other software.

Home Page: https://scripttiger.github.io/more/

License: MIT License

Batchfile 6.04% Go 93.96%
hostsfile hosts-file blacklist rpz dualserver dnsmasq unbound privoxy fqdn hosts-file-edit scripttiger

hosts-bl's Introduction

Say Thanks!

Hosts-BL

Simple tool to handle hosts file black lists that can remove comments, remove duplicates, compress to 9 domains per line, add IPv6 entries, as well as can convert black lists to multiple other black list formats compatible with other software.

Usage: hosts-bl [options...] <source> <destination>

Argument Description
-comments Don't remove comments
-compression <number> Number of domains per line, 1 to 9
-dupe Don't check for and remove duplicates
-f <format> Destination format:
-------------------------- adblock, dnsmasq, dualserver, fqdn,
-------------------------- hosts, ipv6, privoxy, rfqdn, rpz, unbound
-from_blackhole <IPv4> Black hole address in source
-i <file> Source file
-o <file> Destination file
-to_blackhole <IPv4> Black hole address in destination
-to_blackhole_v6 <IPv6> IPv6 Black hole address in destination

- can be used in place of <file> to designate standard input as the source and/or standard output as the destination. If standard input is used, standard output will be used by default if no destination file is given.

By default, dragging and dropping a hosts file over a hosts-bl executable will automatically pick out lines beginning with 0.0.0.0, check for and remove any duplicates, and compress it to 9 domains per line in standard hosts file format with 0.0.0.0 as the black hole address.

In addition to removing duplicates by default, formats which support wild cards will automatically have wild card entries added and all child subdomains will be pruned from the list.

More About ScriptTiger

For more ScriptTiger scripts and goodies, check out ScriptTiger's GitHub Pages website:
https://scripttiger.github.io/

Donate

hosts-bl's People

Contributors

scripttiger avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

hosts-bl's Issues

Output file created with incorrect permissions

When running on Linux, the output file is created with owner write-only, global read-only permissions:

--w----r-- 1 philip philip 3473311 Jun 26 15:16 blocklist.conf

This is because the mode argument to os.WriteFile is 644 (01204). It should be 0644.

Unable to download with hosts-bl

Hello there,

could you please guide me and show some examples how to use your script?
I have tried several things but was not able to download anything so far.

./hosts-bl -f rpz -i https://s3.amazonaws.com/lists.disconnect.me/simple_tracking.txt -o test.txt

will result into

Usage: hosts-bl [options...] <source> <destination>
 -comments               Don't remove comments
 -compression <number>   Number of domains per line, 1 to 9
 -dupe                   Don't check for and remove duplicates
 -f <format>             Destination format:
                         dnsmasq,dualserver,fqdn,hosts,
                         ipv6,privoxy,rfqdn,rpz,unbound
 -from_blackhole <IPv4>  Black hole address in source
 -i <file>               Source file
 -o <file>               Destination file
 -to_blackhole <IPv4>    Black hole address in destination
 -to_blackhole_v6 <IPv6> IPv6 Black hole address in destination

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.