From 8d7f3eee20802d9bf0f2ae302bd67902f5027b20 Mon Sep 17 00:00:00 2001 From: Jonathan Hodgson Date: Sun, 9 Nov 2025 09:51:15 +0000 Subject: [PATCH] Adds some fabric wrappers --- bin/.bin/fabric/ai-bash-command | 37 +++++++++++++++++++++++++++++ bin/.bin/fabric/guess-subdomains | 40 ++++++++++++++++++++++++++++++++ bin/.bin/fabric/summarise-yt | 3 +++ 3 files changed, 80 insertions(+) create mode 100755 bin/.bin/fabric/ai-bash-command create mode 100755 bin/.bin/fabric/guess-subdomains create mode 100755 bin/.bin/fabric/summarise-yt diff --git a/bin/.bin/fabric/ai-bash-command b/bin/.bin/fabric/ai-bash-command new file mode 100755 index 00000000..0d914988 --- /dev/null +++ b/bin/.bin/fabric/ai-bash-command @@ -0,0 +1,37 @@ +#!/usr/bin/bash + +TOOL="" +HELP="--help" + + + + + +# Loop through each argument given to the script +while [ "${1:0:1}" = "-" ]; do + # Use a case statement to set variables based on the value of $arg + case $1 in + "--tool"|"-t") + TOOL="$2" + shift + ;; + "--help") + HELP="$2" + shift + ;; + *) + echo "Unknown argument: $arg" + exit 1 + ;; + esac + shift +done + +{ + echo "$@" + + echo -e "\n\nThe following documentation might help:" + #man "$TOOL" + $TOOL $HELP + tldr "$TOOL" +} 2>&1 | fabric --stream --pattern create_command diff --git a/bin/.bin/fabric/guess-subdomains b/bin/.bin/fabric/guess-subdomains new file mode 100755 index 00000000..1297b286 --- /dev/null +++ b/bin/.bin/fabric/guess-subdomains @@ -0,0 +1,40 @@ +#!/usr/bin/env bash + + +CURRENTLIST="" +URL="" + +# Loop through each argument given to the script +while [ "${1:0:1}" = "-" ]; do + # Use a case statement to set variables based on the value of $arg + case $1 in + "--url"|"-u") + URL="$2" + shift + ;; + "--currentlist"|"--current-list"|"-c") + CURRENTLIST="$2" + shift + ;; + *) + echo "Unknown argument: $arg" + exit 1 + ;; + esac + shift +done + +( + if [ -n "$URL" ]; then + echo '# PAGE CONTENT' + echo '' + w3m -dump "$URL" + echo '' + fi + + if [ -n "$CURRENTLIST" ] && [ -f "$CURRENTLIST" ]; then + echo '# CURRENT LIST OF SUBDOMAINS' + echo '' + cat "$CURRENTLIST" + fi +) | tee /dev/tty | fabric --stream --pattern guess_subdomains diff --git a/bin/.bin/fabric/summarise-yt b/bin/.bin/fabric/summarise-yt new file mode 100755 index 00000000..213b3bb4 --- /dev/null +++ b/bin/.bin/fabric/summarise-yt @@ -0,0 +1,3 @@ +#!/usr/bin/bash + +yt-transcript "$1" 2>/dev/null | fabric --stream --pattern youtube_summary