From 177d8d3a0a831257574badf091e2257336c7e24f Mon Sep 17 00:00:00 2001 From: Themba Longwe <63921810+Logicc-17@users.noreply.github.com> Date: Tue, 1 Sep 2026 12:08:54 +0200 Subject: [PATCH 1/3] try these --- linux_PI.sh | 200 ++++++++++++++++++++++++++++++++++++++ password_inspector_cli.py | 116 ++++++++++++++++++++++ 2 files changed, 316 insertions(+) create mode 100644 linux_PI.sh diff --git a/linux_PI.sh b/linux_PI.sh new file mode 100644 index 0000000..703378b --- /dev/null +++ b/linux_PI.sh @@ -0,0 +1,200 @@ +```bash +#!/usr/bin/env bash + +set -e + +# ============================================================ +# Password Inspector - One-Click Launcher (grims stan) +# + Sets up the virtual environment (if needed) +# + Installs dependencies (if requirements.txt changed) +# + Launches the interactive menu +# ============================================================ + +APP_NAME="Password Inspector" +VERSION="2.13" + +# ------------------------------------------------------------ +# Terminal colors +# ------------------------------------------------------------ + +CYAN='\033[1;36m' +GREEN='\033[1;32m' +YELLOW='\033[1;33m' +RED='\033[1;31m' +WHITE='\033[1;37m' +DIM='\033[2m' +RESET='\033[0m' + +# ------------------------------------------------------------ +# Move to the directory where this script lives +# ------------------------------------------------------------ + +cd "$(dirname "$(realpath "$0")")" + +# ------------------------------------------------------------ +# Banner +# ------------------------------------------------------------ + +clear + +printf "${CYAN}" +printf '%s\n' "================================================================" +printf '%s\n' " PASSWORD INSPECTOR" +printf '%s\n' " v${VERSION}" +printf '%s\n' " One-Click Setup & Launch" +printf '%s\n' "================================================================" +printf "${RESET}\n" + +printf "${DIM}One moment, setting things up...${RESET}\n\n" + + +# ============================================================ +# Step 1: Check Python +# ============================================================ + +if ! command -v python3 &>/dev/null; then + printf "${RED}[ERROR]${RESET} Python 3 was not found on your system.\n" + printf "\n" + printf "Install Python using your distribution's package manager.\n" + printf "\n" + printf "Arch Linux:\n" + printf " sudo pacman -S python python-pip\n" + printf "\n" + printf "Ubuntu/Debian:\n" + printf " sudo apt install python3 python3-pip python3-venv\n" + printf "\n" + exit 1 +fi + +PYTHON_VERSION=$(python3 --version) + +printf "${GREEN}[OK]${RESET} Python found: ${PYTHON_VERSION}\n" + + +# ============================================================ +# Step 2: Check Python version +# ============================================================ + +PYTHON_MAJOR=$(python3 -c 'import sys; print(sys.version_info.major)') +PYTHON_MINOR=$(python3 -c 'import sys; print(sys.version_info.minor)') + +if [[ "$PYTHON_MAJOR" -lt 3 ]] || \ + [[ "$PYTHON_MAJOR" -eq 3 && "$PYTHON_MINOR" -lt 13 ]]; then + + printf "${RED}[ERROR]${RESET} Python 3.13+ is required.\n" + printf "Found: ${PYTHON_VERSION}\n" + exit 1 +fi + +printf "${GREEN}[OK]${RESET} Python version requirement satisfied.\n" + + +# ============================================================ +# Step 3: Create virtual environment +# ============================================================ + +VENV_DIR="venv" + +if [[ ! -f "${VENV_DIR}/bin/activate" ]]; then + + printf "\n${CYAN}[1/3]${RESET} Creating virtual environment...\n" + + python3 -m venv "$VENV_DIR" + + printf "${GREEN}[OK]${RESET} Virtual environment created.\n" + +else + + printf "\n${CYAN}[1/3]${RESET} Virtual environment already exists.\n" + printf "${DIM} Skipping creation.${RESET}\n" + +fi + + +# ============================================================ +# Step 4: Activate virtual environment +# ============================================================ + +if [[ ! -f "${VENV_DIR}/bin/activate" ]]; then + + printf "${RED}[ERROR]${RESET} Virtual environment activation script not found.\n" + exit 1 + +fi + +source "${VENV_DIR}/bin/activate" + +printf "${GREEN}[OK]${RESET} Virtual environment activated.\n" + + +# ============================================================ +# Step 5: Check dependencies +# ============================================================ + +MARKER="${VENV_DIR}/.deps_hash" + +if [[ ! -f "requirements.txt" ]]; then + + printf "${YELLOW}[WARNING]${RESET} requirements.txt was not found.\n" + printf "${DIM}Skipping dependency installation.${RESET}\n" + +else + + CURRENT_HASH=$(sha256sum requirements.txt | awk '{print $1}') + + NEEDS_INSTALL=true + + if [[ -f "$MARKER" ]]; then + + SAVED_HASH=$(cat "$MARKER") + + if [[ "$CURRENT_HASH" == "$SAVED_HASH" ]]; then + NEEDS_INSTALL=false + fi + + fi + + + if [[ "$NEEDS_INSTALL" == true ]]; then + + printf "\n${CYAN}[2/3]${RESET} Installing dependencies...\n\n" + + python -m pip install --upgrade pip + + python -m pip install -r requirements.txt + + printf "\n${GREEN}[OK]${RESET} Dependencies installed.\n" + + echo "$CURRENT_HASH" > "$MARKER" + + else + + printf "\n${CYAN}[2/3]${RESET} Dependencies are up to date.\n" + printf "${DIM} Skipping installation.${RESET}\n" + + fi + +fi + + +# ============================================================ +# Step 6: Launch Password Inspector +# ============================================================ + +printf "\n${CYAN}[3/3]${RESET} Launching Password Inspector...\n\n" + +python password_inspector_cli.py + + +# ============================================================ +# Exit +# ============================================================ + +printf "\n" +printf "${CYAN}================================================================${RESET}\n" +printf "${WHITE} Password Inspector closed. Goodbye.${RESET}\n" +printf "${CYAN}================================================================${RESET}\n" +printf "\n" + +deactivate +``` diff --git a/password_inspector_cli.py b/password_inspector_cli.py index 8ed3cbf..377e6aa 100644 --- a/password_inspector_cli.py +++ b/password_inspector_cli.py @@ -12,6 +12,10 @@ from tkinter import filedialog import getpass import sys +<<<<<<< Updated upstream +======= +import os +>>>>>>> Stashed changes #Modules to use from breach_checker import checkBreached @@ -54,6 +58,24 @@ def dora() -> str | None: root.destroy()#close the window and remove it from memory return file_path if file_path else None +<<<<<<< Updated upstream +======= + + + +def swiper(): + """Clear the terminal screen in a mbava way.""" + os.system("cls" if os.name == "nt" else "clear") + + + +def pause_and_clear(): + input("\nPress Enter to return to the main menu...") + swiper() + + + +>>>>>>> Stashed changes #Actual CLI Capability is added here def main(): #1. Create parsing instance @@ -285,9 +307,14 @@ def main(): print("=" * 80 + "\n") def show_menu(): +<<<<<<< Updated upstream """This function will show the greeting menu and will abstract the logic of the underlying processes""" +======= + """This function will show the greeting menu and abstract the underlying processes.""" +>>>>>>> Stashed changes inspecting = True while inspecting: +<<<<<<< Updated upstream print("--" * 40) print(" PASSWORD INSPECTOR") print("--" * 40) @@ -325,30 +352,104 @@ def show_menu(): mode = "--report" elif choice =="3": mode = "--csv" +======= + # Clear the terminal before starting each new menu cycle + pause_and_clear() + + print("--" * 40) + print(" PASSWORD INSPECTOR") + print("--" * 40) + print("What would you like to do?\n" + " [0] How I work.\n" + " [1] Single Password Check.\n" + " [2] Password Batch Check (Report).\n" + " [3] Password Batch Check (CSV).\n" + " [4] Version.\n" + " [5] Help.\n" + " [6] Exit.") + print("--" * 40 + "\n") + + choice = input("Enter Your Choice: ") + + # How I work + if choice == "0": + printGreeting() + pause_and_clear() + + # Single password check + elif choice == "1": + password = getpass.getpass( + "Enter Password to Inspect(input is hidden): " + ) + + if password: + original_argv = sys.argv[:] + sys.argv = [sys.argv[0], password] + + try: + main() + finally: + sys.argv = original_argv + + # Batch mode + elif choice == "2" or choice == "3": + file_path = dora() + mode = None + + if choice == "2": + mode = "--report" + pause_and_clear() + elif choice == "3": + mode = "--csv" + pause_and_clear() +>>>>>>> Stashed changes if file_path: original_argv = sys.argv[:] sys.argv = [sys.argv[0], file_path, mode] +<<<<<<< Updated upstream +======= + +>>>>>>> Stashed changes try: main() finally: sys.argv = original_argv +<<<<<<< Updated upstream #if they want to see what version Password Inspector is currently running at elif choice == "4": original_argv = sys.argv[:] sys.argv = [sys.argv[0], "--version"] +======= + + # Version + elif choice == "4": + original_argv = sys.argv[:] + sys.argv = [sys.argv[0], "--version"] + +>>>>>>> Stashed changes try: main() finally: sys.argv = original_argv +<<<<<<< Updated upstream #if they want to see what else can be done with Password Inspector elif choice == "5": original_argv = sys.argv[:] sys.argv = [sys.argv[0], "--help"] +======= + + # Help + elif choice == "5": + original_argv = sys.argv[:] + sys.argv = [sys.argv[0], "--help"] + +>>>>>>> Stashed changes try: main() finally: sys.argv = original_argv +<<<<<<< Updated upstream #They want to exit elif choice == "6": print("Thank you for using Password Inspector. Goodbye & Stay Safe!") @@ -357,5 +458,20 @@ def show_menu(): print("Invalid choice. Please make sure your choice is any number from 0 to 6.") +======= + + # Exit + elif choice == "6": + print("Thank you for using Password Inspector. Goodbye & Stay Safe!") + inspecting = False + pause_and_clear() + + # Invalid choice + else: + print( + "Invalid choice. Please make sure your choice " + "is any number from 0 to 6." + ) +>>>>>>> Stashed changes if __name__ == "__main__": main() \ No newline at end of file From aeb640982c86989c84caa34a186ef17eef2c87f4 Mon Sep 17 00:00:00 2001 From: Themba Longwe <63921810+Logicc-17@users.noreply.github.com> Date: Tue, 1 Sep 2026 12:09:40 +0200 Subject: [PATCH 2/3] try these --- password_inspector_cli.py | 89 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 89 insertions(+) diff --git a/password_inspector_cli.py b/password_inspector_cli.py index 377e6aa..c3aabad 100644 --- a/password_inspector_cli.py +++ b/password_inspector_cli.py @@ -13,6 +13,10 @@ import getpass import sys <<<<<<< Updated upstream +<<<<<<< Updated upstream +======= +import os +>>>>>>> Stashed changes ======= import os >>>>>>> Stashed changes @@ -59,7 +63,10 @@ def dora() -> str | None: return file_path if file_path else None <<<<<<< Updated upstream +<<<<<<< Updated upstream +======= ======= +>>>>>>> Stashed changes @@ -68,6 +75,16 @@ def swiper(): os.system("cls" if os.name == "nt" else "clear") +<<<<<<< Updated upstream + +def pause_and_clear(): + input("\nPress Enter to return to the main menu...") + swiper() + + + +>>>>>>> Stashed changes +======= def pause_and_clear(): input("\nPress Enter to return to the main menu...") @@ -307,13 +324,18 @@ def main(): print("=" * 80 + "\n") def show_menu(): +<<<<<<< Updated upstream <<<<<<< Updated upstream """This function will show the greeting menu and will abstract the logic of the underlying processes""" +======= + """This function will show the greeting menu and abstract the underlying processes.""" +>>>>>>> Stashed changes ======= """This function will show the greeting menu and abstract the underlying processes.""" >>>>>>> Stashed changes inspecting = True while inspecting: +<<<<<<< Updated upstream <<<<<<< Updated upstream print("--" * 40) print(" PASSWORD INSPECTOR") @@ -378,6 +400,33 @@ def show_menu(): # Single password check elif choice == "1": +======= + # Clear the terminal before starting each new menu cycle + pause_and_clear() + + print("--" * 40) + print(" PASSWORD INSPECTOR") + print("--" * 40) + print("What would you like to do?\n" + " [0] How I work.\n" + " [1] Single Password Check.\n" + " [2] Password Batch Check (Report).\n" + " [3] Password Batch Check (CSV).\n" + " [4] Version.\n" + " [5] Help.\n" + " [6] Exit.") + print("--" * 40 + "\n") + + choice = input("Enter Your Choice: ") + + # How I work + if choice == "0": + printGreeting() + pause_and_clear() + + # Single password check + elif choice == "1": +>>>>>>> Stashed changes password = getpass.getpass( "Enter Password to Inspect(input is hidden): " ) @@ -402,12 +451,19 @@ def show_menu(): elif choice == "3": mode = "--csv" pause_and_clear() +<<<<<<< Updated upstream +>>>>>>> Stashed changes +======= >>>>>>> Stashed changes if file_path: original_argv = sys.argv[:] sys.argv = [sys.argv[0], file_path, mode] <<<<<<< Updated upstream +<<<<<<< Updated upstream +======= + +>>>>>>> Stashed changes ======= >>>>>>> Stashed changes @@ -415,6 +471,7 @@ def show_menu(): main() finally: sys.argv = original_argv +<<<<<<< Updated upstream <<<<<<< Updated upstream #if they want to see what version Password Inspector is currently running at elif choice == "4": @@ -427,11 +484,20 @@ def show_menu(): original_argv = sys.argv[:] sys.argv = [sys.argv[0], "--version"] +>>>>>>> Stashed changes +======= + + # Version + elif choice == "4": + original_argv = sys.argv[:] + sys.argv = [sys.argv[0], "--version"] + >>>>>>> Stashed changes try: main() finally: sys.argv = original_argv +<<<<<<< Updated upstream <<<<<<< Updated upstream #if they want to see what else can be done with Password Inspector elif choice == "5": @@ -444,11 +510,20 @@ def show_menu(): original_argv = sys.argv[:] sys.argv = [sys.argv[0], "--help"] +>>>>>>> Stashed changes +======= + + # Help + elif choice == "5": + original_argv = sys.argv[:] + sys.argv = [sys.argv[0], "--help"] + >>>>>>> Stashed changes try: main() finally: sys.argv = original_argv +<<<<<<< Updated upstream <<<<<<< Updated upstream #They want to exit elif choice == "6": @@ -468,10 +543,24 @@ def show_menu(): # Invalid choice else: +======= + + # Exit + elif choice == "6": + print("Thank you for using Password Inspector. Goodbye & Stay Safe!") + inspecting = False + pause_and_clear() + + # Invalid choice + else: +>>>>>>> Stashed changes print( "Invalid choice. Please make sure your choice " "is any number from 0 to 6." ) +<<<<<<< Updated upstream +>>>>>>> Stashed changes +======= >>>>>>> Stashed changes if __name__ == "__main__": main() \ No newline at end of file From b59a43d8f373ce04107fc0245e94b13cf17668ad Mon Sep 17 00:00:00 2001 From: Themba Longwe <63921810+Logicc-17@users.noreply.github.com> Date: Tue, 1 Sep 2026 12:17:41 +0200 Subject: [PATCH 3/3] Fix merge conflicts in password_inspector_cli.py Removed merge conflict markers and cleaned up code. --- password_inspector_cli.py | 79 +++++++++------------------------------ 1 file changed, 17 insertions(+), 62 deletions(-) diff --git a/password_inspector_cli.py b/password_inspector_cli.py index c3aabad..eee81cf 100644 --- a/password_inspector_cli.py +++ b/password_inspector_cli.py @@ -12,14 +12,8 @@ from tkinter import filedialog import getpass import sys -<<<<<<< Updated upstream -<<<<<<< Updated upstream -======= -import os ->>>>>>> Stashed changes -======= import os ->>>>>>> Stashed changes + #Modules to use from breach_checker import checkBreached @@ -62,20 +56,13 @@ def dora() -> str | None: root.destroy()#close the window and remove it from memory return file_path if file_path else None -<<<<<<< Updated upstream -<<<<<<< Updated upstream -======= -======= ->>>>>>> Stashed changes - - def swiper(): """Clear the terminal screen in a mbava way.""" os.system("cls" if os.name == "nt" else "clear") -<<<<<<< Updated upstream + def pause_and_clear(): input("\nPress Enter to return to the main menu...") @@ -83,16 +70,13 @@ def pause_and_clear(): ->>>>>>> Stashed changes -======= - def pause_and_clear(): input("\nPress Enter to return to the main menu...") swiper() ->>>>>>> Stashed changes + #Actual CLI Capability is added here def main(): #1. Create parsing instance @@ -324,19 +308,15 @@ def main(): print("=" * 80 + "\n") def show_menu(): -<<<<<<< Updated upstream -<<<<<<< Updated upstream + """This function will show the greeting menu and will abstract the logic of the underlying processes""" -======= - """This function will show the greeting menu and abstract the underlying processes.""" ->>>>>>> Stashed changes -======= + """This function will show the greeting menu and abstract the underlying processes.""" ->>>>>>> Stashed changes + + inspecting = True while inspecting: -<<<<<<< Updated upstream -<<<<<<< Updated upstream + print("--" * 40) print(" PASSWORD INSPECTOR") print("--" * 40) @@ -400,7 +380,7 @@ def show_menu(): # Single password check elif choice == "1": -======= + # Clear the terminal before starting each new menu cycle pause_and_clear() @@ -451,80 +431,59 @@ def show_menu(): elif choice == "3": mode = "--csv" pause_and_clear() -<<<<<<< Updated upstream ->>>>>>> Stashed changes -======= ->>>>>>> Stashed changes if file_path: original_argv = sys.argv[:] sys.argv = [sys.argv[0], file_path, mode] -<<<<<<< Updated upstream -<<<<<<< Updated upstream -======= ->>>>>>> Stashed changes -======= - ->>>>>>> Stashed changes try: main() finally: sys.argv = original_argv -<<<<<<< Updated upstream -<<<<<<< Updated upstream + #if they want to see what version Password Inspector is currently running at elif choice == "4": original_argv = sys.argv[:] sys.argv = [sys.argv[0], "--version"] -======= + # Version elif choice == "4": original_argv = sys.argv[:] sys.argv = [sys.argv[0], "--version"] ->>>>>>> Stashed changes -======= # Version elif choice == "4": original_argv = sys.argv[:] sys.argv = [sys.argv[0], "--version"] ->>>>>>> Stashed changes try: main() finally: sys.argv = original_argv -<<<<<<< Updated upstream -<<<<<<< Updated upstream + #if they want to see what else can be done with Password Inspector elif choice == "5": original_argv = sys.argv[:] sys.argv = [sys.argv[0], "--help"] -======= # Help elif choice == "5": original_argv = sys.argv[:] sys.argv = [sys.argv[0], "--help"] ->>>>>>> Stashed changes -======= # Help elif choice == "5": original_argv = sys.argv[:] sys.argv = [sys.argv[0], "--help"] ->>>>>>> Stashed changes try: main() finally: sys.argv = original_argv -<<<<<<< Updated upstream -<<<<<<< Updated upstream + #They want to exit elif choice == "6": print("Thank you for using Password Inspector. Goodbye & Stay Safe!") @@ -533,7 +492,7 @@ def show_menu(): print("Invalid choice. Please make sure your choice is any number from 0 to 6.") -======= + # Exit elif choice == "6": @@ -543,7 +502,7 @@ def show_menu(): # Invalid choice else: -======= + # Exit elif choice == "6": @@ -553,14 +512,10 @@ def show_menu(): # Invalid choice else: ->>>>>>> Stashed changes print( "Invalid choice. Please make sure your choice " "is any number from 0 to 6." ) -<<<<<<< Updated upstream ->>>>>>> Stashed changes -======= ->>>>>>> Stashed changes + if __name__ == "__main__": - main() \ No newline at end of file + main()