neat article thanks for sharing. an alternative approach is to create a hosts.blocked file. then use a cron job (or python) to simply swap the files:
create two files:
hosts.original (copy of original etc hosts)
hosts.blocked (original + deadend for blocked sites)
(on)
copy hosts.blocked to etc hosts
(off)
copy hosts.original to etc hosts
this will ensure you are not mutating the original file. you can then convert your tool to generate the .blocked file based on that list of sites (auto appending common prefixes like www)
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
neat article thanks for sharing. an alternative approach is to create a hosts.blocked file. then use a cron job (or python) to simply swap the files:
create two files:
hosts.original (copy of original etc hosts)
hosts.blocked (original + deadend for blocked sites)
(on)
copy hosts.blocked to etc hosts
(off)
copy hosts.original to etc hosts
this will ensure you are not mutating the original file. you can then convert your tool to generate the .blocked file based on that list of sites (auto appending common prefixes like www)