Added shardz function to bash_functions (banger)

This commit is contained in:
Dionysus 2024-12-06 22:59:17 -05:00
parent f41d67cb26
commit 81a4d4cefd
Signed by: acidvegas
GPG Key ID: EF4B922DB85DC9DE
3 changed files with 53 additions and 36 deletions

View File

@ -54,6 +54,23 @@ crtsh() {
curl -s "https://crt.sh/?q=$1&output=json" | jq -r '.[].name_value' | sort | uniq curl -s "https://crt.sh/?q=$1&output=json" | jq -r '.[].name_value' | sort | uniq
} }
shardz() {
[ "$#" -ne 1 ] || ! echo "$1" | grep -q '^[1-9][0-9]*/[1-9][0-9]*$' && {
echo "Usage: process_with_output | shardz INDEX/TOTAL" >&2
return 1
}
shard=${1%/*}
total=${1#*/}
[ "$shard" -gt "$total" ] && {
echo "Error: INDEX cannot be greater than TOTAL" >&2
return 1
}
sed -n "$shard~$total p"
}
shodan() { shodan() {
curl https://internetdb.shodan.io/$1 curl https://internetdb.shodan.io/$1
} }