From 81a4d4cefdc2782167092af3877b8227f7875298 Mon Sep 17 00:00:00 2001 From: acidvegas Date: Fri, 6 Dec 2024 22:59:17 -0500 Subject: [PATCH] Added shardz function to bash_functions (banger) --- local/share/bash/bash_fun | 52 ++++++++++++++++----------------- local/share/bash/bash_functions | 20 ++++++------- local/share/bash/bash_recon | 17 +++++++++++ 3 files changed, 53 insertions(+), 36 deletions(-) diff --git a/local/share/bash/bash_fun b/local/share/bash/bash_fun index dbef0d4..bb0959b 100644 --- a/local/share/bash/bash_fun +++ b/local/share/bash/bash_fun @@ -22,35 +22,35 @@ alias wh='curl wttr.in' scene() { for x in $(curl -L -k -s http://www.textfiles.com/artscene/ansi/bbs/ | tr ' ' '\n' | grep HREF | tr '"' ' ' | awk '{print $2}' | grep -P "(ans|vt)" | grep -v ".png" | grep "." | shuf); do - curl -L -k -s http://www.textfiles.com/artscene/ansi/bbs/$x | iconv -f 437 -t utf-8 | pv -q -L 600 + curl -L -k -s http://www.textfiles.com/artscene/ansi/bbs/$x | iconv -f 437 -t utf-8 | pv -q -L 600 done } # Some of the commands below are from package installs or custom builds fun() { - echo "COMMAND | DESCRIPTION" - echo "------------- | -----------" - echo "asciiquarium | Terminal-based aquarium" - echo "ansi | Play ANSI art in your terminal" - echo "ascii | Play ASCII art in your terminal" - echo "bomber | Bomberman in your terminal" - echo "busy | Make your terminal busy" - echo "chess | Play chess in your terminal" - echo "confetty | Confetti in your terminal" - echo "cmatrix | Matrix-style animation" - echo "crypto | Show cryptocurrency rates" - echo "donut | Spinning donut" - echo "dvd | Bouncing DVD logo" - echo "fire | Fire animation" - echo "fireworks | Fireworks in your terminal" - echo "lavat | Lava lamp style animation" - echo "mapscii | Maps in your terminal" - echo "minesweeper | Play minesweeper in your terminal" - echo "pipes | Pipes in your terminal" - echo "pokemon | Random Pokémon" - echo "scene | Play ANSI scene art in your terminal" - echo "starwars | Watch Star Wars in your terminal" - echo "tty-solitaire | Play solitaire in your terminal" - echo "wh | Weather in your terminal" - echo "wipe | Clear your terminal in style" + echo "COMMAND | DESCRIPTION" + echo "------------- | -----------" + echo "asciiquarium | Terminal-based aquarium" + echo "ansi | Play ANSI art in your terminal" + echo "ascii | Play ASCII art in your terminal" + echo "bomber | Bomberman in your terminal" + echo "busy | Make your terminal busy" + echo "chess | Play chess in your terminal" + echo "confetty | Confetti in your terminal" + echo "cmatrix | Matrix-style animation" + echo "crypto | Show cryptocurrency rates" + echo "donut | Spinning donut" + echo "dvd | Bouncing DVD logo" + echo "fire | Fire animation" + echo "fireworks | Fireworks in your terminal" + echo "lavat | Lava lamp style animation" + echo "mapscii | Maps in your terminal" + echo "minesweeper | Play minesweeper in your terminal" + echo "pipes | Pipes in your terminal" + echo "pokemon | Random Pokémon" + echo "scene | Play ANSI scene art in your terminal" + echo "starwars | Watch Star Wars in your terminal" + echo "tty-solitaire | Play solitaire in your terminal" + echo "wh | Weather in your terminal" + echo "wipe | Clear your terminal in style" } diff --git a/local/share/bash/bash_functions b/local/share/bash/bash_functions index 24fb1ee..d05428f 100644 --- a/local/share/bash/bash_functions +++ b/local/share/bash/bash_functions @@ -30,22 +30,22 @@ cctain() { } fkill() { - local pid - if [ "$UID" != "0" ]; then - pid=$(ps -f -u $UID | sed 1d | fzf -m | awk '{print $2}') - else - pid=$(ps -ef | sed 1d | fzf -m | awk '{print $2}') - fi - if [ "x$pid" != "x" ]; then - echo $pid | xargs kill -${1:-9} - fi + local pid + if [ "$UID" != "0" ]; then + pid=$(ps -f -u $UID | sed 1d | fzf -m | awk '{print $2}') + else + pid=$(ps -ef | sed 1d | fzf -m | awk '{print $2}') + fi + if [ "x$pid" != "x" ]; then + echo $pid | xargs kill -${1:-9} + fi } extract() { if [ ! -z "$1" ]; then if [ -f $1 ]; then case $1 in - *.tar.bz2) tar xvjf $1 ;; + *.tar.bz2) tar xvjf $1 ;; *.tar.gz) tar xvzf $1 ;; *.tar.xz) tar xvJf $1 ;; *.lzma) unlzma $1 ;; diff --git a/local/share/bash/bash_recon b/local/share/bash/bash_recon index cee1c81..f79f027 100644 --- a/local/share/bash/bash_recon +++ b/local/share/bash/bash_recon @@ -54,6 +54,23 @@ crtsh() { 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() { curl https://internetdb.shodan.io/$1 }