| Command | Description | Example |
|---|---|---|
parallel echo ::: A B C |
🔤 Process items in parallel | Output: A, B, C (in any order) |
parallel echo {} ::: *.txt |
🔍 Use {} as placeholder | Echoes names of all .txt files |
cat file.txt | parallel echo |
📥 Read input from stdin | Processes each line of file.txt |
parallel -j4 command ::: item1 item2 item3 |
🔢 Limit to 4 jobs at a time | Runs 'command' on items, max 4 parallel |
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 characters
| #!/usr/bin/env bash | |
| cat cidr_cdn.tsv | paste -d, $(yes '-' | head -10000) | parallel --line-buffer -k -j$(nproc) --bar grepcidr {} ip.tsv | sort -u >ip_cdn.tsv |
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 characters
| #!/usr/bin/env bash | |
| cat ip_domain.tsv | bb -e ' | |
| (->> (line-seq (java.io.BufferedReader. *in*)) | |
| (map #(str/split % #"\t")) | |
| (group-by first) | |
| (map (fn [[ip rows]] (str ip "\t" (str/join ";" (map second rows))))) | |
| (run! println)) | |
| ' > ip_domains.tsv |
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 characters
| ╔╦╗╦ ╦ ╔╗ ┬ ┬┌─┐ ╔╗ ┌─┐┬ ┬┌┐┌┬┐┬ ┬ ╦═╗┌─┐┌─┐┌─┐┬ ┬┬─┐┌─┐┌─┐┌─┐ | |
| ║║║╚╦╝ ╠╩╗│ ││ ┬ ╠╩╗│ ││ │││││ └┬┘ ╠╦╝├┤ └─┐│ ││ │├┬┘│ ├┤ └─┐ | |
| ╩ ╩ ╩ ╚═╝└─┘└─┘ ╚═╝└─┘└─┘┘└┘┴ ┴ ╩╚═└─┘└─┘└─┘└─┘┴└─└─┘└─┘└─┘ | |
| // | |
| ()==========>>======================================-- | |
| \\ | |
| 2FA Bypass |
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 characters
| #!/usr/bin/env bb | |
| ;; Script to search ddg. | |
| ;; Takes a search term then asks you to select a bang. | |
| ;; Copyright John Cooper | |
| ;; This program is free software: you can redistribute it and/or modify it under the terms of the | |
| ;; GNU General Public License as published by the Free Software Foundation, | |
| ;; either version 3 of the License, or (at your option) any later version. | |
| ;; This program is distributed in the hope that it will be useful, | |
| ;; but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
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 characters
| #!/usr/bin/env bash | |
| cat cert.tsv | bb -e ' | |
| (->> (slurp *in*) | |
| str/split-lines | |
| (mapcat #(re-seq #"\\n\s\sCommonName:\s.*?\\n\\n|\\nDNS Names:\\n.*?\\n\\n" %)))' \ | |
| | bb -e ' | |
| (->> (slurp *in*) | |
| str/split-lines | |
| (mapcat #(str/split % #"\\\\n")) |
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 characters
| #!/usr/bin/env bash | |
| bb -e ' | |
| (let [ips (str/split-lines (slurp "ip.tsv")) | |
| table (map #(str/split % #"\t") (str/split-lines (slurp "ip_domain.tsv"))) | |
| idx (into {} (map (juxt first second) table))] | |
| (doseq [ip ips] | |
| (println (get idx ip))))' |
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 characters
| #!/usr/bin/env bash | |
| cat file.tsv | bb -e ' | |
| (->> (line-seq (java.io.BufferedReader. *in*)) | |
| (sort-by #(nth (str/split % #"\t") 2) #(compare %2 %1)) | |
| (run! println)) |
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 characters
| #!/usr/bin/env bb | |
| (ns ip.guide.client | |
| (:require | |
| [babashka.process :refer [shell]] | |
| [cheshire.core :as json])) | |
| (def ip-guide-url "https://ip.guide") | |
| (defn fetch-ip-json [] | |
| (let [{:keys [exit out err]} |
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 characters
| function reverseIp6 { | |
| echo "$1" | awk -F: 'BEGIN {OFS=""; }{addCount = 9 - NF; for(i=1; i<=NF;i++){if(length($i) == 0){ for(j=1;j<=addCount;j++){$i = ($i "0000");} } else { $i = substr(("0000" $i), length($i)+5-4);}}; print}' | rev | sed -e "s/./&./g" | |
| } | |
| $(reverseIp6 "2001:db8:85a3::8a2e:370:7334")"ip6.arpa." | |
| #Result: 4.3.3.7.0.7.3.0.e.2.a.8.0.0.0.0.0.0.0.0.3.a.5.8.8.b.d.0.1.0.0.2.ip6.arpa. |
NewerOlder