Skip to content

XDream8/hc-rs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

37 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

hc-rs -> hosts-creator-rust

fetch and merge multiple hosts files

whats done

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

installation

prebuilt binaries can be found in github and codeberg releases

Only binaries for x86_64-unknown-linux-gnu and x86_64-unknown-linux-musl are available for now.
These binaries are created using github actions and woodpecker ci.

install using cargo

$ cargo install hc-rs

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 <flags> <urls>
$ hc-rs <subcommand> ...

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 downloaded content/hosts

$ hc-rs -r

removing duplicate lines from a already created hosts file

I added a subcommand just for this purpose

$ hc-rs rmd <files>

setting output filename

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

$ hc-rs -o new-hosts

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

 
 
 

Contributors

Languages