Skip to content

Instantly share code, notes, and snippets.

View adamff-dev's full-sized avatar

Adam adamff-dev

View GitHub Profile
@adamff-dev
adamff-dev / update-ublock-chromium.ps1
Created July 20, 2025 10:25
This script checks for the latest release of the uBlock Origin extension for Chromium from GitHub. If a newer version is available, it automatically downloads the latest .zip package and updates the local extension directory accordingly.
$destDir = "C:\Users\extensions"
$ublockDir = "uBlock0"
$manifestPath = Join-Path $destDir "$ublockDir\manifest.json"
try {
$manifestContent = Get-Content $manifestPath -Raw | ConvertFrom-Json
$currentVersion = $manifestContent.version
Write-Output "Versión instalada: $currentVersion"
} catch {
Write-Error "Error al leer o convertir el manifest.json: $_"
@adamff-dev
adamff-dev / Fix Need For Speed The Run Voices.ps1
Created June 5, 2025 19:07
This script fixes Need for Speed: The Run voice files by removing unwanted locales and updating the system settings.
# Request administrator privileges and relaunch if not present
if (-not ([Security.Principal.WindowsPrincipal] [Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltinRole] "Administrator"))
{
Write-Host "Script needs to run as Administrator. Relaunching..."
Start-Process -FilePath pwsh -ArgumentList "-File `"$PSCommandPath`"" -Verb RunAs
exit
}
# Function to request input with a message
function Read-Input($message) {
@adamff-dev
adamff-dev / update-ublock-chromium.sh
Created May 28, 2025 12:01
This script checks for the latest release of the uBlock Origin extension for Chromium from GitHub. If a newer version is available, it automatically downloads the latest .zip package and updates the local extension directory accordingly.
#!/bin/bash
DEST_DIR="/home/adam/Dropbox/chrome-extensions"
UBLOCK_DIR="uBlock0.chromium"
# Detect current version (from existing manifest.json)
CURRENT_VERSION=$(jq -r '.version' "$DEST_DIR/$UBLOCK_DIR/manifest.json" 2>/dev/null)
# Get latest release tag from GitHub (e.g., "1.56.0")
LATEST_VERSION=$(curl -s https://api.github.com/repos/gorhill/uBlock/releases/latest | jq -r .tag_name)
@adamff-dev
adamff-dev / recursive_video_compressor.py
Created March 18, 2025 19:52
A Python script that recursively compresses videos larger than 100MB using FFmpeg with HEVC (H.265) encoding. Supports both CPU (libx265) and AMD GPU (hevc_amf) compression. Preserves metadata and skips already compressed files.
import os
import argparse
import subprocess
import sys
# Constants
SIZE_THRESHOLD_MB = 100 # Minimum file size to compress (in MB)
VIDEO_EXTENSIONS = ('.mp4', '.mov', '.mkv', '.avi', '.wmv', '.flv', '.webm', '.m4v', '.3gp', '.ogv', '.ogg')
def compress_video(input_path, output_path):
@adamff-dev
adamff-dev / Restore New Text Document context menu item.reg
Created January 3, 2025 23:57
Add "create new text file" to Windows 11 context menu
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\.txt\ShellNew]
"ItemName"=hex(2):40,00,25,00,53,00,79,00,73,00,74,00,65,00,6d,00,52,00,6f,00,6f,00,74,00,25,00,5c,00,73,00,79,00,73,00,74,00,65,00,6d,00,33,00,32,00,5c,00,6e,00,6f,00,74,00,65,00,70,00,61,00,64,00,2e,00,65,00,78,00,65,00,2c,00,2d,00,34,00,37,00,30,00,00,00
"NullFile"=""
[HKEY_CLASSES_ROOT\txtfilelegacy]
@="Documento de texto"
@adamff-dev
adamff-dev / rebuild-icon-cache.bat
Created November 12, 2024 19:20
Rebuild the Icon Cache: sometimes, a corrupted icon cache causes slow loading. You can rebuild it with these commands.
taskkill /f /im explorer.exe
del /a /f /q "%localappdata%\IconCache.db"
del /a /f /q "%localappdata%\Microsoft\Windows\Explorer\iconcache*"
start explorer.exe
@adamff-dev
adamff-dev / Kaspersky Virus Removal Tool updater.ps1
Created August 22, 2024 20:06
This PowerShell script downloads or updates the Kaspersky Virus Removal Tool (KVRT) and shows a MessageBox to inform the user of the download's success or failure.
# Add necessary .NET assembly for MessageBox
Add-Type -AssemblyName PresentationFramework
# Define the URL of the file to be downloaded
$url = "https://devbuilds.s.kaspersky-labs.com/devbuilds/KVRT/latest/full/KVRT.exe"
# Define the destination file name in the current directory
$destinationFile = ".\KVRT.exe"
try {