This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$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: $_" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
taskkill /f /im explorer.exe | |
del /a /f /q "%localappdata%\IconCache.db" | |
del /a /f /q "%localappdata%\Microsoft\Windows\Explorer\iconcache*" | |
start explorer.exe |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 { |