Skip to content

XDream8/hc-rs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

hc-rs -> hosts-creator-rust

fetch and merge multiple hosts files

this is a WIP

whats done

  • fetching hosts files
  • merging hosts files
  • removing duplicate lines
  • cli options
  • colored output messages
  • configuration file
  • replace with /etc/hosts(i think this should be done manually though)

building from git source

$ git clone https://github.com/XDream8/hc-rs
$ cd hc-rs
$ cargo build --profile optimized
$ ./target/optimized/hc-rs

usage

$ hc-rs -h
$ hc-rs <urls> <flags>

creating a hosts file

  • pass urls directly to hc-rs
  • you can pass as much urls as you want to
$ hc-rs https://badmojr.github.io/1Hosts/Pro/hosts.txt https://hosts.oisd.nl

removing duplicate lines

use --remove-duplicates(-r) flag to remove duplicate lines from the final file

$ hc-rs -r

setting output filename

use --output(-o) flag to set output filename
default filename is "hosts"

$ hc-rs -o new-hosts

minimal

use --minimal(-m) flag to create a small hosts file

$ hc-rs -m

ignoring fetching errors

use --ignore-errors(-i) flag to ignore fetching errors and don't exit

$ hc-rs -i https://example.com/example

aliasing in your shell config

alias create-hosts='hc-rs -r https://badmojr.github.io/1Hosts/Pro/hosts.txt https://hosts.oisd.nl'

About

rewrite of hosts-creator in rust

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages