-
-
Save mika/6cb71e1cb67fa69a8c6a0be5285bd91b to your computer and use it in GitHub Desktop.
Revisions
-
azet revised this gist
Jul 31, 2015 . 1 changed file with 3 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -42,7 +42,9 @@ function get_mx() { unzip "${top1m_zip}" &> /dev/null } [[ ${1} == "get_mx" ]] && { get_mx "${2}" && exit 0 } if [[ $(which parallel) ]]; then printf "<< parallel mode >>\n\n" >&2 -
azet revised this gist
Jul 31, 2015 . 1 changed file with 1 addition and 3 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -42,9 +42,7 @@ function get_mx() { unzip "${top1m_zip}" &> /dev/null } [[ ${1} == "get_mx" ]] && { get_mx "${2}" && exit 0 } if [[ $(which parallel) ]]; then printf "<< parallel mode >>\n\n" >&2 -
azet revised this gist
Jul 31, 2015 . 1 changed file with 1 addition and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -43,8 +43,7 @@ function get_mx() { } [[ ${1} == "get_mx" ]] && { get_mx "${2}" && exit 0 } if [[ $(which parallel) ]]; then -
azet revised this gist
Jul 31, 2015 . No changes.There are no files selected for viewing
-
azet revised this gist
Jul 31, 2015 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -51,7 +51,7 @@ if [[ $(which parallel) ]]; then printf "<< parallel mode >>\n\n" >&2 parallel --progress --colsep ',' "${0} get_mx {2}" :::: ${top1m_csv} else printf "<< sequential mode (slow! install \`parallel\`.) >>\n\n" >&2 for host in $(hosts); do get_mx "${host}" done -
azet revised this gist
Jul 31, 2015 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -51,7 +51,7 @@ if [[ $(which parallel) ]]; then printf "<< parallel mode >>\n\n" >&2 parallel --progress --colsep ',' "${0} get_mx {2}" :::: ${top1m_csv} else printf "<< sequential mode (slow! install \`parallel\` for speed.) >>\n\n" >&2 for host in $(hosts); do get_mx "${host}" done -
azet revised this gist
Jul 31, 2015 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -30,7 +30,7 @@ function get_mx() { +time=2 mx "${1}" | sed 's/.*\ //')) printf '{\n\t"%s": {\n\t\t"mx_records": [\n' "${1}" for mx in "${mx_records[@]}"; do local ip=($(getent ahostsv4 ${mx})) # in our case, v4 suffices. printf '\t\t\t"%s": \t"%s",\n' "${mx}" "${ip}" done printf "\t\t]\n\t}\n}\n" -
azet revised this gist
Jul 31, 2015 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -9,7 +9,7 @@ # Authors: Aaron Zauner <[email protected]> # License: CC0 1.0 (https://creativecommons.org/publicdomain/zero/1.0) # set -eo pipefail readonly top1m_s3l="https://s3.amazonaws.com/alexa-static/top-1m.csv.zip" readonly top1m_zip=${top1m_s3l##*/} -
azet revised this gist
Jul 31, 2015 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -9,7 +9,7 @@ # Authors: Aaron Zauner <[email protected]> # License: CC0 1.0 (https://creativecommons.org/publicdomain/zero/1.0) # set -e pipefail readonly top1m_s3l="https://s3.amazonaws.com/alexa-static/top-1m.csv.zip" readonly top1m_zip=${top1m_s3l##*/} -
azet revised this gist
Jul 30, 2015 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -58,4 +58,4 @@ else fi trap '{ rm ${top1m_zip} ${top1m_csv}; \ printf "\n\n<< finished run. >> \ $(date --rfc-3339=ns) \n" >&2 }' EXIT -
azet revised this gist
Jul 30, 2015 . 1 changed file with 3 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -56,5 +56,6 @@ else get_mx "${host}" done fi trap '{ rm ${top1m_zip} ${top1m_csv}; \ printf "\n\n<< finished run. >> \ $(date --rfc-3339=ns).\n" >&2 }' EXIT -
azet revised this gist
Jul 30, 2015 . 1 changed file with 2 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -2,7 +2,8 @@ # # Retrieves MX and A records for 'Alexa Top 1 Million' hosts # and prints them as pretty formatted JSON objects to stdout. # # *Optional* parallelism support with GNU Parallel (recommended): # $ sudo apt-get install parallel # # Authors: Aaron Zauner <[email protected]> -
azet revised this gist
Jul 30, 2015 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,7 +1,7 @@ #!/usr/bin/env bash # # Retrieves MX and A records for 'Alexa Top 1 Million' hosts # and prints them as pretty formatted JSON objects to stdout. # Optional parallelism support with GNU Parallel (recommended): # $ sudo apt-get install parallel # -
azet revised this gist
Jul 30, 2015 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -3,7 +3,7 @@ # Retrieves MX and A records for 'Alexa Top 1 Million' list # and prints them as nicely formatted JSON object to stdout. # Optional parallelism support with GNU Parallel (recommended): # $ sudo apt-get install parallel # # Authors: Aaron Zauner <[email protected]> # License: CC0 1.0 (https://creativecommons.org/publicdomain/zero/1.0) -
azet revised this gist
Jul 30, 2015 . No changes.There are no files selected for viewing
-
azet revised this gist
Jul 30, 2015 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -2,7 +2,7 @@ # # Retrieves MX and A records for 'Alexa Top 1 Million' list # and prints them as nicely formatted JSON object to stdout. # Optional parallelism support with GNU Parallel (recommended): # `sudo apt-get install parallel` # # Authors: Aaron Zauner <[email protected]> -
azet revised this gist
Jul 30, 2015 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -29,7 +29,7 @@ function get_mx() { +time=2 mx "${1}" | sed 's/.*\ //')) printf '{\n\t"%s": {\n\t\t"mx_records": [\n' "${1}" for mx in "${mx_records[@]}"; do local ip=($(getent ahostsv4 ${mx})) # we only need v4 for scanning printf '\t\t\t"%s": \t"%s",\n' "${mx}" "${ip}" done printf "\t\t]\n\t}\n}\n" -
azet revised this gist
Jul 30, 2015 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -29,7 +29,7 @@ function get_mx() { +time=2 mx "${1}" | sed 's/.*\ //')) printf '{\n\t"%s": {\n\t\t"mx_records": [\n' "${1}" for mx in "${mx_records[@]}"; do local ip=($(getent ahostsv4 ${mx})) # only need v4 for scanning printf '\t\t\t"%s": \t"%s",\n' "${mx}" "${ip}" done printf "\t\t]\n\t}\n}\n" -
azet revised this gist
Jul 30, 2015 . 1 changed file with 3 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -10,9 +10,9 @@ # set -e readonly top1m_s3l="https://s3.amazonaws.com/alexa-static/top-1m.csv.zip" readonly top1m_zip=${top1m_s3l##*/} readonly top1m_csv=${top1m_zip%.*} function hosts() { for line in $(<${top1m_csv}); do -
azet revised this gist
Jul 30, 2015 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -55,5 +55,5 @@ else get_mx "${host}" done fi trap '{ rm ${top1m_zip} ${top1m_csv}; \ printf "\n\n<< finished. >>\n" >&2 }' EXIT -
azet revised this gist
Jul 30, 2015 . 1 changed file with 3 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -13,8 +13,6 @@ set -e top1m_s3l="https://s3.amazonaws.com/alexa-static/top-1m.csv.zip" top1m_zip=${top1m_s3l##*/} top1m_csv=${top1m_zip%.*} function hosts() { for line in $(<${top1m_csv}); do @@ -56,4 +54,6 @@ else for host in $(hosts); do get_mx "${host}" done fi trap '{ rm ${top1m_zip} ${top1m_csv}; \ printf "\n\n<<finished.>>\n" >&2 }' EXIT -
azet revised this gist
Jul 30, 2015 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -14,7 +14,7 @@ top1m_s3l="https://s3.amazonaws.com/alexa-static/top-1m.csv.zip" top1m_zip=${top1m_s3l##*/} top1m_csv=${top1m_zip%.*} trap '{ rm ${top1m_zip} ${top1m_csv}; \ printf "\n\n<<finished.>>\n" >&2 }' EXIT function hosts() { for line in $(<${top1m_csv}); do -
azet revised this gist
Jul 30, 2015 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -13,7 +13,7 @@ set -e top1m_s3l="https://s3.amazonaws.com/alexa-static/top-1m.csv.zip" top1m_zip=${top1m_s3l##*/} top1m_csv=${top1m_zip%.*} trap '{ rm ${top1m_zip} ${top1m_csv}; \ printf "\n\n<<finished.>>\n" >&2}' EXIT function hosts() { -
azet revised this gist
Jul 30, 2015 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -13,7 +13,7 @@ set -e top1m_s3l="https://s3.amazonaws.com/alexa-static/top-1m.csv.zip" top1m_zip=${top1m_s3l##*/} top1m_csv=${top1m_zip%.*} trap '{ rm ${top1m_zip} ${top1m_csv}; \ printf "\n\n<<finished.>>\n" >&2}' EXIT function hosts() { -
azet revised this gist
Jul 30, 2015 . No changes.There are no files selected for viewing
-
azet revised this gist
Jul 30, 2015 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -13,7 +13,7 @@ set -e top1m_s3l="https://s3.amazonaws.com/alexa-static/top-1m.csv.zip" top1m_zip=${top1m_s3l##*/} top1m_csv=${top1m_zip%.*} trap '{ rm ${top1m_zip} ${top1m_csv}; \ printf "\n\n<<finished.>>\n" >&2}' EXIT function hosts() { -
azet revised this gist
Jul 30, 2015 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -13,7 +13,7 @@ set -e top1m_s3l="https://s3.amazonaws.com/alexa-static/top-1m.csv.zip" top1m_zip=${top1m_s3l##*/} top1m_csv=${top1m_zip%.*} trap '{ rm ${top1m_zip} ${top1m_csv} ; \ printf "\n\n<<finished.>>\n" >&2}' EXIT function hosts() { -
azet revised this gist
Jul 30, 2015 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -13,7 +13,7 @@ set -e top1m_s3l="https://s3.amazonaws.com/alexa-static/top-1m.csv.zip" top1m_zip=${top1m_s3l##*/} top1m_csv=${top1m_zip%.*} trap '{ rm ${top1m_zip} ${top1m_csv} ; \ printf "\n\n<<finished.>>\n" >&2}' EXIT function hosts() { -
azet revised this gist
Jul 30, 2015 . 1 changed file with 2 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -13,7 +13,8 @@ set -e top1m_s3l="https://s3.amazonaws.com/alexa-static/top-1m.csv.zip" top1m_zip=${top1m_s3l##*/} top1m_csv=${top1m_zip%.*} trap '{ rm ${top1m_zip} ${top1m_csv} ;\ printf "\n\n<<finished.>>\n" >&2}' EXIT function hosts() { for line in $(<${top1m_csv}); do -
azet revised this gist
Jul 30, 2015 . 1 changed file with 0 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -50,8 +50,6 @@ function get_mx() { if [[ $(which parallel) ]]; then printf "<< parallel mode >>\n\n" >&2 parallel --progress --colsep ',' "${0} get_mx {2}" :::: ${top1m_csv} else printf "<< sequential mode (fuck-slow!) >>\n\n" >&2 for host in $(hosts); do
NewerOlder