... a simple POSIX /bin/sh script may be more simple solution then 15000 bytes python script ...
See original GitHub issue#! /bin/sh
rm -f hosts.[0-9]*
cat << __EOF | while read LIST; do COUNT=$(( ${COUNT} + 1 )); echo "curl -g \"${LIST}\" | sed -e s/$'\r'//g 1> hosts.${COUNT}"; done | parallel
http://adaway.org/hosts.txt
http://netcologne.dl.sourceforge.net/project/adzhosts/FORADAWAY.txt
http://pgl.yoyo.org/adservers/serverlist.php?hostformat=hosts&mimetype=plaintext
http://someonewhocares.org/hosts/hosts
http://winhelp2002.mvps.org/hosts.txt
http://www.malwaredomainlist.com/hostslist/hosts.txt
https://raw.githubusercontent.com/StevenBlack/hosts/master/data/StevenBlack/hosts
__EOF
cat hosts.[0-9]* \
| grep -v '^#' \
| grep -v '^$' \
| awk '{print $2}' \
| sort -u -f \
| while read I
do
echo 0.0.0.0 ${I}
done | sed 1d 1> hosts
This one fetches all hosts sources in parallel and then merges them into a single 0.0.0.0 hosts file.
Regards, vermaden
Issue Analytics
- State:
- Created 8 years ago
- Comments:14 (6 by maintainers)
Top Results From Across the Web
Running bash script from within python - Stack Overflow
Adding an answer because I was directed here after asking how to run a bash script from python. You receive an error OSError:...
Read more >Classic SysAdmin: Writing a Simple Bash Script
This is a classic article written by Joe “Zonker” Brockmeier from the Linux.com archives. For more great SysAdmin tips and techniques check ...
Read more >POSIX Shell Tutorial - The Grymoire!
How to build your own complex commands from the simple commands in ... A shell script can easily replace a C program, as...
Read more >How can I get the size of a file in a bash script?
The script works on many Unix systems including Linux, BSD, OSX, Solaris, SunOS, etc. The file size shows the number of bytes. It...
Read more >How do I pass the output of a python script to a shell variable?
You start your Python script from a shell script (or also from an interactive shell) and use command substitution. For POSIX shells (e.g....
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Suckless Philosophy in action! man i love this script!
Closing.