Skip to content

Instantly share code, notes, and snippets.

View ph33nx's full-sized avatar
🥷
Cooking

Abhi ph33nx

🥷
Cooking
  • 12:25 (UTC +05:30)
View GitHub Profile
@ph33nx
ph33nx / bulk_img_convert_and_rename.py
Created May 4, 2025 23:53
Lightning‑fast Python CLI Script to bulk convert any image format (PNG, JPEG, WebP, BMP, TIFF, GIF…) into compressed, progressive JPEGs, bulk renamed, with all metadata stripped and every CPU core engaged. Ideal for web performance, SEO, e‑commerce product galleries, and batch uploads.
#!/usr/bin/env python3
"""
bulk_img_convert_and_rename.py – Bulk Image Convert & Rename Python Script
Production‑ready command‑line utility for web developers, photographers, SEO specialists and e‑commerce teams who need to bulk convert and bulk rename thousands of images before pushing to GitHub, S3, CDN or serving them on high‑performance websites.
Core features:
- Bulk image convert: reads every format Pillow supports (PNG, JPEG, WebP, BMP, TIFF, GIF, etc.) and compresses them into small, progressive JPEGs optimised for web delivery.
- Automatic bulk rename: each output is saved as img_<n>.jpg, ready for CDN caching and static‑site generators.
- One‑click metadata stripping: removes EXIF, GPS, ICC and all other heavy data to protect privacy and improve SEO scores.
@ph33nx
ph33nx / directplay.py
Last active May 8, 2025 04:12
Python script that converts videos to H.264/AAC MP4 so Jellyfin, Plex, Emby, Android TV and Chromecast devices stream without transcoding. Perfect for media servers, homelabs, NAS boxes and Proxmox LXC VMs. #ffmpeg #chromecast #jellyfin #transcode #remux #batch-encode #python #smart-tv #media-server #directplay
#!/usr/bin/env python3
"""
directplay.py
=============
Batch-optimise any video library so every file direct-plays on
Chromecast, smart-TVs and desktop/mobile browsers — no server-side
transcoding required.
Key features
@ph33nx
ph33nx / audio-conversion-ffmpeg-opus-webm.md
Last active April 22, 2025 15:35
FFmpeg Audio Conversion Guide: Convert MP3 to high-quality Opus in a WebM container for efficient audio streaming and compression on Windows, Linux, and macOS

Audio File Conversion with FFmpeg for Audio Streaming

Author: ph33nx

This guide provides detailed instructions for converting your audio files (e.g., MP3) into a high-quality, compressed Opus format encapsulated in a WebM container using FFmpeg. It is designed for developers, system administrators, and audio engineers looking for efficient audio streaming, optimal media conversion, and reliable audio compression solutions across multiple operating systems.

Table of Contents

@ph33nx
ph33nx / ComfyUI-Docker-Quickstart.md
Last active March 20, 2025 09:26
This quickstart guide shows you how to containerize and run ComfyUI using Docker on both Linux and Windows (including WSL, CMD, and PowerShell). It provides step-by-step instructions to create a local "comfy" directory and launch the Docker container with NVIDIA GPU support. Ideal for users looking to deploy ComfyUI in a containerized environmen…
@ph33nx
ph33nx / TurnOffMonitor.ps1
Created March 3, 2025 08:20
PowerShell Windows API Script: Instantly Turn Off Your Monitor (Developer Hack) Leverage this advanced PowerShell script that uses Windows API calls to instantly power off your monitor without disrupting background tasks. Perfect for system automation, IT efficiency, and developer productivity. Follow the included shortcut instructions to set up…
# TurnOffMonitor.ps1
# This script leverages the Windows API via .NET to power off the display while keeping background processes running.
# Author: ph33nx (https://github.com/ph33nx)
# Shortcut Instructions:
# 1. Right-click on your Desktop and select "New > Shortcut".
# 2. In the "Type the location of the item" field, paste:
# powershell.exe -ExecutionPolicy Bypass -File "C:\path\to\TurnOffMonitor.ps1"
# 3. Click "Next", give your shortcut a name (e.g., "Turn Off Monitor"), and finish.
# 4. (Optional) Assign a hotkey by right-clicking the shortcut, selecting "Properties", and setting your desired key combination.
# Keywords: Windows API, PowerShell, monitor off, turn off display, display sleep shortcut, Windows shortcut, system automation,
@ph33nx
ph33nx / Install-Android-USB-ADB-Fastboot-Windows-2025.md
Last active May 16, 2025 14:16
Install Android USB Driver, ADB, and Fastboot on Windows 10/11 (2025) – Step-by-step instructions to install the Android USB driver and set up ADB/Fastboot using winget on Windows 10/11. Perfect for Android development and troubleshooting.

Credit: ph33nx


Manual Installation Guide for Android USB Driver & ADB/Fastboot (Windows 10/11)

This guide provides simple, direct steps to manually install the Google USB Driver and ADB/Fastboot binaries using winget on Windows 10/11.


@ph33nx
ph33nx / project2txt.py
Last active February 7, 2025 15:20
project2txt.py - Python script that Exports Project Structure, Code and File Contents to txt file for LLM, ChatGPT, Agent Based Workflows. Scans a project's directory structure and exports the file hierarchy and contents into a clean, human-readable YAML file. This script is designed to simplify AI workflows, including those leveraging ChatGPT, …
#!/usr/bin/env python3
"""
project2txt.py
Python script to scan a project's directory structure for common programming files and export it to a text file.
Respects .gitignore rules if present, handles subdirectories, and preserves file contents.
Only includes paths that contain common programming and project files.
Author: ph33nx
GitHub: https://gist.github.com/ph33nx/12ce315ef6dbcf9ef1d01f5371af4a3d
@ph33nx
ph33nx / block-internet-access-folder-executables-windows-firewall.bat
Last active May 6, 2025 18:57
Batch script to block internet access for all .exe files in a folder recursively using Windows Firewall (inbound and outbound rules). Includes dynamic folder path input, usage instructions, and automation.
@echo off
:: Batch Script: block_folder.bat
:: Author: https://github.com/ph33nx
:: Description: Blocks all .exe files in the specified folder (and subfolders) from accessing the internet (both inbound and outbound) using Windows Firewall.
:: Usage:
:: block_folder.bat [FolderPath]
:: - Pass the folder path containing the .exe files to block.
:: block_folder.bat -h
:: - Displays this help message.
@ph33nx
ph33nx / arch-linux-setup-gaming.sh
Last active March 2, 2025 10:39
Arch Linux Gaming Setup Script: Automate the installation of NVIDIA drivers, Wine, Lutris, Vulkan, and essential 32-bit libraries for gaming. This script ensures a complete gaming environment setup with DXVK and Winetricks on Arch-based systems. Perfect for gamers looking to optimize their Linux setup for titles on Steam, Epic, or standalone Win…
#!/bin/bash
# Gaming Setup Script for Arch Linux with Nvidia GPU
# Author: ph33nx
# Description: Installs all necessary packages and configurations for gaming on Arch Linux
# Update system and keyring
echo "Updating system and keyring..."
sudo pacman -Syu --needed --noconfirm archlinux-keyring
@ph33nx
ph33nx / download_subtitles.py
Last active March 2, 2025 10:38
Python script to recursively download missing subtitles for video files
#!/usr/bin/env python3
import os
import sys
from babelfish import Language
from subliminal import download_best_subtitles, region, save_subtitles, scan_video
# Configure subliminal cache
region.configure('dogpile.cache.dbm', arguments={'filename': 'cachefile.dbm'})