Skip to content

Instantly share code, notes, and snippets.

@glaszig
Last active January 30, 2022 00:30
Show Gist options
  • Select an option

  • Save glaszig/bf96beccf4694ae25d4f1f7cc6224985 to your computer and use it in GitHub Desktop.

Select an option

Save glaszig/bf96beccf4694ae25d4f1f7cc6224985 to your computer and use it in GitHub Desktop.

Revisions

  1. glaszig revised this gist Mar 27, 2020. 1 changed file with 15 additions and 0 deletions.
    15 changes: 15 additions & 0 deletions mkp2pblocklist
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,20 @@
    #!/usr/bin/env sh

    # DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
    # Version 2, December 2004
    #
    # Copyright (C) 2020 glaszig <glaszig@gmail.com>
    #
    # Everyone is permitted to copy and distribute verbatim or modified
    # copies of this license document, and changing it is allowed as long
    # as the name is changed.
    #
    # DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
    # TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
    #
    # 0. You just DO WHAT THE FUCK YOU WANT TO.


    # inspired by https://gist.github.com/johntyree/3331662#gistcomment-1968023
    #
    # usage:
  2. glaszig revised this gist Mar 27, 2020. 1 changed file with 2 additions and 1 deletion.
    3 changes: 2 additions & 1 deletion mkp2pblocklist
    Original file line number Diff line number Diff line change
    @@ -10,7 +10,8 @@
    PATH="/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin:$PATH"

    if [ -z "$UA" ]; then
    echo "User Agent environment variable UA missing. Choose one from, e.g., https://user-agents.net/browsers"
    echo "User Agent environment variable UA missing."
    echo "See, e.g., https://user-agents.net/browsers for examples."
    exit 1
    fi

  3. glaszig revised this gist Mar 27, 2020. 1 changed file with 7 additions and 3 deletions.
    10 changes: 7 additions & 3 deletions mkp2pblocklist
    Original file line number Diff line number Diff line change
    @@ -3,12 +3,16 @@
    # inspired by https://gist.github.com/johntyree/3331662#gistcomment-1968023
    #
    # usage:
    # mkp2pblocklist > /tmp/blockp2p.list
    # UA="user agent string" mkp2pblocklist > /tmp/blockp2p.list
    # or
    # mkp2pblocklist | gzip -9 > /tmp/blockp2p.list.gz
    # UA="user agent string" mkp2pblocklist | gzip -9 > /tmp/blockp2p.list.gz

    PATH="/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin:$PATH"
    UA=${UA:-'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:74.0) Gecko/20100101 Firefox/74.0'}

    if [ -z "$UA" ]; then
    echo "User Agent environment variable UA missing. Choose one from, e.g., https://user-agents.net/browsers"
    exit 1
    fi

    curl -A "$UA" -s https://www.iblocklist.com/lists.php \
    | sed -n "s/.*value='\(http:.*=p2p.*\)'.*/\1/p" \
  4. glaszig revised this gist Mar 27, 2020. 1 changed file with 3 additions and 2 deletions.
    5 changes: 3 additions & 2 deletions mkp2pblocklist
    Original file line number Diff line number Diff line change
    @@ -8,10 +8,11 @@
    # mkp2pblocklist | gzip -9 > /tmp/blockp2p.list.gz

    PATH="/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin:$PATH"
    UA=${UA:-'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:74.0) Gecko/20100101 Firefox/74.0'}

    curl -s https://www.iblocklist.com/lists.php \
    curl -A "$UA" -s https://www.iblocklist.com/lists.php \
    | sed -n "s/.*value='\(http:.*=p2p.*\)'.*/\1/p" \
    | xargs curl -sL \
    | xargs curl -A "$UA" -sL \
    | gunzip \
    | egrep -v '^#' \
    | uniq
  5. glaszig revised this gist May 16, 2017. 1 changed file with 1 addition and 2 deletions.
    3 changes: 1 addition & 2 deletions mkp2pblocklist
    Original file line number Diff line number Diff line change
    @@ -14,5 +14,4 @@ curl -s https://www.iblocklist.com/lists.php \
    | xargs curl -sL \
    | gunzip \
    | egrep -v '^#' \
    | uniq \
    | gzip -9
    | uniq
  6. glaszig revised this gist May 16, 2017. 1 changed file with 5 additions and 1 deletion.
    6 changes: 5 additions & 1 deletion mkp2pblocklist
    Original file line number Diff line number Diff line change
    @@ -7,8 +7,12 @@
    # or
    # mkp2pblocklist | gzip -9 > /tmp/blockp2p.list.gz

    PATH="/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin:$PATH"

    curl -s https://www.iblocklist.com/lists.php \
    | sed -n "s/.*value='\(http:.*=p2p.*\)'.*/\1/p" \
    | xargs curl -sL \
    | gunzip \
    | egrep -v '^#'
    | egrep -v '^#' \
    | uniq \
    | gzip -9
  7. glaszig created this gist Mar 23, 2017.
    14 changes: 14 additions & 0 deletions mkp2pblocklist
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,14 @@
    #!/usr/bin/env sh

    # inspired by https://gist.github.com/johntyree/3331662#gistcomment-1968023
    #
    # usage:
    # mkp2pblocklist > /tmp/blockp2p.list
    # or
    # mkp2pblocklist | gzip -9 > /tmp/blockp2p.list.gz

    curl -s https://www.iblocklist.com/lists.php \
    | sed -n "s/.*value='\(http:.*=p2p.*\)'.*/\1/p" \
    | xargs curl -sL \
    | gunzip \
    | egrep -v '^#'