Skip to content

Instantly share code, notes, and snippets.

View gauti123456's full-sized avatar

John Mitchell gauti123456

  • John Mitchell
  • New Zealand
View GitHub Profile
@gauti123456
gauti123456 / app.py
Created May 2, 2025 13:19
Python 3 Script to Fetch Saved Internet Wi-Fi Passwords & Display it in Terminal on Windows
import subprocess
import re
def get_saved_wifi_profiles():
result = subprocess.run(["netsh", "wlan", "show", "profiles"], capture_output=True, text=True)
profiles = re.findall(r"All User Profile\s*:\s(.*)", result.stdout)
return [profile.strip() for profile in profiles]
def get_wifi_details(profile_name):
@gauti123456
gauti123456 / app.py
Created April 29, 2025 10:48
Python 3 Audio & Music Editor Script to Change Pitch of Sound in Terminal Using librosa Module
import librosa
import soundfile as sf
# Usage: python pitch_shift.py input.wav output.wav semitones
input_file = "output.mp3"
output_file = "pitched.mp3"
semitones = -8 # positive = higher pitch, negative = lower pitch
# Load audio
y, sr = librosa.load(input_file, sr=None)
@gauti123456
gauti123456 / app.py
Created April 27, 2025 09:27
Python 3 Script to Build Mini Audio Player to Play Audio Files in Terminal Using audioplayer Library
import time
import threading
from audioplayer import AudioPlayer
import keyboard # <-- Install it if you don't have: pip install keyboard
# Create AudioPlayer object
player = AudioPlayer("newanthem.mp3")
# Show file info
print(f"Filename: {player.filename}")
@gauti123456
gauti123456 / app.py
Created April 27, 2025 08:52
Python 3 Face Swapping Script to Swap Faces Using Dlib, OpenCV and TinyFace Library in Terminal
import cv2
from tinyface import FacePair, TinyFace
# Load the input image
input_img = cv2.imread("3.jpg")
# Initialize TinyFace
tinyface = TinyFace()
# (Optional) Prepare models (only needed once; will download automatically)
@gauti123456
gauti123456 / app.py
Last active April 27, 2025 22:34
Python 3 OpenCV & Deep AI Face Recognition & Analysis of Images and Save Result in JSON File
import json
from deepface import DeepFace
import cv2
import os
import numpy as np # Add numpy
# Path to image
image_path = "angry.jpg"
# Verify if image exists
@gauti123456
gauti123456 / app.py
Created April 26, 2025 19:46
Python 3 OpenCV Script to Detect Face in Live Webcam Video Feed & Save it as PNG Image Frames App
import cv2
import os
def webcam_face_capture(folder_path):
# Load Haar Cascade for face detection
face_cascade = cv2.CascadeClassifier(cv2.data.haarcascades + 'haarcascade_frontalface_default.xml')
# Open webcam
cap = cv2.VideoCapture(2)
@gauti123456
gauti123456 / app.py
Created April 26, 2025 19:18
Python 3 Tkinter Script to Show Webcam Live Feed Video in Window Using tkinter_webcam Library
import tkinter as tk
from tkinter_webcam import webcam
# Create the main window
window = tk.Tk()
window.title("Webcam Viewer")
# Create the webcam box
webcam_object = webcam.Box(window, width=450, height=450)
@gauti123456
gauti123456 / app.py
Last active April 26, 2025 19:16
Python 3 Tkinter Script to Build Webcam Image & Video Recorder Using OpenCV & Pillow GUI Desktop App
import tkinter as tk
from tkinter import filedialog
import cv2
from PIL import Image, ImageTk
CAMERA_INDEX = 2 # Change based on your camera
recording = False
out = None
@gauti123456
gauti123456 / app.py
Created April 26, 2025 05:20
Python 3 googletrans Example to Use Google Translate API to Translate Text For Unlimited For FREE
from googletrans import Translator, LANGUAGES
translator = Translator()
text_to_translate = "Hello"
for lang_code, lang_name in LANGUAGES.items():
try:
translated = translator.translate(text_to_translate, src='en', dest=lang_code)
print(f"{lang_name.title()} ({lang_code}): {translated.text}")
except Exception as e:
@gauti123456
gauti123456 / app.py
Created April 26, 2025 05:17
Python 3 Google Translate API Example to Translate Text in All Languages For FREE in Terminal
from translate import Translator
# Sample text
text_to_translate = "Good night"
# List of supported language codes (as per the `translate` library)
language_codes = [
"af", "sq", "am", "ar", "hy", "az", "eu", "be", "bn", "bs", "bg", "ca", "ceb", "zh", "zh-TW",
"co", "hr", "cs", "da", "nl", "en", "eo", "et", "fi", "fr", "fy", "gl", "ka", "de", "el", "gu",
"ht", "ha", "haw", "he", "hi", "hmn", "hu", "is", "ig", "id", "ga", "it", "ja", "jw", "kn", "kk",