diff --git a/commandos/Add-Path.ps1 b/commandos/Add-Path.ps1 new file mode 100644 index 0000000000000000000000000000000000000000..2f2233ac8d04093d2bbe2fc97c1b91d26aff7dfe --- /dev/null +++ b/commandos/Add-Path.ps1 @@ -0,0 +1,54 @@ +<# +.SYNOPSIS + Adiciona um ou mais caminhos ao PATH do utilizador de forma persistente e segura. + Contorna o limite de 1024 caracteres do comando 'setx'. + +.EXAMPLE + .\Add-Path.ps1 "C:\Caminho\Para\Pasta" +#> + +param ( + [Parameter(Mandatory=$true, HelpMessage="Caminho a adicionar ao PATH")] + [string[]]$NewPaths +) + +# 1) Obter o PATH atual do registo (User level) para evitar poluição da sessão atual +$currentPath = [Environment]::GetEnvironmentVariable("PATH", "User") +$pathList = $currentPath -split ";" | Where-Object { $_ -ne "" } + +$addedCount = 0 + +foreach ($p in $NewPaths) { + # Limpar espaços e aspas + $cleanPath = $p.Trim().Trim('"') + + if (-not (Test-Path $cleanPath)) { + Write-Warning "O caminho não existe: $cleanPath" + continue + } + + # Verificar se já existe no PATH (case-insensitive) + if ($pathList -inotcontains $cleanPath) { + $pathList += $cleanPath + $addedCount++ + Write-Host "✅ A adicionar: $cleanPath" -ForegroundColor Cyan + } else { + Write-Host "ℹ️ Já existe no PATH: $cleanPath" -ForegroundColor Yellow + } +} + +if ($addedCount -gt 0) { + # Juntar novamente com ponto e vírgula + $updatedPath = $pathList -join ";" + + # Gravar permanentemente no Registo (User) + [Environment]::SetEnvironmentVariable("PATH", $updatedPath, "User") + + # Atualizar a sessão atual do PowerShell para uso imediato + $env:PATH = [Environment]::GetEnvironmentVariable("PATH", "Machine") + ";" + $updatedPath + + Write-Host "`n✨ Sucesso! $addedCount caminho(s) adicionado(s) ao PATH permanentemente." -ForegroundColor Green + Write-Host "📢 Nota: Novas consolas terão o PATH atualizado. A sessão atual foi atualizada para este processo." +} else { + Write-Host "`nNada a alterar. O PATH já contém os caminhos indicados." -ForegroundColor Gray +} diff --git a/commandos/Easy-Wav2Lip.bat b/commandos/Easy-Wav2Lip.bat new file mode 100644 index 0000000000000000000000000000000000000000..3fa5a0c51d25b99910ef22eb5ada78a776c0e2a0 --- /dev/null +++ b/commandos/Easy-Wav2Lip.bat @@ -0,0 +1,2889 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Easy-Wav2Lip/Easy-Wav2Lip.bat at Installers · anothermartz/Easy-Wav2Lip + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ Skip to content + + + + + + + + + + + +
+
+ + + + + + + + + + + + + +
+ +
+ + + + + + + + +
+ + + + + +
+ + + + + + + + + + + +
+
+
+ + + + + + + + + + + + + + + +
+ Open in github.dev + Open in a new github.dev tab + Open in codespace + + + + + + + + + + + + + + + + + + +

Latest commit

 

History

History
248 lines (217 loc) · 7.18 KB

Easy-Wav2Lip.bat

File metadata and controls

248 lines (217 loc) · 7.18 KB
+
+ + + + +
+ +
+ +
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + diff --git a/commandos/FIXA_VARIAVEIS.bat b/commandos/FIXA_VARIAVEIS.bat new file mode 100644 index 0000000000000000000000000000000000000000..e40e774ebebe0df6ff38221aa0f817b5cbc49248 --- /dev/null +++ b/commandos/FIXA_VARIAVEIS.bat @@ -0,0 +1,4 @@ +rem Restaurar variáveis de sistema e utilizador na sessão atual do CMD +setx PATH "%PATH%" /M +setx PATH "%PATH%" +rem Depois feche e abra um novo terminal para as alterações surtirem efeito diff --git a/commandos/Fix-MSCV.ps1 b/commandos/Fix-MSCV.ps1 new file mode 100644 index 0000000000000000000000000000000000000000..82e16387dac2689290c7759b252cc025ff995727 --- /dev/null +++ b/commandos/Fix-MSCV.ps1 @@ -0,0 +1,79 @@ +# Fix-MSCV.ps1 +# Corrige erro "cl.exe não encontrado" configurando ambiente MSVC automaticamente + +Write-Host "`n=== MSVC Auto-Fix ===`n" + +# 1) Procurar instalação do MSVC usando vswhere (mais robusto) +$vswhere = "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe" +$installPath = $null + +if (Test-Path $vswhere) { + $installPath = & $vswhere -latest -products * -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property installationPath +} + +if (-not $installPath) { + # Fallback para caminhos manuais (incluindo VS 18/2022) + $vsPaths = @( + "C:\Program Files\Microsoft Visual Studio\18\Community", + "C:\Program Files\Microsoft Visual Studio\2022\BuildTools", + "C:\Program Files\Microsoft Visual Studio\2022\Community", + "C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools", + "C:\Program Files (x86)\Microsoft Visual Studio\2022\Community" + ) + + foreach ($p in $vsPaths) { + if (Test-Path (Join-Path $p "VC\Auxiliary\Build\vcvarsall.bat")) { + $installPath = $p + break + } + } +} + +if (-not $installPath) { + Write-Host "❌ MSVC não encontrado no sistema." + Write-Host "➡ A abrir instalador Build Tools..." + Start-Process "https://aka.ms/vs/17/release/vs_BuildTools.exe" + exit +} + +$vcvars = Join-Path $installPath "VC\Auxiliary\Build\vcvarsall.bat" +Write-Host "✅ MSVC encontrado em: $installPath" + +# 2) Criar wrapper temporário para carregar ambiente MSVC +$temp = "$env:TEMP\msvc_env.cmd" +@" +@echo off +call "$vcvars" x64 >nul +set +"@ | Out-File -Encoding ascii $temp + +# 3) Executar wrapper e capturar variáveis +$vars = cmd.exe /c $temp + +Write-Host "🔄 A configurar variáveis de ambiente (pode demorar alguns segundos)..." +foreach ($line in $vars) { + if ($line -match "^(.*?)=(.*)$") { + $name = $matches[1] + $value = $matches[2] + + # Apenas atualizar variáveis críticas para evitar poluição excessiva do registo + if ($name -in @("PATH", "INCLUDE", "LIB", "LIBPATH")) { + [Environment]::SetEnvironmentVariable($name, $value, "User") + # Também atualizar a sessão atual + Set-Content "env:$name" $value + } + } +} + +Write-Host "✨ Ambiente MSVC configurado!" + +# 4) Testar cl.exe +$cl = Get-Command cl.exe -ErrorAction SilentlyContinue + +if ($cl) { + Write-Host "🚀 Sucesso! O cl.exe está disponível em:" + Write-Host " $($cl.Source)" +} else { + Write-Host "⚠️ O MSVC foi configurado, mas pode ser necessário reiniciar a consola para aplicar o PATH totalmente." +} + diff --git a/commandos/Monitor-GPU-RAM.bat b/commandos/Monitor-GPU-RAM.bat new file mode 100644 index 0000000000000000000000000000000000000000..834e7c784643552a86b73ba0bea71d6f80a34ca0 --- /dev/null +++ b/commandos/Monitor-GPU-RAM.bat @@ -0,0 +1,38 @@ +# Monitorização contínua de GPUs e RAM + +# Atualiza a cada 2 segundos +$interval = 2 + +# Função para mostrar estado de GPUs +function Show-GPUStatus { + Write-Host "============================================" + Write-Host (Get-Date -Format "yyyy-MM-dd HH:mm:ss") + + # Lista todas as GPUs NVIDIA via nvidia-smi + Write-Host "`n=== NVIDIA GPUs ===" + & nvidia-smi --query-gpu=index,name,driver_version,memory.total,memory.used,utilization.gpu,utilization.memory --format=csv,noheader,nounits + + # Informações sobre AMD via WMI (somente adaptável a placas AMD suportadas) + Write-Host "`n=== AMD / Other GPUs ===" + Get-WmiObject Win32_VideoController | ForEach-Object { + Write-Host "Name: $($_.Name)" + Write-Host "Adapter RAM: $([math]::Round($_.AdapterRAM / 1MB)) MB" + Write-Host "Current Usage: $([math]::Round($_.CurrentBits / 1MB)) MB" # Note: nem todos os drivers reportam CurrentBits + } + + # Uso de RAM do sistema + Write-Host "`n=== Sistema RAM ===" + $os = Get-CimInstance Win32_OperatingSystem + $total = [math]::Round($os.TotalVisibleMemorySize / 1024) + $free = [math]::Round($os.FreePhysicalMemory / 1024) + Write-Host "Total RAM: $total MB" + Write-Host "Free RAM: $free MB" + Write-Host "Used RAM: $($total - $free) MB" + Write-Host "============================================`n" +} + +# Loop infinito com intervalo definido +while ($true) { + Show-GPUStatus + Start-Sleep -Seconds $interval +} diff --git a/commandos/OllamaClaude.bat b/commandos/OllamaClaude.bat new file mode 100644 index 0000000000000000000000000000000000000000..dfdbf4357a4d050f035fafdcf1881ec9e0e40f18 --- /dev/null +++ b/commandos/OllamaClaude.bat @@ -0,0 +1,3 @@ +@echo off +echo Starting Claude with qwen3.5:latest... +ollama launch claude --model qwen3.5:latest diff --git a/commandos/OllamaClaude.ps1 b/commandos/OllamaClaude.ps1 new file mode 100644 index 0000000000000000000000000000000000000000..b457deb926ec8fb92e57a2745ddbdbd735f2838b --- /dev/null +++ b/commandos/OllamaClaude.ps1 @@ -0,0 +1,3 @@ +# Script rápido para iniciar o Claude +Write-Host "Starting Claude with qwen3.5:latest..." -ForegroundColor Green +ollama launch claude --model qwen3.5:latest diff --git a/commandos/RGSX Retrobat.bat b/commandos/RGSX Retrobat.bat new file mode 100644 index 0000000000000000000000000000000000000000..c0da75f3c125cd8c34a0cf0118f50a3b4af5a70f --- /dev/null +++ b/commandos/RGSX Retrobat.bat @@ -0,0 +1,385 @@ +@echo off +setlocal EnableDelayedExpansion + +:: ============================================================================= +:: RGSX Retrobat Launcher v1.3 +:: ============================================================================= +:: Usage: "RGSX Retrobat.bat" [options] +:: --display=N Launch on display N (0=primary, 1=secondary, etc.) +:: --windowed Launch in windowed mode instead of fullscreen +:: --help Show this help +:: ============================================================================= + +:: Configuration des couleurs (codes ANSI) +for /F "tokens=1,2 delims=#" %%a in ('"prompt #$H#$E# & echo on & for %%b in (1) do rem"') do ( + set "ESC=%%b" +) + +:: Couleurs +set "GREEN=[92m" +set "YELLOW=[93m" +set "RED=[91m" +set "CYAN=[96m" +set "RESET=[0m" +set "BOLD=[1m" + +:: ============================================================================= +:: Traitement des arguments +:: ============================================================================= +set "DISPLAY_NUM=" +set "WINDOWED_MODE=" +set "CONFIG_FILE=" + +:parse_args +if "%~1"=="" goto :args_done +if /i "%~1"=="--help" goto :show_help +if /i "%~1"=="-h" goto :show_help +if /i "%~1"=="--windowed" ( + set "WINDOWED_MODE=1" + shift + goto :parse_args +) +:: Check for --display=N format +echo %~1 | findstr /r "^--display=" >nul +if !ERRORLEVEL! EQU 0 ( + for /f "tokens=2 delims==" %%a in ("%~1") do set "DISPLAY_NUM=%%a" + shift + goto :parse_args +) +shift +goto :parse_args + +:show_help +echo. +echo %ESC%%CYAN%RGSX Retrobat Launcher - Help%ESC%%RESET% +echo. +echo Usage: "RGSX Retrobat.bat" [options] +echo. +echo Options: +echo --display=N Launch on display N (0=primary, 1=secondary, etc.) +echo --windowed Launch in windowed mode instead of fullscreen +echo --help, -h Show this help +echo. +echo Examples: +echo "RGSX Retrobat.bat" Launch on primary display +echo "RGSX Retrobat.bat" --display=1 Launch on secondary display (TV) +echo "RGSX Retrobat.bat" --windowed Launch in windowed mode +echo. +echo You can also create shortcuts with different display settings. +echo. +pause +exit /b 0 + +:args_done + +:: URL de telechargement Python +set "PYTHON_ZIP_URL=https://github.com/RetroGameSets/RGSX/raw/main/windows/python.zip" + +:: Obtenir le chemin du script de maniere fiable +set "SCRIPT_DIR=%~dp0" +set "SCRIPT_DIR=%SCRIPT_DIR:~0,-1%" + +:: Detecter le repertoire racine +for %%I in ("%SCRIPT_DIR%\..\.." ) do set "ROOT_DIR=%%~fI" + +:: Configuration des logs +set "LOG_DIR=%ROOT_DIR%\roms\windows\logs" +if not exist "%LOG_DIR%" mkdir "%LOG_DIR%" +set "LOG_FILE=%LOG_DIR%\Retrobat_RGSX_log.txt" +set "LOG_BACKUP=%LOG_DIR%\Retrobat_RGSX_log.old.txt" + +:: Rotation des logs avec backup +if exist "%LOG_FILE%" ( + for %%A in ("%LOG_FILE%") do ( + if %%~zA GTR 100000 ( + if exist "%LOG_BACKUP%" del /q "%LOG_BACKUP%" + move /y "%LOG_FILE%" "%LOG_BACKUP%" >nul 2>&1 + echo [%DATE% %TIME%] Log rotated - previous log saved as .old.txt > "%LOG_FILE%" + ) + ) +) + +:: ============================================================================= +:: Ecran d'accueil +:: ============================================================================= +cls +echo. +echo %ESC%%CYAN% ____ ____ ______ __ %ESC%%RESET% +echo %ESC%%CYAN% ^| _ \ / ___^/ ___\ \/ / %ESC%%RESET% +echo %ESC%%CYAN% ^| ^|_) ^| ^| _\___ \\ / %ESC%%RESET% +echo %ESC%%CYAN% ^| _ ^<^| ^|_^| ^|___) / \ %ESC%%RESET% +echo %ESC%%CYAN% ^|_^| \_\\____^|____/_/\_\ %ESC%%RESET% +echo. +echo %ESC%%BOLD% RetroBat Launcher v1.3%ESC%%RESET% +echo -------------------------------- +if "!DISPLAY_NUM!" NEQ "0" ( + echo %ESC%%CYAN%Display: !DISPLAY_NUM!%ESC%%RESET% +) +if "!WINDOWED_MODE!"=="1" ( + echo %ESC%%CYAN%Mode: Windowed%ESC%%RESET% +) +echo. + +:: Debut du log +echo [%DATE% %TIME%] ========================================== >> "%LOG_FILE%" +echo [%DATE% %TIME%] RGSX Launcher v1.3 started >> "%LOG_FILE%" +echo [%DATE% %TIME%] Display: !DISPLAY_NUM!, Windowed: !WINDOWED_MODE! >> "%LOG_FILE%" +echo [%DATE% %TIME%] ========================================== >> "%LOG_FILE%" + +:: Configuration des chemins +set "PYTHON_DIR=%ROOT_DIR%\system\tools\Python" +set "PYTHON_EXE=%PYTHON_DIR%\python.exe" +set "MAIN_SCRIPT=%ROOT_DIR%\roms\ports\RGSX\__main__.py" +set "ZIP_FILE=%ROOT_DIR%\roms\windows\python.zip" + +:: Exporter RGSX_ROOT pour le script Python +set "RGSX_ROOT=%ROOT_DIR%" + +:: Logger les chemins +echo [%DATE% %TIME%] System info: >> "%LOG_FILE%" +echo [%DATE% %TIME%] ROOT_DIR: %ROOT_DIR% >> "%LOG_FILE%" +echo [%DATE% %TIME%] PYTHON_EXE: %PYTHON_EXE% >> "%LOG_FILE%" +echo [%DATE% %TIME%] MAIN_SCRIPT: %MAIN_SCRIPT% >> "%LOG_FILE%" +echo [%DATE% %TIME%] RGSX_ROOT: %RGSX_ROOT% >> "%LOG_FILE%" + +:: ============================================================================= +:: Verification Python +:: ============================================================================= +echo %ESC%%YELLOW%[1/3]%ESC%%RESET% Checking Python environment... +echo [%DATE% %TIME%] Step 1/3: Checking Python >> "%LOG_FILE%" + +if not exist "%PYTHON_EXE%" ( + echo %ESC%%YELLOW%^> Python not found, installing...%ESC%%RESET% + echo [%DATE% %TIME%] Python not found, starting installation >> "%LOG_FILE%" + + :: Creer le dossier Python + if not exist "%PYTHON_DIR%" ( + mkdir "%PYTHON_DIR%" 2>nul + echo [%DATE% %TIME%] Created folder: %PYTHON_DIR% >> "%LOG_FILE%" + ) + + :: Verifier si le ZIP existe, sinon le telecharger + if not exist "%ZIP_FILE%" ( + echo %ESC%%YELLOW%^> python.zip not found, downloading from GitHub...%ESC%%RESET% + echo [%DATE% %TIME%] python.zip not found, attempting download >> "%LOG_FILE%" + echo [%DATE% %TIME%] Download URL: %PYTHON_ZIP_URL% >> "%LOG_FILE%" + + :: Verifier si curl est disponible + where curl.exe >nul 2>&1 + if !ERRORLEVEL! EQU 0 ( + echo %ESC%%CYAN%^> Using curl to download...%ESC%%RESET% + echo [%DATE% %TIME%] Using curl.exe for download >> "%LOG_FILE%" + curl.exe -L -# -o "%ZIP_FILE%" "%PYTHON_ZIP_URL%" + set DOWNLOAD_RESULT=!ERRORLEVEL! + ) else ( + :: Fallback sur PowerShell + echo %ESC%%CYAN%^> Using PowerShell to download...%ESC%%RESET% + echo [%DATE% %TIME%] curl not found, using PowerShell >> "%LOG_FILE%" + powershell -NoProfile -ExecutionPolicy Bypass -Command "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; $ProgressPreference = 'SilentlyContinue'; Invoke-WebRequest -Uri '%PYTHON_ZIP_URL%' -OutFile '%ZIP_FILE%'" + set DOWNLOAD_RESULT=!ERRORLEVEL! + ) + + :: Verifier le resultat du telechargement + if !DOWNLOAD_RESULT! NEQ 0 ( + echo. + echo %ESC%%RED% ERROR: Download failed!%ESC%%RESET% + echo. + echo Please download python.zip manually from: + echo %ESC%%CYAN%%PYTHON_ZIP_URL%%ESC%%RESET% + echo. + echo And place it in: + echo %ESC%%CYAN%%ROOT_DIR%\roms\windows\%ESC%%RESET% + echo. + echo [%DATE% %TIME%] ERROR: Download failed with code !DOWNLOAD_RESULT! >> "%LOG_FILE%" + goto :error + ) + + :: Verifier que le fichier a bien ete telecharge et n'est pas vide + if not exist "%ZIP_FILE%" ( + echo. + echo %ESC%%RED% ERROR: Download failed - file not created!%ESC%%RESET% + echo [%DATE% %TIME%] ERROR: ZIP file not created after download >> "%LOG_FILE%" + goto :error + ) + + :: Verifier la taille du fichier (doit etre > 1MB pour etre valide) + for %%A in ("%ZIP_FILE%") do set ZIP_SIZE=%%~zA + if !ZIP_SIZE! LSS 1000000 ( + echo. + echo %ESC%%RED% ERROR: Downloaded file appears invalid ^(too small^)!%ESC%%RESET% + echo [%DATE% %TIME%] ERROR: Downloaded file too small: !ZIP_SIZE! bytes >> "%LOG_FILE%" + del /q "%ZIP_FILE%" 2>nul + goto :error + ) + + echo %ESC%%GREEN%^> Download complete ^(!ZIP_SIZE! bytes^)%ESC%%RESET% + echo [%DATE% %TIME%] Download successful: !ZIP_SIZE! bytes >> "%LOG_FILE%" + ) + + :: Verifier que tar existe (Windows 10 1803+) + where tar >nul 2>&1 + if !ERRORLEVEL! NEQ 0 ( + echo. + echo %ESC%%RED% ERROR: tar command not available!%ESC%%RESET% + echo. + echo Please update Windows 10 or extract manually to: + echo %ESC%%CYAN%%PYTHON_DIR%%ESC%%RESET% + echo. + echo [%DATE% %TIME%] ERROR: tar command not found >> "%LOG_FILE%" + goto :error + ) + + :: Extraction avec progression simulee + echo %ESC%%YELLOW%^> Extracting Python...%ESC%%RESET% + echo [%DATE% %TIME%] Extracting python.zip >> "%LOG_FILE%" + + > "%LOG_FILE%" + goto :error + ) + + echo [%DATE% %TIME%] Extraction completed >> "%LOG_FILE%" + + :: Supprimer ZIP + del /q "%ZIP_FILE%" 2>nul + echo %ESC%%GREEN%^> python.zip cleaned up%ESC%%RESET% + echo [%DATE% %TIME%] python.zip deleted >> "%LOG_FILE%" + + :: Verifier installation + if not exist "%PYTHON_EXE%" ( + echo. + echo %ESC%%RED% ERROR: Python not found after extraction!%ESC%%RESET% + echo [%DATE% %TIME%] ERROR: python.exe not found after extraction >> "%LOG_FILE%" + goto :error + ) +) + +:: Afficher et logger la version Python +for /f "tokens=*" %%v in ('"%PYTHON_EXE%" --version 2^>^&1') do set "PYTHON_VERSION=%%v" +echo %ESC%%GREEN%^> %PYTHON_VERSION% found%ESC%%RESET% +echo [%DATE% %TIME%] %PYTHON_VERSION% detected >> "%LOG_FILE%" + +:: ============================================================================= +:: Verification script principal +:: ============================================================================= +echo %ESC%%YELLOW%[2/3]%ESC%%RESET% Checking RGSX application... +echo [%DATE% %TIME%] Step 2/3: Checking RGSX files >> "%LOG_FILE%" + +if not exist "%MAIN_SCRIPT%" ( + echo. + echo %ESC%%RED% ERROR: __main__.py not found!%ESC%%RESET% + echo. + echo Expected location: + echo %ESC%%CYAN%%MAIN_SCRIPT%%ESC%%RESET% + echo. + echo [%DATE% %TIME%] ERROR: __main__.py not found at %MAIN_SCRIPT% >> "%LOG_FILE%" + goto :error +) + +echo %ESC%%GREEN%^> RGSX files OK%ESC%%RESET% +echo [%DATE% %TIME%] RGSX files verified >> "%LOG_FILE%" + +:: ============================================================================= +:: Lancement +:: ============================================================================= +echo %ESC%%YELLOW%[3/3]%ESC%%RESET% Launching RGSX... +echo [%DATE% %TIME%] Step 3/3: Launching application >> "%LOG_FILE%" + +:: Changer le repertoire de travail +cd /d "%ROOT_DIR%\roms\ports\RGSX" +echo [%DATE% %TIME%] Working directory: %CD% >> "%LOG_FILE%" + +:: Configuration SDL/Pygame +set PYGAME_HIDE_SUPPORT_PROMPT=1 +set SDL_VIDEODRIVER=windows +set SDL_AUDIODRIVER=directsound +set PYTHONWARNINGS=ignore::UserWarning:pygame.pkgdata + +:: ============================================================================= +:: Configuration multi-ecran +:: ============================================================================= +:: SDL_VIDEO_FULLSCREEN_HEAD: Selectionne l'ecran pour le mode plein ecran +:: 0 = ecran principal, 1 = ecran secondaire, etc. +:: Ces variables ne sont definies que si --display=N ou --windowed est passe +:: Sinon, le script Python utilisera les parametres de rgsx_settings.json + +echo [%DATE% %TIME%] Display configuration: >> "%LOG_FILE%" +if defined DISPLAY_NUM ( + set SDL_VIDEO_FULLSCREEN_HEAD=!DISPLAY_NUM! + set RGSX_DISPLAY=!DISPLAY_NUM! + echo [%DATE% %TIME%] SDL_VIDEO_FULLSCREEN_HEAD=!DISPLAY_NUM! ^(from --display arg^) >> "%LOG_FILE%" + echo [%DATE% %TIME%] RGSX_DISPLAY=!DISPLAY_NUM! ^(from --display arg^) >> "%LOG_FILE%" +) else ( + echo [%DATE% %TIME%] Display: using rgsx_settings.json config >> "%LOG_FILE%" +) +if defined WINDOWED_MODE ( + set RGSX_WINDOWED=!WINDOWED_MODE! + echo [%DATE% %TIME%] RGSX_WINDOWED=!WINDOWED_MODE! ^(from --windowed arg^) >> "%LOG_FILE%" +) else ( + echo [%DATE% %TIME%] Windowed: using rgsx_settings.json config >> "%LOG_FILE%" +) + +:: Log environnement +echo [%DATE% %TIME%] Environment variables set: >> "%LOG_FILE%" +echo [%DATE% %TIME%] RGSX_ROOT=%RGSX_ROOT% >> "%LOG_FILE%" +echo [%DATE% %TIME%] SDL_VIDEODRIVER=%SDL_VIDEODRIVER% >> "%LOG_FILE%" +echo [%DATE% %TIME%] SDL_AUDIODRIVER=%SDL_AUDIODRIVER% >> "%LOG_FILE%" + +echo. +if defined DISPLAY_NUM ( + echo %ESC%%CYAN%Launching on display !DISPLAY_NUM!...%ESC%%RESET% +) +if defined WINDOWED_MODE ( + echo %ESC%%CYAN%Windowed mode enabled%ESC%%RESET% +) +echo %ESC%%CYAN%Starting RGSX application...%ESC%%RESET% +echo %ESC%%BOLD%Press Ctrl+C to force quit if needed%ESC%%RESET% +echo. +echo [%DATE% %TIME%] Executing: "%PYTHON_EXE%" "%MAIN_SCRIPT%" >> "%LOG_FILE%" +echo [%DATE% %TIME%] --- Application output start --- >> "%LOG_FILE%" + +"%PYTHON_EXE%" "%MAIN_SCRIPT%" >> "%LOG_FILE%" 2>&1 +set EXITCODE=!ERRORLEVEL! + +echo [%DATE% %TIME%] --- Application output end --- >> "%LOG_FILE%" +echo [%DATE% %TIME%] Exit code: !EXITCODE! >> "%LOG_FILE%" + +if "!EXITCODE!"=="0" ( + echo. + echo %ESC%%GREEN%RGSX closed successfully.%ESC%%RESET% + echo. + echo [%DATE% %TIME%] Application closed successfully >> "%LOG_FILE%" +) else ( + echo. + echo %ESC%%RED%RGSX exited with error code !EXITCODE!%ESC%%RESET% + echo. + echo [%DATE% %TIME%] ERROR: Application exited with code !EXITCODE! >> "%LOG_FILE%" + goto :error +) + +:end +echo [%DATE% %TIME%] ========================================== >> "%LOG_FILE%" +echo [%DATE% %TIME%] Session ended normally >> "%LOG_FILE%" +echo [%DATE% %TIME%] ========================================== >> "%LOG_FILE%" +timeout /t 2 >nul +exit /b 0 + +:error +echo. +echo %ESC%%RED%An error occurred. Check the log file:%ESC%%RESET% +echo %ESC%%CYAN%%LOG_FILE%%ESC%%RESET% +echo. +echo [%DATE% %TIME%] ========================================== >> "%LOG_FILE%" +echo [%DATE% %TIME%] Session ended with errors >> "%LOG_FILE%" +echo [%DATE% %TIME%] ========================================== >> "%LOG_FILE%" +echo. +echo Press any key to close... +pause >nul +exit /b 1 \ No newline at end of file diff --git a/commandos/Remove-Path.ps1 b/commandos/Remove-Path.ps1 new file mode 100644 index 0000000000000000000000000000000000000000..d1505fbf6995bec39dda53db5d39eb68797d7a0c --- /dev/null +++ b/commandos/Remove-Path.ps1 @@ -0,0 +1,64 @@ +<# +.SYNOPSIS + Remove um ou mais caminhos do PATH do utilizador de forma persistente e segura. + Garante a integridade do PATH sem os limites do comando 'setx'. + +.EXAMPLE + .\Remove-Path.ps1 "C:\Caminho\Para\Remover" +#> + +param ( + [Parameter(Mandatory=$true, HelpMessage="Caminho a remover do PATH")] + [string[]]$PathsToRemove +) + +# 1) Obter o PATH atual do registo (User level) +$currentPath = [Environment]::GetEnvironmentVariable("PATH", "User") +if (-not $currentPath) { + Write-Error "Não foi possível obter o PATH do utilizador ou o PATH está vazio." + exit +} + +$pathList = $currentPath -split ";" | Where-Object { $_ -ne "" } +$originalCount = $pathList.Count +$newPathList = @() + +# Criar lista de caminhos a remover limpos +$cleanRemovals = $PathsToRemove | ForEach-Object { $_.Trim().Trim('"').TrimEnd('\') } + +foreach ($p in $pathList) { + $cleanP = $p.Trim().TrimEnd('\') + + # Se o caminho atual não estiver na lista de remoção, mantém-se + $match = $false + foreach ($rem in $cleanRemovals) { + if ($cleanP -ieq $rem) { + $match = $true + break + } + } + + if (-not $match) { + $newPathList += $p + } else { + Write-Host "🗑️ A remover: $p" -ForegroundColor Yellow + } +} + +$removedCount = $originalCount - $newPathList.Count + +if ($removedCount -gt 0) { + # Juntar novamente + $updatedPath = $newPathList -join ";" + + # Gravar permanentemente no Registo (User) + [Environment]::SetEnvironmentVariable("PATH", $updatedPath, "User") + + # Atualizar a sessão atual + $env:PATH = [Environment]::GetEnvironmentVariable("PATH", "Machine") + ";" + $updatedPath + + Write-Host "`n✨ Sucesso! $removedCount caminho(s) removido(s) do PATH permanentemente." -ForegroundColor Green + Write-Host "📢 Nota: Novas consolas refletirão a mudança. A sessão atual foi atualizada." +} else { + Write-Host "`nNada a remover. Os caminhos indicados não foram encontrados no PATH do utilizador." -ForegroundColor Gray +} diff --git a/commandos/TESTE_WINDOWS_FINAL.bat b/commandos/TESTE_WINDOWS_FINAL.bat new file mode 100644 index 0000000000000000000000000000000000000000..3cdb854789938dfb6c368fff042e0ea5749c7377 --- /dev/null +++ b/commandos/TESTE_WINDOWS_FINAL.bat @@ -0,0 +1,26 @@ +@echo off +echo 🚀 TESTE FINAL - Sistema ML/AI==== + Windows +echo =================================echo. + +echo 🧪 Testando sistema completo... +echo. + +python TESTE_RAPIDO_FINAL.py + +echo. +echo ====================================== +echo 🎯 RESULTADO ESPERADO: +echo ✅ NumPy: OK +echo ✅ Pandas: OK +echo ✅ Matplotlib: OK +echo ✅ Scikit-Learn: OK +echo ✅ Seaborn: OK +echo ✅ PyTorch: v2.4.1+cu121 (CUDA: True) +echo ✅ TensorFlow: vunknown +echo ✅ GPU: 2 GPUs detectadas +echo. +echo 🎉 SE VIR "SISTEMA 100% FUNCIONAL" = SUCESSO COMPLETO! +echo ====================================== + +pause \ No newline at end of file diff --git a/commandos/VERIFICAR_CUDNN.bat b/commandos/VERIFICAR_CUDNN.bat new file mode 100644 index 0000000000000000000000000000000000000000..fd605e3f4d56b3528eb04c12ab3eeb4a2884f8b4 --- /dev/null +++ b/commandos/VERIFICAR_CUDNN.bat @@ -0,0 +1,15 @@ +@echo off +echo 🔍 VERIFICANDO CUDNN INSTALADO +echo ============================== + +python -c "import torch; print(f'✅ PyTorch: {torch.__version__}'); print(f'✅ cuDNN habilitado: {torch.backends.cudnn.enabled}'); print(f'✅ CUDA disponível: {torch.cuda.is_available()}')" + +if %ERRORLEVEL% == 0 ( + echo. + echo 🎉 CUDNN FUNCIONANDO PERFEITAMENTE! +) else ( + echo. + echo ❌ Problema na instalação +) + +pause \ No newline at end of file diff --git a/commandos/abrir-clawdbot.bat b/commandos/abrir-clawdbot.bat new file mode 100644 index 0000000000000000000000000000000000000000..84c93f61ace4a08c9a12fa0de0a2fa336d55512d --- /dev/null +++ b/commandos/abrir-clawdbot.bat @@ -0,0 +1 @@ +start http://127.0.0.1:18789/ diff --git a/commandos/abrir_npm.bat b/commandos/abrir_npm.bat new file mode 100644 index 0000000000000000000000000000000000000000..508ae83db8146eadee77308c9a4f8a3664e1f364 --- /dev/null +++ b/commandos/abrir_npm.bat @@ -0,0 +1,2 @@ +@echo off +start cmd /k "npm -v" diff --git a/commandos/activate.bat b/commandos/activate.bat new file mode 100644 index 0000000000000000000000000000000000000000..9594271059dfa27c800c62277aa5771718727f17 --- /dev/null +++ b/commandos/activate.bat @@ -0,0 +1,34 @@ +@echo off + +rem This file is UTF-8 encoded, so we need to update the current code page while executing it +for /f "tokens=2 delims=:." %%a in ('"%SystemRoot%\System32\chcp.com"') do ( + set _OLD_CODEPAGE=%%a +) +if defined _OLD_CODEPAGE ( + "%SystemRoot%\System32\chcp.com" 65001 > nul +) + +set "VIRTUAL_ENV=C:\Users\luisf\Desktop\sete\dj-env" + +if not defined PROMPT set PROMPT=$P$G + +if defined _OLD_VIRTUAL_PROMPT set PROMPT=%_OLD_VIRTUAL_PROMPT% +if defined _OLD_VIRTUAL_PYTHONHOME set PYTHONHOME=%_OLD_VIRTUAL_PYTHONHOME% + +set _OLD_VIRTUAL_PROMPT=%PROMPT% +set PROMPT=(dj-env) %PROMPT% + +if defined PYTHONHOME set _OLD_VIRTUAL_PYTHONHOME=%PYTHONHOME% +set PYTHONHOME= + +if defined _OLD_VIRTUAL_PATH set PATH=%_OLD_VIRTUAL_PATH% +if not defined _OLD_VIRTUAL_PATH set _OLD_VIRTUAL_PATH=%PATH% + +set "PATH=%VIRTUAL_ENV%\Scripts;%PATH%" +set "VIRTUAL_ENV_PROMPT=(dj-env) " + +:END +if defined _OLD_CODEPAGE ( + "%SystemRoot%\System32\chcp.com" %_OLD_CODEPAGE% > nul + set _OLD_CODEPAGE= +) diff --git a/commandos/actualiza.bat b/commandos/actualiza.bat new file mode 100644 index 0000000000000000000000000000000000000000..dc73dee53674bde46ba56f7f3c83d6f444c85bf7 --- /dev/null +++ b/commandos/actualiza.bat @@ -0,0 +1,17 @@ +@echo off +set REPO=%1 +set PYTHON_PATH=D:\ComfyUI_cu128_50XX\python_embeded\python.exe + +:: Verifica se o script está sendo executado como administrador +openfiles >nul 2>&1 +if %errorlevel% NEQ 0 ( + echo Por favor, execute este script como administrador. + pause + exit /b +) + +:: Desinstala e exclui o arquivo manualmente +%PYTHON_PATH% -m pip uninstall -y opencv-python +del /F /Q "C:\Users\luisf\AppData\Roaming\Python\Python312\site-packages\cv2\cv2.pyd" +%PYTHON_PATH% -m pip install --user --force-reinstall -r %REPO% +pause diff --git a/commandos/actualiza1.bat b/commandos/actualiza1.bat new file mode 100644 index 0000000000000000000000000000000000000000..68d6bcc40b4d47526095daa55ae73a8857a3f859 --- /dev/null +++ b/commandos/actualiza1.bat @@ -0,0 +1,25 @@ +@echo off +set REPO=%1 +set PYTHON_PATH=D:\ComfyUI_cu128_50XX\python_embeded\python.exe + +:: Verifica se o script está sendo executado como administrador +openfiles >nul 2>&1 +if %errorlevel% NEQ 0 ( + echo Por favor, execute este script como administrador. + pause + exit /b +) + +:: Desinstalar pacotes conflitantes +%PYTHON_PATH% -m pip uninstall -y numpy pillow setuptools markupsafe urllib3 torch + +:: Instalar versões compatíveis dos pacotes +%PYTHON_PATH% -m pip install numpy==1.26.4 Pillow==10.2.0 setuptools==75.2.0 markupsafe==2.0.1 urllib3==1.26.16 torch==1.11.0+cpu + +:: Instalar dependências do repositório +%PYTHON_PATH% -m pip install --user --force-reinstall -r %REPO% + +:: Verificar instalação das dependências +%PYTHON_PATH% -m pip check + +pause diff --git a/commandos/aliases.bat b/commandos/aliases.bat new file mode 100644 index 0000000000000000000000000000000000000000..614e0392a9d22af0fdefa5f8a1c1fedafa4ea9f4 --- /dev/null +++ b/commandos/aliases.bat @@ -0,0 +1,57 @@ +;= @echo off +;= rem Call DOSKEY and use this file as the macrofile +;= %SystemRoot%\system32\doskey /listsize=1000 /macrofile=%0% +;= rem In batch mode, jump to the end of the file +;= goto :end +;= rem ****************************************************************** +;= rem * Filename: aliases.bat +;= rem * Source: http://ben.versionzero.org/wiki/Doskey_Macros +;= rem * Version: 1.0 +;= rem * Author: Ben Burnett +;= rem * Purpose: Simple, but useful aliases; this can be done by +;= rem * other means--of course--but this is dead simple and +;= rem * works on EVERY Windows machine on the planet. +;= rem * History: +;= rem * 22/01/2002: File Created (Syncrude Canada). +;= rem * 01/05/2007: Updated author's address, added new macros, a +;= rem * history and some new helpful comments. +;= rem * 19/06/2007: Added Notepad, Explorer and Emacs macros. +;= rem * 20/06/2007: Fixed doskey macrofile= path problem: it is now not +;= rem * a relative path, so it can be called from anywhere. +;= rem ****************************************************************** + +;= Doskey aliases +h=doskey /history + +;= File listing enhancements +:=ls=dir /x $* +l=dir /x $* +ll=dir /w $* +la=dir /x /a $* + +;= Directory navigation +up=cd .. +pd=pushd + +;= Copy and move macros +;=cp=copy +:=mv=move + +;= Delete macros +;=rm=del /p $* +rmf=del /q $* +rmtmp=del /q *~ *# 2>nul + +;= Fast access to Notepad +n=notepad $* + +;= Fast access to Explorer +x=explorer . + +;= :end +;= rem ****************************************************************** +;= rem * EOF - Don't remove the following line. It clears out the ';' +;= rem * macro. We're using it because there is no support for comments +;= rem * in a DOSKEY macro file. +;= rem ****************************************************************** +;= diff --git a/commandos/arrancar-clawdbot.bat b/commandos/arrancar-clawdbot.bat new file mode 100644 index 0000000000000000000000000000000000000000..fd8a9730b1ab249a6445b6ac5a098c50fca308e6 --- /dev/null +++ b/commandos/arrancar-clawdbot.bat @@ -0,0 +1,7 @@ +@echo off +title OpenClaw Launcher + +echo A iniciar OpenClaw Gateway TUI... +start "" /D "C:\Users\luisf\clawd" cmd /k "openclaw gateway tui" + +exit diff --git a/commandos/arrancar-openclaw.bat b/commandos/arrancar-openclaw.bat new file mode 100644 index 0000000000000000000000000000000000000000..e1897751d51d8f96818b34a3e604a15907b97243 --- /dev/null +++ b/commandos/arrancar-openclaw.bat @@ -0,0 +1,5 @@ +@echo off +set NODE_OPTIONS=--stack-size=10000 +echo A iniciar o OpenClaw Gateway com limite de pilha aumentado... +openclaw gateway start +pause \ No newline at end of file diff --git a/commandos/ativa_comfy310.ps1 b/commandos/ativa_comfy310.ps1 new file mode 100644 index 0000000000000000000000000000000000000000..7fad8451a9faf1774a91e6e4c5b9d19762dc8887 --- /dev/null +++ b/commandos/ativa_comfy310.ps1 @@ -0,0 +1 @@ +conda activate comfy310 diff --git a/commandos/bash.ps1 b/commandos/bash.ps1 new file mode 100644 index 0000000000000000000000000000000000000000..12362463190056bbdad2125adc57b1425678bc88 --- /dev/null +++ b/commandos/bash.ps1 @@ -0,0 +1,8 @@ +# Caminho para o executável do Git Bash +$gitBash = "C:\Program Files\Git\bin\bash.exe" + +# Diretório onde o comando foi executado +$cwd = (Get-Location).Path + +# Abre o Git Bash nesse diretório +Start-Process -FilePath $gitBash -WorkingDirectory $cwd diff --git a/commandos/build.bat b/commandos/build.bat new file mode 100644 index 0000000000000000000000000000000000000000..777f8631702471bbc56939669e25e1eb20c39adc --- /dev/null +++ b/commandos/build.bat @@ -0,0 +1,8 @@ +@echo off +if exist MiSTer.card.o del MiSTer.card.o +vasmm68k_mot -quiet -Iinclude -Fhunk -phxass -opt-fconst -nowarn=62 MiSTer.card.asm +vc MiSTer.card.o -nostdlib -o MiSTer.card +echo Done. + +rem pause 2 seconds +ping 127.0.0.1 -n 2 >nul diff --git a/commandos/build_tool.ps1 b/commandos/build_tool.ps1 new file mode 100644 index 0000000000000000000000000000000000000000..c297856d00e1f297be10d4094223297096046a0a --- /dev/null +++ b/commandos/build_tool.ps1 @@ -0,0 +1,930 @@ +<# +.SYNOPSIS + build_tool - Compilador modular para múltiplas linguagens. + +.DESCRIPTION + Detecta automaticamente o tipo de projeto e compila usando o comando + adequado. Suporta: Rust, Python, C, C++, Go, JavaScript/Node, TypeScript, Java. +#> + +$BuildToolVersion = "1.0.0" + +# ============================================================================ +# FUNÇÕES AUXILIARES +# ============================================================================ + +Function Global:Detect-Language { + <# + .DESCRIPTION + Detecta automaticamente a linguagem do projeto analisando arquivos de configuração. + #> + Param( + [string]$Path + ) + + # Verificar arquivos de configuração comuns + $configFiles = @( + "Cargo.toml", + "package.json", + "pkg.json", + "setup.py", + "pyproject.toml", + "CMakeLists.txt", + "CMakeLists", + "Makefile", + "Gopkg.toml", + "go.mod", + "build.gradle", + "build.gradle.kts", + "pom.xml", + "build.pom.xml", + ".csproj", + ".vbproj", + ".fsproj", + ".psm1", + "Rakefile", + "Gemfile" + ) + + foreach ($cfg in $configFiles) { + $cfgPath = Join-Path $Path $cfg + if (Test-Path $cfgPath) { + # Determinar linguagem baseado no arquivo + switch ($cfg) { + "Cargo.toml" { return "Rust" } + "setup.py" { return "Python" } + "pyproject.toml" { return "Python" } + "Gopkg.toml" { return "Rust" } + "go.mod" { return "Go" } + "build.gradle" { return "Java" } + "build.gradle.kts" { return "Java" } + "pom.xml" { return "Java" } + "build.pom.xml" { return "Java" } + "build.gradle.kts" { return "Java" } + ".vbproj" { return "VB.NET" } + ".csproj" { return "C#" } + ".fsproj" { return "F#" } + ".psm1" { return "PowerShell" } + default { return "C" } + } + } + } + + # Fallback: tentar detectar pelo conteúdo de arquivos fonte + $sourcePatterns = @{ + "*.rs" = "Rust" + "*.py" = "Python" + "*.c" = "C" + "*.cpp" = "C++" + "*.h" = "C++" + "*.go" = "Go" + "*.java" = "Java" + "*.ts" = "TypeScript" + "*.tsx" = "TypeScript" + "*.js" = "JavaScript" + "*.cs" = "C#" + "*.vb" = "VB.NET" + "*.fs" = "F#" + } + + foreach ($pair in $sourcePatterns.GetEnumerator()) { + $pattern = $pair.Key + $lang = $pair.Value + $files = Get-ChildItem -Path $Path -Include $pattern -Recurse -ErrorAction SilentlyContinue | Select-Object -First 1 + if ($files) { + return $lang + } + } + + return "Unknown" +} + +Function Global:Get-Compiler { + <# + .DESCRIPTION + Retorna o comando e argumentos do compilador adequado para cada linguagem. + #> + Param( + [string]$Language, + [string]$SourceFile, + [string]$OutputFile + ) + + $compilers = @{ + "Rust" = @{ + Command = "cargo" + Args = "build" + Source = "Cargo.toml" + Output = "target/debug/" + Executable = "debug/" + } + "Python" = @{ + Command = "pip" + Args = "install -e ." + Source = "setup.py" + Output = "dist/" + Executable = "app.exe" + } + "JavaScript" = @{ + Command = "npm" + Args = "run build" + Source = "package.json" + Output = "dist/" + Executable = "dist/.js" + } + "TypeScript" = @{ + Command = "npm" + Args = "run build" + Source = "package.json" + Output = "dist/" + Executable = "dist/.js" + } + "C" = @{ + Command = "gcc" + Args = "-o $OutputFile $SourceFile" + Output = "output.exe" + } + "C++" = @{ + Command = "g++" + Args = "-o $OutputFile $SourceFile" + Output = "output.exe" + } + "Go" = @{ + Command = "go" + Args = "build -o $OutputFile ./" + Output = "output.exe" + } + "Java" = @{ + Command = "mvn" + Args = "package" + Source = "pom.xml" + Output = "target/" + Executable = "target/-jar-dependencies.jar" + } + "VB.NET" = @{ + Command = "dotnet" + Args = "build" + Source = ".vbproj" + Output = "bin/" + Executable = "bin/.dll" + } + "C#" = @{ + Command = "dotnet" + Args = "build" + Source = ".csproj" + Output = "bin/" + Executable = "bin/.dll" + } + "F#" = @{ + Command = "dotnet" + Args = "build" + Source = ".fsproj" + Output = "bin/" + Executable = "bin/.dll" + } + "PowerShell" = @{ + Command = "pwsh" + Args = "-NoProfile -ExecutionPolicy Bypass" + Source = "*.ps1" + Output = "bin/" + Executable = "bin/.ps1" + } + "Ruby" = @{ + Command = "bundle" + Args = "exec rake" + Source = "Rakefile" + Output = "bin/" + Executable = "bin/" + } + } + + if ($compilers.ContainsKey($Language)) { + $comp = $compilers[$Language] + return $comp + } + + return @{ Command="unknown"; Args="" } +} + +Function Global:Check-Compiler-Available { + <# + .DESCRIPTION + Verifica se um compilador/interpreter está disponível no sistema. + #> + Param( + [string]$Compiler + ) + + try { + $version = & $Compiler --version 2>&1 + return $LASTEXITCODE -eq 0 + } catch { + return $false + } +} + +Function Global:Find-Compiler { + <# + .DESCRIPTION + Tenta encontrar o compilador em diferentes locais. + #> + Param( + [string]$Compiler + ) + + # Tentar sem caminho primeiro + if (Test-Path $Compiler) { + return $Compiler + } + + # Tentar em PATH + try { + $compilerInPath = $null + if ($Compiler -eq "python" -or $Compiler -eq "python3") { + # Python pode estar em múltiplos locais + foreach ($pyPath in @("python", "python3", "C:\Python*Python.exe", "C:\Python*python.exe")) { + if (Test-Path $pyPath) { return $pyPath } + } + } elseif ($Compiler -eq "npm" -or $Compiler -eq "node") { + foreach ($nodePath in @("node", "C:\Program Files\nodejs\node.exe", "C:\npm\node.exe")) { + if (Test-Path $nodePath) { return $nodePath } + } + } elseif ($Compiler -eq "cargo" -or $Compiler -eq "rustc") { + foreach ($rustPath in @("cargo", "rustc", "C:\Program Files\rga\cargo.exe", "C:\Program Files\rga\rustc.exe", "$env:LOCALAPPDATA\Programs\rust", "C:\msys64\mingw64\bin", "C:\msys64\usr\bin")) { + if (Test-Path $rustPath) { return $rustPath } + } + } elseif ($Compiler -eq "gcc" -or $Compiler -eq "g++" -or $Compiler -eq "clang") { + foreach ($gccPath in @("gcc", "g++", "clang", "clang++", "C:\Program Files\LLVM\bin", "C:\MinGW\bin", "$env:PATH")) { + try { + if (Test-Path $gccPath) { return $gccPath } + } catch {} + } + } elseif ($Compiler -eq "go") { + foreach ($goPath in @("go", "C:\Program Files\go\go.exe", "$env:GOROOT\bin\go.exe")) { + if (Test-Path $goPath) { return $goPath } + } + } elseif ($Compiler -eq "mvn") { + foreach ($mvnPath in @("mvn", "C:\Program Files\Apache Maven\bin\mvn.cmd", "C:\Program Files\Apache Maven3\bin\mvn.cmd")) { + if (Test-Path $mvnPath) { return $mvnPath } + } + } elseif ($Compiler -eq "dotnet") { + if (Test-Path "dotnet") { return "dotnet" } + } + } catch {} + + return $null +} + +Function Global:Parse-Project-Config { + <# + .DESCRIPTION + Extrai informações de configuração de projeto. + #> + Param( + [string]$Path, + [string]$ConfigFile + ) + + $configPath = Join-Path $Path $ConfigFile + + if (-not (Test-Path $configPath)) { + return $null + } + + try { + # Tentar JSON primeiro + $config = Get-Content $configPath -ErrorAction SilentlyContinue | ConvertFrom-Json + + return @{ + Name = $config.name + Version = $config.version + Output = $config.output + MainFile = $config.main || $config.entry + Source = $config.source || $config.src + Dependencies = $config.dependencies + Scripts = $config.scripts + } + } catch { + # Tentar XML para projetos .NET + if ($configPath -like "*.xml") { + return @{ + Name = $config.productname + Version = $config.version + } + } + + return $null + } +} + +Function Global:Format-Build-Result { + <# + .DESCRIPTION + Cria um objeto de resultado estruturado para build. + #> + Param( + [Parameter(Mandatory=$true)] + [string]$Status, # success, fail, partial + + [Parameter(Mandatory=$true)] + [string]$Command, + + [Parameter(Mandatory=$true)] + [double]$Duration, + + [string]$OutputPath = $null, + + [string]$Errors = $null, + + [string]$Warnings = $null + ) + + $result = [PSCustomObject] @{ + Status = $Status + Command = $Command + Duration = $Duration + OutputPath = $OutputPath + Errors = $Errors + Warnings = $Warnings + Timestamp = Get-Date -Format "yyyy-MM-ddTHH:mm:ssZ" + Language = "unknown" + Mode = "compile" + } + + return $result +} + +# ============================================================================ +# FUNÇÃO PRINCIPAL +# ============================================================================ + +Function Global:Build-Project { + <# + .SYNOPSIS + Compila um projeto detectando automaticamente a linguagem. + + .DESCRIPTION + Detecta o tipo de projeto, verifica ferramentas necessárias, + executa compilação e retorna resultado estruturado. + + .PARAMETER Path + Caminho para o diretório do projeto a compilar. + + .PARAMETER Output + Caminho de saída do executável ou bundle gerado. + + .PARAMETER Mode + Modo de operação: + - compile: compila padrão + - bundle: cria executável bundlado + - lint: executa análise estática + - clean: limpa diretórios de build + - test: executa testes + + .PARAMETER Quiet + Modo silencioso - minimiza output durante o build. + + .PARAMETER Verbose + Mostra mais detalhes durante o processo de compilação. + + .EXAMPLE + Build-Project -Path "C:\myproject" + + .EXAMPLE + Build-Project -Path "C:\rustproject" -Mode "bundle" -Output "dist\app.exe" + #> + [CmdletBinding()] + Param( + [Parameter(Mandatory=$true)] + [string]$Path, + + [string]$Output, + + [string]$Mode = "compile", + + [switch]$Quiet, + + [switch]$Verbose + ) + + $startTime = Get-Date + $results = [PSCustomObject]@{ + Status = "fail" + Command = "unknown" + Duration = 0 + OutputPath = $null + Errors = $null + Warnings = $null + Language = "unknown" + Mode = $Mode + Timestamp = (Get-Date).ToString('yyyy-MM-ddTHH:mm:ssZ') + } + + begin { + if ($Verbose) { + Write-Host "`n=== BUILD TOOL $BuildToolVersion ===" -ForegroundColor Cyan + Write-Host "Project Path: $Path" -ForegroundColor Yellow + Write-Host "Mode: $Mode" -ForegroundColor Yellow + } + } + + process { + # Validar caminho + if (-not (Test-Path $Path)) { + if ($Quiet) { + $results.Status = "fail" + $results.Errors = "Project path does not exist: $Path" + return $results + } + Write-Host "❌ Error: Project path does not exist: $Path" -ForegroundColor Red + return $results + } + + # Detectar linguagem + $language = Detect-Language -Path $Path + $results.Language = $language + + if ($language -eq "Unknown") { + if (-not $Quiet) { + Write-Host "❌ Error: Could not detect project language. Supported: Rust, Python, C, C++, Go, JavaScript, TypeScript, Java, Ruby, VB.NET, C#, F#, PowerShell" -ForegroundColor Red + } + $results.Errors = "Could not detect project language. Supported: Rust, Python, C, C++, Go, JavaScript, TypeScript, Java, Ruby, VB.NET, C#, F#, PowerShell" + return $results + } + + if (-not $Quiet) { + Write-Host "✅ Detected project language: $language" -ForegroundColor Green + } + + # Encontrar arquivo de configuração principal + $configFile = $null + $config = $null + + switch ($language) { + "Rust" { $configFile = "Cargo.toml" } + "Python" { $configFile = "setup.py"; $altConfig = "pyproject.toml" } + "JavaScript" { $configFile = "package.json" } + "TypeScript" { $configFile = "package.json" } + "C" { $configFile = "Makefile" } + "C++" { $configFile = "CMakeLists.txt" } + "Go" { $configFile = "go.mod" } + "Java" { $configFile = "pom.xml"; $altConfig = "build.gradle" } + "Ruby" { $configFile = "Rakefile" } + "VB.NET" { $configFile = ".vbproj" } + "C#" { $configFile = ".csproj" } + "F#" { $configFile = ".fsproj" } + "PowerShell" { $configFile = "*.psm1" } + } + + # Verificar arquivo de configuração + $fullConfigPath = Join-Path $Path $configFile + if (-not (Test-Path $fullConfigPath)) { + if (-not $Quiet) { + Write-Host "⚠️ Warning: Config file not found: $configFile" -ForegroundColor Yellow + } + } else { + $config = Parse-Project-Config -Path $Path -ConfigFile $configFile + } + + # Modo clean + if ($Mode -eq "clean") { + if (-not $Quiet) { + Write-Host "🧹 Cleaning build artifacts..." -ForegroundColor Cyan + } + + # Identificar diretórios de build + $buildDirs = @( + "target", # Rust, .NET + "build", # C/C++ + "dist", # JavaScript + "bin", # .NET + "__pycache__", # Python + ".pytest_cache", # Python tests + ".tox", # Python + "node_modules" # NPM + ) + + foreach ($dir in $buildDirs) { + $dirPath = Join-Path $Path $dir + if (Test-Path $dirPath) { + if ($Quiet) { + $null = Remove-Item -Path $dirPath -Recurse -Force -ErrorAction SilentlyContinue + continue + } + Write-Host " Removing: $dirPath" -ForegroundColor Gray + $null = Remove-Item -Path $dirPath -Recurse -Force -ErrorAction SilentlyContinue + } + } + + $results.Status = "success" + $results.Command = "clean" + $results.Duration = (Get-Date).Subtract($startTime).TotalSeconds + if ($Quiet) { + return $results + } + Write-Host "✅ Build artifacts cleaned." -ForegroundColor Green + return $results + } + + # Modo lint + if ($Mode -eq "lint") { + if ($Quiet) { + $results.Status = "partial" + $results.Command = "lint" + $results.OutputPath = Join-Path $Path ".lint_report" + return $results + } + Write-Host "📝 Running linting checks..." -ForegroundColor Cyan + + switch ($language) { + "JavaScript" { + if (Test-Path (Join-Path $Path "package.json")) { + try { + $null = Invoke-Expression "npm run lint 2>&1" 2>&1 + $exitCode = $LASTEXITCODE + if ($exitCode -eq 0) { + $results.Status = "success" + } else { + $results.Status = "partial" + } + } catch { + $results.Status = "partial" + } + } + } + "Python" { + if (Test-Path (Join-Path $Path "setup.py")) { + try { + $null = Invoke-Expression "python -m py_compile ." 2>&1 + $exitCode = $LASTEXITCODE + if ($exitCode -eq 0) { + $results.Status = "success" + } else { + $results.Status = "partial" + } + } catch { + $results.Status = "partial" + } + } + } + "Rust" { + try { + $null = Invoke-Expression "cargo check 2>&1" 2>&1 + $exitCode = $LASTEXITCODE + if ($exitCode -eq 0) { + $results.Status = "success" + } else { + $results.Status = "partial" + } + } catch { + $results.Status = "partial" + } + } + "Go" { + try { + $null = Invoke-Expression "go vet ./... 2>&1" 2>&1 + $exitCode = $LASTEXITCODE + if ($exitCode -eq 0) { + $results.Status = "success" + } else { + $results.Status = "partial" + } + } catch { + $results.Status = "partial" + } + } + "Java" { + try { + $null = Invoke-Expression "mvn checkstyle:check 2>&1" 2>&1 + $exitCode = $LASTEXITCODE + if ($exitCode -eq 0) { + $results.Status = "success" + } else { + $results.Status = "partial" + } + } catch { + $results.Status = "partial" + } + } + "C" | "C++" { + try { + $null = Invoke-Expression "clang-format --diff . 2>&1" 2>&1 + $exitCode = $LASTEXITCODE + if ($exitCode -eq 0) { + $results.Status = "success" + } else { + $results.Status = "partial" + } + } catch { + $results.Status = "partial" + } + } + } + + $results.Command = "lint" + $results.Duration = (Get-Date).Subtract($startTime).TotalSeconds + if ($Quiet) { + return $results + } + Write-Host "✅ Linting complete. Status: $($results.Status)" -ForegroundColor Gray + return $results + } + + # Modo test + if ($Mode -eq "test") { + if ($Quiet) { + $results.Status = "partial" + $results.Command = "test" + $results.OutputPath = Join-Path $Path ".test_results" + return $results + } + Write-Host "🧪 Running tests..." -ForegroundColor Cyan + + switch ($language) { + "Rust" { + try { + $null = Invoke-Expression "cargo test --no-fail-fast 2>&1" 2>&1 + $exitCode = $LASTEXITCODE + } catch { $exitCode = $LASTEXITCODE } + } + "Python" { + try { + $null = Invoke-Expression "python -m unittest discover -s . 2>&1" 2>&1 + $exitCode = $LASTEXITCODE + } catch { $exitCode = $LASTEXITCODE } + } + "JavaScript" { + try { + $null = Invoke-Expression "npm run test 2>&1" 2>&1 + $exitCode = $LASTEXITCODE + } catch { $exitCode = $LASTEXITCODE } + } + "Go" { + try { + $null = Invoke-Expression "go test ./... -v 2>&1" 2>&1 + $exitCode = $LASTEXITCODE + } catch { $exitCode = $LASTEXITCODE } + } + "Java" { + try { + $null = Invoke-Expression "mvn test 2>&1" 2>&1 + $exitCode = $LASTEXITCODE + } catch { $exitCode = $LASTEXITCODE } + } + "Ruby" { + try { + $null = Invoke-Expression "bundle exec rake test 2>&1" 2>&1 + $exitCode = $LASTEXITCODE + } catch { $exitCode = $LASTEXITCODE } + } + } + + if ($exitCode -eq 0) { + $results.Status = "success" + } else { + $results.Status = "partial" + } + + $results.Command = "test" + $results.Duration = (Get-Date).Subtract($startTime).TotalSeconds + if ($Quiet) { + return $results + } + Write-Host "✅ Tests complete. Status: $($results.Status)" -ForegroundColor Gray + return $results + } + + # Modo bundle + if ($Mode -eq "bundle") { + if (-not $Quiet) { + Write-Host "📦 Creating bundled executable..." -ForegroundColor Cyan + } + + $compiler = Get-Compiler -Language $language -OutputFile $Output + + # Verificar se bundler está disponível + $bundleAvailable = $false + switch ($language) { + "Rust" { + $bundleAvailable = Check-Compiler-Available -Compiler "cargo-bundle" + if ($bundleAvailable) { + try { + $null = Invoke-Expression "cargo binstall cargo-bundle --force 2>&1" 2>&1 + } catch {} + $bundleAvailable = Check-Compiler-Available -Compiler "cargo-bundle" + } + } + "Python" { + $bundleAvailable = Check-Compiler-Available -Compiler "pyinstaller" + } + "JavaScript" { + $bundleAvailable = Check-Compiler-Available -Compiler "webpack-cli" + } + } + + if ($bundleAvailable) { + if ($Quiet) { + $results.Status = "success" + $results.Command = "bundle" + return $results + } + Write-Host "✅ Bundler available: $(if ($bundleAvailable) { 'yes' } else { 'no' })" -ForegroundColor Gray + } else { + if ($Quiet) { + $results.Errors = "Bundler not available for $language" + return $results + } + Write-Host "⚠️ Warning: Bundler not available, falling back to compilation" -ForegroundColor Yellow + } + + $results.Command = "bundle" + $results.Status = "partial" + $results.Duration = (Get-Date).Subtract($startTime).TotalSeconds + if ($Quiet) { + return $results + } + Write-Host "✅ Bundle mode attempted (fallback to compile if bundler unavailable)" -ForegroundColor Gray + return $results + } + + # Modo compile padrão + Write-Host "🔨 Compiling project ($language)..." -ForegroundColor Cyan + + $compiler = Get-Compiler -Language $language -OutputFile $Output + + # Verificar se compilador está disponível + $compilerAvailable = $false + $compilerPath = Find-Compiler -Compiler $compiler.Command + + if ($compilerPath) { + $compilerAvailable = $true + } + + if (-not $compilerAvailable) { + if ($Quiet) { + $results.Errors = "Compiler not found: $($compiler.Command)" + return $results + } + Write-Host "❌ Error: Compiler not found: $($compiler.Command)" -ForegroundColor Red + Write-Host " Please install $($compiler.Command) to compile $language projects." -ForegroundColor Yellow + $results.Errors = "Compiler not found: $($compiler.Command). Please install $($compiler.Command) to compile $language projects." + return $results + } + + if ($Quiet) { + $results.Status = "success" + $results.Command = "$(if ($compiler.Command -eq "cargo") { "cargo build" } elseif ($compiler.Command -eq "npm") { "npm run build" } elseif ($compiler.Command -eq "pip" -and $language -eq "Python" ) { "pip install -e . " } elseif ($compiler.Command -eq "gcc") { "gcc -o output.exe source.c" } elseif ($compiler.Command -eq "dotnet") { "dotnet build" } elseif ($compiler.Command -eq "go") { "go build" } elseif ($compiler.Command -eq "python") { "python setup.py build" } elseif ($compiler.Command -eq "mvn") { "mvn package" } elseif ($compiler.Command -eq "bundle") { "bundle exec rake" } else { $compiler.Command })" + return $results + } + + # Executar compilação + $commandBase = $compiler.Command + + # Construir comando base + switch ($language) { + "Rust" { + $cmd = "cargo build" + if ($Output) { + $cmd = "cargo build --release -o $Output" + } + } + "Python" { + $cmd = "pip install -e ." + if ($config -and $config.Scripts) { + if ($config.Scripts.build) { + $cmd = "npm run build" + } elseif ($config.Scripts.install -match "python") { + $cmd = "pip install -e ." + } + } + } + "JavaScript" { + if ($config -and $config.Scripts) { + if ($config.Scripts.build) { + $cmd = "npm run build" + } elseif ($config.Scripts.dev) { + $cmd = "npm run dev" + } else { + $cmd = "npm run build" + } + } else { + $cmd = "npm run build" + } + } + "TypeScript" { + if ($config -and $config.Scripts) { + if ($config.Scripts.build) { + $cmd = "npm run build" + } elseif ($config.Scripts.dev) { + $cmd = "npm run dev" + } else { + $cmd = "npm run build" + } + } else { + $cmd = "npm run build" + } + } + "C" { + if ($configFile -eq "CMakeLists.txt") { + $cmd = "cmake --build build --config Release" + } elseif ($configFile -eq "Makefile") { + $cmd = "make" + } else { + $cmd = "gcc -o $Output $SourceFile" + } + } + "C++" { + if ($configFile -eq "CMakeLists.txt") { + $cmd = "cmake --build build --config Release" + } elseif ($configFile -eq "Makefile") { + $cmd = "make" + } else { + $cmd = "g++ -o $Output $SourceFile" + } + } + "Go" { + $cmd = "go build -o $Output ." + } + "Java" { + $cmd = "mvn package" + } + "VB.NET" { + $cmd = "dotnet build" + if ($Output) { + $cmd += " -o $Output" + } + } + "C#" { + $cmd = "dotnet build" + if ($Output) { + $cmd += " -o $Output" + } + } + "F#" { + $cmd = "dotnet build" + if ($Output) { + $cmd += " -o $Output" + } + } + "Ruby" { + $cmd = "bundle exec rake" + } + default { + $cmd = "build" + } + } + + $results.Command = $cmd + Write-Host "Command: $cmd" -ForegroundColor Gray + + if ($Verbose) { + Write-Host "Executing: $cmd" -ForegroundColor Cyan + } + + try { + if ($Quiet) { + $null = Invoke-Expression $cmd + } else { + Invoke-Expression $cmd + } + } catch { + if ($Quiet) { + $results.Errors = $_.Exception.Message + return $results + } + Write-Host "❌ Compilation error: $_" -ForegroundColor Red + } + + # Verificar resultado + $exitCode = $LASTEXITCODE + if ($exitCode -eq 0) { + $results.Status = "success" + } elseif ($exitCode -eq 1) { + $results.Status = "partial" + } else { + $results.Status = "fail" + } + + $results.Duration = (Get-Date).Subtract($startTime).TotalSeconds + $results.OutputPath = if ($Output) { $Output } else { "build/$($language).exe" } + if ($Quiet) { + return $results + } + + Write-Host "✅ Build complete! Duration: $($results.Duration) seconds" -ForegroundColor Green + Write-Host "Output: $($results.OutputPath)" -ForegroundColor Gray + return $results + } + + end { + if ($Verbose -and $results.Status -ne "fail") { + Write-Host "`n=== Build Summary ===" -ForegroundColor Cyan + Write-Host "Status: $($results.Status)" -ForegroundColor $(if ($results.Status -eq "success") { "Green" } elseif ($results.Status -eq "partial") { "Yellow" } else { "Red" }) + Write-Host "Duration: $($results.Duration) seconds" -ForegroundColor Gray + Write-Host "Command: $($results.Command)" -ForegroundColor Gray + } + } +} + +# Export all functions +Export-ModuleMember -Function Build-Project, Detect-Language, Get-Compiler, Check-Compiler-Available, Find-Compiler, Parse-Project-Config, Format-Build-Result diff --git a/commandos/c++-analyzer.bat b/commandos/c++-analyzer.bat new file mode 100644 index 0000000000000000000000000000000000000000..69f048a91671f0f27244f1ddd984ca1bef1e087d --- /dev/null +++ b/commandos/c++-analyzer.bat @@ -0,0 +1 @@ +perl -S c++-analyzer %* diff --git a/commandos/ccc-analyzer.bat b/commandos/ccc-analyzer.bat new file mode 100644 index 0000000000000000000000000000000000000000..2a85376eb82b168948757d1344d15a83b565c653 --- /dev/null +++ b/commandos/ccc-analyzer.bat @@ -0,0 +1 @@ +perl -S ccc-analyzer %* diff --git a/commandos/clawdbot-universal.bat b/commandos/clawdbot-universal.bat new file mode 100644 index 0000000000000000000000000000000000000000..92b328a06936debbdb8bab7e5ded4d2c6adbbfe9 --- /dev/null +++ b/commandos/clawdbot-universal.bat @@ -0,0 +1,17 @@ +@echo off +title Clawdbot Universal Launcher +echo Iniciando Clawdbot com modelo qwen2.5:14b... + +:: Passo 1: Iniciar o modelo no Ollama (em background) +start "" /B cmd /c "ollama run qwen2.5:14b" + +:: Pausa breve para garantir que o modelo arranca +timeout /t 3 >nul + +:: Passo 2: Iniciar o Gateway via WSL (assumindo que estás em ~/clawdbot) +wsl -e bash -c "cd ~/clawdbot && npx tsx start-gateway.ts" + +:: Passo 3: Abrir o Canvas no browser +start http://127.0.0.1:18789/__clawdbot__/canvas/ + +exit diff --git a/commandos/convert_mp4_to_mp3.bat b/commandos/convert_mp4_to_mp3.bat new file mode 100644 index 0000000000000000000000000000000000000000..0c378cba49be8f729201c0482f1a7bba415a8a3a --- /dev/null +++ b/commandos/convert_mp4_to_mp3.bat @@ -0,0 +1,10 @@ +@echo off +echo Iniciando conversão MP4 → MP3... +echo Certifique-se de ter o FFmpeg instalado! + +ffmpeg -i "musica1.mp4" -q:a 0 -map a "musica1.mp3" +ffmpeg -i "video_aula.mp4" -q:a 0 -map a "video_aula.mp3" +ffmpeg -i "podcast_final.mp4" -q:a 0 -map a "podcast_final.mp3" + +echo ✅ Tudo convertido! Pressione qualquer tecla para sair... +pause \ No newline at end of file diff --git a/commandos/copy-frame-d-to-e.bat b/commandos/copy-frame-d-to-e.bat new file mode 100644 index 0000000000000000000000000000000000000000..bfaa2c07a4caefa4f52d8c551f64bdecdee21d49 --- /dev/null +++ b/commandos/copy-frame-d-to-e.bat @@ -0,0 +1,10 @@ +@echo off + +set "source=D:\framepack_cu126_torch26" +set "destination=E:\framepack_cu126_torch26" + + + +robocopy "%source%" "%destination%" /E /IS /IT /R:3 /W:5 /NFL /NDL +echo Existing files were overwritten where needed. +pause diff --git a/commandos/corgoogle.bat b/commandos/corgoogle.bat new file mode 100644 index 0000000000000000000000000000000000000000..1b3c18b3c277e1ad8adc65ef7af7d8a230b50930 --- /dev/null +++ b/commandos/corgoogle.bat @@ -0,0 +1,9 @@ +@echo off +echo Fechando o Google Chrome... +taskkill /F /IM chrome.exe >nul 2>&1 + +echo Limpando a cache do Google Chrome... +del /q /s "%LOCALAPPDATA%\Google\Chrome\User Data\Default\Cache\*" + +echo Cache limpa com sucesso! +pause diff --git a/commandos/corgoogle.ps1 b/commandos/corgoogle.ps1 new file mode 100644 index 0000000000000000000000000000000000000000..044adf149203763895fd660e6f7b71c810720e00 --- /dev/null +++ b/commandos/corgoogle.ps1 @@ -0,0 +1,8 @@ +Write-Output "Fechando o Google Chrome..." +Stop-Process -Name "chrome" -Force -ErrorAction SilentlyContinue + +Write-Output "Limpando a cache do Google Chrome..." +Remove-Item "$env:LOCALAPPDATA\Google\Chrome\User Data\Default\Cache\*" -Recurse -Force -ErrorAction SilentlyContinue + +Write-Output "Cache limpa com sucesso!" +Pause diff --git a/commandos/corrige-path.bat b/commandos/corrige-path.bat new file mode 100644 index 0000000000000000000000000000000000000000..54989630c20b64910c1960ac8c147d8fc2719135 --- /dev/null +++ b/commandos/corrige-path.bat @@ -0,0 +1,24 @@ +@echo off +setlocal enabledelayedexpansion + +:: Define the existing PATH as provided +set "EXISTING_PATH=C:\py\pyenv\pyenv-win\bin;C:\py\pyenv\pyenv-win\shims;C:\py\pyenv\pyenv-win\bin;C:\py\pyenv\pyenv-win\shims;%USERPROFILE%\AppData\Local\Microsoft\WindowsApps;C:\Users\luisf\AppData\Local\pnpm;C:\Users\luisf\AppData\Local\Programs\oh-my-posh\bin;C:\Windows\system32;C:\Users\luisf\;" + +:: List of essential paths to add based on your directories (deduplicated and prioritized for tools/compilers) +:: These are inferred from common bin directories in your C:\ root folders +set "NEW_PATHS=C:\mingw64\bin;C:\msys64\mingw64\bin;C:\msys64\usr\bin;C:\cmake\bin;C:\ninja;C:\ffmpeg-2024-10-13-git-e347b4ff31-full_build\bin;C:\node-v22.18.0-win-x64;C:\clang+llvm-19.1.1-x86_64-pc-windows-msvc\bin;C:\w64devkit-2.3.0\bin;C:\vcpkg;C:\nvm4w;C:\npm;C:\WinFBE_Suite\toolchains\FreeBASIC-1.10.0-winlibs-gcc-9.3.0\bin;C:\WinFBE_Suite\toolchains\FreeBASIC-1.10.0-winlibs-gcc-9.3.0\bin\win64;C:\VisualFBEditor.1.3.6\bin;C:\cygwin64\bin;C:\curl-8.9.1_3-win64-mingw\bin;C:\winlibs-x86_64-posix-seh-gcc-14.2.0-mingw-w64msvcrt-12.0.0-r3\bin;C:\VulkanSDK\Bin;C:\TensorRT\bin;C:\openvino\bin;C:\SDL3-3.2.20-win32-x64;C:\SDL\bin;C:\msys64\bin;C:\msys641\bin;C:\Powershell7;C:\python313\Scripts;C:\python313;C:\python311\Scripts;C:\python311;C:\python310\Scripts;C:\python310;C:\python38\Scripts;C:\python38;C:\TURBOC3\BIN;C:\rubberband\bin;C:\sox;C:\sqlite;C:\ffmpeg\bin;C:\ffmpeg-7.0.2-full_build\bin" + +:: Combine existing and new paths, avoiding duplicates +set "FULL_PATH=!EXISTING_PATH!" +for %%p in (%NEW_PATHS:;= %) do ( + echo !FULL_PATH! | findstr /C:"%%p" >nul + if errorlevel 1 ( + set "FULL_PATH=!FULL_PATH!%%p;" + ) +) + +:: Set the PATH persistently using setx (user-level) +setx PATH "!FULL_PATH!" /M + +echo PATH updated. Restart your command prompt or system for changes to take effect. +pause \ No newline at end of file diff --git a/commandos/corrige-path.ps1 b/commandos/corrige-path.ps1 new file mode 100644 index 0000000000000000000000000000000000000000..9b3fc764eb5801c15063efde189962d0f2813d1a --- /dev/null +++ b/commandos/corrige-path.ps1 @@ -0,0 +1,66 @@ +# ------------------------------------------------------------ +# Existing PATH (como fornecido) +# ------------------------------------------------------------ +$existingPath = "C:\py\pyenv\pyenv-win\bin;C:\py\pyenv\pyenv-win\shims;C:\py\pyenv\pyenv-win\bin;C:\py\pyenv\pyenv-win\shims;$env:USERPROFILE\AppData\Local\Microsoft\WindowsApps;C:\Users\luisf\AppData\Local\pnpm;C:\Users\luisf\AppData\Local\Programs\oh-my-posh\bin;C:\Windows\system32;C:\Users\luisf\;" + +# ------------------------------------------------------------ +# Novos caminhos essenciais (deduplicados e priorizados) +# ------------------------------------------------------------ +$newPaths = @( + "C:\mingw64\bin", + "C:\msys64\mingw64\bin", + "C:\msys64\usr\bin", + "C:\cmake\bin", + "C:\ninja", + "C:\ffmpeg-2024-10-13-git-e347b4ff31-full_build\bin", + "C:\node-v22.18.0-win-x64", + "C:\clang+llvm-19.1.1-x86_64-pc-windows-msvc\bin", + "C:\w64devkit-2.3.0\bin", + "C:\vcpkg", + "C:\nvm4w", + "C:\npm", + "C:\WinFBE_Suite\toolchains\FreeBASIC-1.10.0-winlibs-gcc-9.3.0\bin", + "C:\WinFBE_Suite\toolchains\FreeBASIC-1.10.0-winlibs-gcc-9.3.0\bin\win64", + "C:\VisualFBEditor.1.3.6\bin", + "C:\cygwin64\bin", + "C:\curl-8.9.1_3-win64-mingw\bin", + "C:\winlibs-x86_64-posix-seh-gcc-14.2.0-mingw-w64msvcrt-12.0.0-r3\bin", + "C:\VulkanSDK\Bin", + "C:\TensorRT\bin", + "C:\openvino\bin", + "C:\SDL3-3.2.20-win32-x64", + "C:\SDL\bin", + "C:\msys64\bin", + "C:\msys641\bin", + "C:\Powershell7", + "C:\python313\Scripts", + "C:\python313", + "C:\python311\Scripts", + "C:\python311", + "C:\python310\Scripts", + "C:\python310", + "C:\python38\Scripts", + "C:\python38", + "C:\TURBOC3\BIN", + "C:\rubberband\bin", + "C:\sox", + "C:\sqlite", + "C:\ffmpeg\bin", + "C:\ffmpeg-7.0.2-full_build\bin" +) + +# ------------------------------------------------------------ +# Combinar PATH existente com novos caminhos (sem duplicados) +# ------------------------------------------------------------ +$fullPath = $existingPath.Split(";") + $newPaths +$fullPath = $fullPath | Where-Object { $_ -and $_.Trim() -ne "" } | Select-Object -Unique +$finalPath = ($fullPath -join ";") + +# ------------------------------------------------------------ +# Atualizar PATH de forma persistente (nível de utilizador) +# ------------------------------------------------------------ +[Environment]::SetEnvironmentVariable("Path", $finalPath, "User") + +Write-Host "" +Write-Host "PATH atualizado com sucesso." +Write-Host "Reinicia o terminal para aplicar as alterações." diff --git a/commandos/dar permissao a pasta imagens.bat b/commandos/dar permissao a pasta imagens.bat new file mode 100644 index 0000000000000000000000000000000000000000..e1fa6bddd54878d01bf928662dde3e22c0a376da --- /dev/null +++ b/commandos/dar permissao a pasta imagens.bat @@ -0,0 +1 @@ +call icacls "C:\Users\luisf\Pictures" /grant luisf:(OI)(CI)F /t \ No newline at end of file diff --git a/commandos/deactivate.bat b/commandos/deactivate.bat new file mode 100644 index 0000000000000000000000000000000000000000..44dae49537073789b536689bb940456e65929b99 --- /dev/null +++ b/commandos/deactivate.bat @@ -0,0 +1,22 @@ +@echo off + +if defined _OLD_VIRTUAL_PROMPT ( + set "PROMPT=%_OLD_VIRTUAL_PROMPT%" +) +set _OLD_VIRTUAL_PROMPT= + +if defined _OLD_VIRTUAL_PYTHONHOME ( + set "PYTHONHOME=%_OLD_VIRTUAL_PYTHONHOME%" + set _OLD_VIRTUAL_PYTHONHOME= +) + +if defined _OLD_VIRTUAL_PATH ( + set "PATH=%_OLD_VIRTUAL_PATH%" +) + +set _OLD_VIRTUAL_PATH= + +set VIRTUAL_ENV= +set VIRTUAL_ENV_PROMPT= + +:END diff --git a/commandos/desbloquear_pictures.bat b/commandos/desbloquear_pictures.bat new file mode 100644 index 0000000000000000000000000000000000000000..be65217d7c9e40a5e6ec52673b70ff6e56a6180e --- /dev/null +++ b/commandos/desbloquear_pictures.bat @@ -0,0 +1,45 @@ +@echo off +setlocal enabledelayedexpansion + +:: Caminho da pasta +set "TARGET=C:\Users\%USERNAME%\Pictures" +set "LOG=%TEMP%\desbloqueio_log.txt" + +:: Limpa log anterior +if exist "%LOG%" del "%LOG%" + +echo [INFO] Verificando permissões para: %TARGET% >> "%LOG%" + +:: Verifica se está em modo administrador +net session >nul 2>&1 +if %errorlevel% neq 0 ( + echo [ERRO] Este script precisa ser executado como Administrador. + echo Execute como administrador e tente novamente. + pause + exit /b +) + +:: Toma posse da pasta +echo [PASSO] Tomando posse da pasta... >> "%LOG%" +takeown /f "%TARGET%" /r /d y >> "%LOG%" 2>&1 + +:: Aplica permissões +echo [PASSO] Aplicando permissões para %USERNAME%... >> "%LOG%" +icacls "%TARGET%" /grant "%COMPUTERNAME%\%USERNAME%":(OI)(CI)F /T >> "%LOG%" 2>&1 + +:: Testa gravação +echo [PASSO] Testando gravação... >> "%LOG%" +echo Teste de gravação > "%TARGET%\teste_de_gravacao.txt" +if exist "%TARGET%\teste_de_gravacao.txt" ( + echo [SUCESSO] Gravação bem-sucedida em %TARGET% >> "%LOG%" +) else ( + echo [FALHA] Não foi possível gravar em %TARGET% >> "%LOG%" +) + +:: Verifica Defender (Acesso controlado a pastas) +echo [INFO] Verificando status do Windows Defender... >> "%LOG%" +powershell -Command "Get-MpPreference | Select-Object -ExpandProperty ControlledFolderAccessProtection" >> "%LOG%" 2>&1 + +echo. +echo [CONCLUÍDO] Verificação completa. Log salvo em: %LOG% +pause diff --git a/commandos/dev-agent.bat b/commandos/dev-agent.bat new file mode 100644 index 0000000000000000000000000000000000000000..39ab16027dd25e7e57ed1775041584f5f1f47c85 --- /dev/null +++ b/commandos/dev-agent.bat @@ -0,0 +1 @@ +python C:\Users\luisf\dev-agent\dev-agent.py \ No newline at end of file diff --git a/commandos/f-confy.bat b/commandos/f-confy.bat new file mode 100644 index 0000000000000000000000000000000000000000..6ac8ab3a3b736248f07f1971713c84063bf48a00 --- /dev/null +++ b/commandos/f-confy.bat @@ -0,0 +1,53 @@ +REM ===================================================== +REM USAR PYTHON EMBEDDED DO COMFYUI (CUDA 12.8) +REM ===================================================== + +cd /d D:\ComfyUI_windows_portable_nvidia_cu128\ComfyUI_windows_portable + +REM ----------------------------------------------------- +REM ATIVAR PYTHON EMBEDDED +REM ----------------------------------------------------- +set PYTHON=python_embeded\python.exe +set PIP=python_embeded\python.exe -m pip + +REM ----------------------------------------------------- +REM ATUALIZAR FERRAMENTAS BASE +REM ----------------------------------------------------- +%PYTHON% -m ensurepip +%PIP% install --upgrade pip setuptools wheel + +REM ----------------------------------------------------- +REM LIMPAR PACOTES QUE CAUSAM DLL ERROR +REM ----------------------------------------------------- +%PIP% uninstall -y torch torchvision torchaudio diffusers xformers accelerate safetensors + +REM ----------------------------------------------------- +REM INSTALAR PYTORCH COMPATÍVEL COM CUDA 12.8 +REM ----------------------------------------------------- +%PIP% install torch==2.3.1+cu121 torchvision==0.18.1+cu121 torchaudio==2.3.1+cu121 --index-url https://download.pytorch.org/whl/cu121 + +REM ----------------------------------------------------- +REM INSTALAR DEPENDÊNCIAS EXATAS PARA VIDEOMAMA +REM ----------------------------------------------------- +%PIP% install diffusers==0.24.0 +%PIP% install accelerate==0.25.0 +%PIP% install safetensors==0.4.2 +%PIP% install transformers==4.36.2 +%PIP% install huggingface_hub==0.20.3 +%PIP% install einops numpy pillow tqdm scipy packaging + +REM ----------------------------------------------------- +REM XFORMERS COMPATÍVEL +REM ----------------------------------------------------- +%PIP% install xformers==0.0.26.post1 + +REM ----------------------------------------------------- +REM TESTE FINAL (CRÍTICO) +REM ----------------------------------------------------- +%PYTHON% - << EOF +import torch +from diffusers.models.autoencoders import autoencoder_kl_temporal_decoder +print("Torch:", torch.__version__) +print("CUDA:", torch.cuda.is_available()) +print("OK: autoencoder_kl_temporal_decoder carregado") +EOF diff --git a/commandos/fallback-check.ps1 b/commandos/fallback-check.ps1 new file mode 100644 index 0000000000000000000000000000000000000000..f10fefe8b63d57681843890fc064b46e1cf4d610 --- /dev/null +++ b/commandos/fallback-check.ps1 @@ -0,0 +1,8 @@ +# fallback-check.ps1 +$gpuInfo = & nvidia-smi --query-gpu=memory.free --format=csv,noheader,nounits +$freeVRAM = [int]$gpuInfo + +if ($freeVRAM -lt 4000) { + # Define variável de ambiente para fallback + [System.Environment]::SetEnvironmentVariable("USE_CPU_FALLBACK", "1", "User") +} diff --git a/commandos/ff-comfy.bat b/commandos/ff-comfy.bat new file mode 100644 index 0000000000000000000000000000000000000000..959e36df992fe4395e36c036d6b55d09276eff35 --- /dev/null +++ b/commandos/ff-comfy.bat @@ -0,0 +1,56 @@ +REM ===================================================== +REM COMFYUI PYTHON EMBEDDED – FIX XFORMERS BUILD ERROR +REM (NÃO COMPILAR, USAR BINÁRIO OU DESATIVAR) +REM ===================================================== + +cd /d D:\ComfyUI_windows_portable_nvidia_cu128\ComfyUI_windows_portable + +set PYTHON=python_embeded\python.exe +set PIP=python_embeded\python.exe -m pip + +REM ----------------------------------------------------- +REM GARANTIR FERRAMENTAS BASE +REM ----------------------------------------------------- +%PYTHON% -m ensurepip +%PIP% install --upgrade pip setuptools wheel + +REM ----------------------------------------------------- +REM REMOVER XFORMERS QUE FALHOU NA BUILD +REM ----------------------------------------------------- +%PIP% uninstall -y xformers + +REM ----------------------------------------------------- +REM OPÇÃO A (RECOMENDADA): USAR XFORMERS PRÉ-COMPILADO +REM (TORCH 2.3.x + CUDA 12.1) +REM ----------------------------------------------------- +%PIP% install xformers==0.0.27.post2 --index-url https://download.pytorch.org/whl/cu121 + +REM ----------------------------------------------------- +REM OPÇÃO B (SE AINDA FALHAR): DESATIVAR XFORMERS +REM ----------------------------------------------------- +REM set XFORMERS_DISABLED=1 + +REM ----------------------------------------------------- +REM GARANTIR STACK CONSISTENTE +REM ----------------------------------------------------- +%PIP% uninstall -y torch torchvision torchaudio +%PIP% install torch==2.3.1+cu121 torchvision==0.18.1+cu121 torchaudio==2.3.1+cu121 --index-url https://download.pytorch.org/whl/cu121 + +%PIP% install diffusers==0.24.0 +%PIP% install accelerate==0.25.0 +%PIP% install safetensors==0.4.2 +%PIP% install transformers==4.36.2 +%PIP% install huggingface_hub==0.20.3 +%PIP% install einops numpy pillow tqdm scipy packaging + +REM ----------------------------------------------------- +REM TESTE FINAL +REM ----------------------------------------------------- +%PYTHON% - << EOF +import torch +from diffusers.models.autoencoders import autoencoder_kl_temporal_decoder +print("Torch:", torch.__version__) +print("CUDA:", torch.cuda.is_available()) +print("Xformers:", torch.backends.cuda.matmul.allow_tf32) +print("OK") +EOF diff --git a/commandos/frame.ps1 b/commandos/frame.ps1 new file mode 100644 index 0000000000000000000000000000000000000000..42ebe361eb0df1e6835bf0c4a6618cb99f00c942 --- /dev/null +++ b/commandos/frame.ps1 @@ -0,0 +1,16 @@ +# Ativar .NET Framework 3.5 e 4.x no Windows +# Criado a partir da configuração "WPFFeaturesdotnet" + +Write-Host "A ativar .NET Framework 3.5 e 4.x..." -ForegroundColor Cyan + +$features = @( + "NetFx4-AdvSrvs", + "NetFx3" +) + +foreach ($feature in $features) { + Write-Host "A ativar feature: $feature" -ForegroundColor Yellow + Enable-WindowsOptionalFeature -Online -FeatureName $feature -All -NoRestart -ErrorAction SilentlyContinue +} + +Write-Host "Processo concluído. Reinicia o sistema se necessário." -ForegroundColor Green diff --git a/commandos/git-clang-format.bat b/commandos/git-clang-format.bat new file mode 100644 index 0000000000000000000000000000000000000000..9965cd4312fe39eec0d3395050f3d8664d373566 --- /dev/null +++ b/commandos/git-clang-format.bat @@ -0,0 +1 @@ +py -3 %~pn0 %* diff --git a/commandos/health_check.bat b/commandos/health_check.bat new file mode 100644 index 0000000000000000000000000000000000000000..e54258f274f51cca326853b00479d0d3365b16a0 --- /dev/null +++ b/commandos/health_check.bat @@ -0,0 +1,40 @@ +@echo off +echo =================================================== +echo Windows 11 System Integrity Test Script +echo =================================================== +echo. +echo This script requires Administrator privileges. +echo If you did not right-click and 'Run as Administrator', +echo this may fail or ask for elevation. +echo. + +echo [1/2] Checking Windows Component Store Health (DISM)... +DISM /Online /Cleanup-Image /CheckHealth +if %ERRORLEVEL% NEQ 0 ( + echo. + echo [WARNING] DISM found issues or failed to run. +) else ( + echo. + echo [OK] DISM check passed. +) + +echo. +echo --------------------------------------------------- +echo. + +echo [2/2] Verifying System Files (SFC)... +echo This may take some time... +sfc /verifyonly +if %ERRORLEVEL% NEQ 0 ( + echo. + echo [WARNING] SFC found integrity violations or failed to run. +) else ( + echo. + echo [OK] SFC found no integrity violations. +) + +echo. +echo =================================================== +echo Testing Complete. +echo =================================================== +pause diff --git a/commandos/ia.bat b/commandos/ia.bat new file mode 100644 index 0000000000000000000000000000000000000000..ee0db7af6dc3c7b90d3a9c34da4c83b7ad3d8935 --- /dev/null +++ b/commandos/ia.bat @@ -0,0 +1,46 @@ +@echo off +TITLE Terminal IA - Gemma 4 + GPU +SETLOCAL + +:: 1. Configurar Caminhos de Ambiente +set "PYTHONPATH=C:\py\pyenv\pyenv-win\versions\3.10.11" +set "OLLAMA_HOST=http://127.0.0.1:11434" +set "OLLAMA_ORIGINS=*" + +:: 2. Forçar Variáveis para evitar o erro 404 (api/api) +set "OPENAI_API_BASE=http://localhost:11434/v1" +set "API_BASE=http://localhost:11434" + +:: 3. Garantir que o Python e Pip estão no ponto +:: Rehash para o pyenv detetar tudo +call pyenv rehash + +echo ====================================================== +echo TERMINAL IA: GEMMA 4 (9.6 GB) +echo ====================================================== +echo STATUS: CUDA 11.8 detetado (Torch 2.7.1) +echo MODELO: gemma4:e4b +echo ------------------------------------------------------ +echo. + +:: 4. Menu de Opcoes +echo [1] Iniciar Open Interpreter (Criar/Ler Ficheiros) +echo [2] Iniciar Aider (Melhor para Editar Codigo) +echo [3] Chat Direto (Ollama puro) +echo [4] Sair +echo. + +set /p choice="Escolha uma opcao: " + +if "%choice%"=="1" ( + interpreter --model ollama/gemma4:e4b --api_base http://localhost:11434 +) +if "%choice%"=="2" ( + aider --model ollama/gemma4:e4b +) +if "%choice%"=="3" ( + ollama run gemma4:e4b +) +if "%choice%"=="4" exit + +pause \ No newline at end of file diff --git a/commandos/insta.bat b/commandos/insta.bat new file mode 100644 index 0000000000000000000000000000000000000000..af40f8e588a1d8b95f5855de43ac37572704fb53 --- /dev/null +++ b/commandos/insta.bat @@ -0,0 +1,7 @@ +uv venv D:\open-webui --python 3.11 +& "D:\open-webui\Scripts\Activate.ps1" +uv pip install open-webui +open-webui serve + + +pause \ No newline at end of file diff --git a/commandos/instala.bat b/commandos/instala.bat new file mode 100644 index 0000000000000000000000000000000000000000..36cc7f157c418d63a191e266164e1c5bd7a583a8 --- /dev/null +++ b/commandos/instala.bat @@ -0,0 +1,4 @@ +@echo off +set REPO=%1 +D:\ComfyUI_windows_portable_nvidia\ComfyUI_windows_portable\python_embeded\python.exe -m pip install --user --force-reinstall %REPO% +pause diff --git a/commandos/instalar-skills.bat b/commandos/instalar-skills.bat new file mode 100644 index 0000000000000000000000000000000000000000..aeca5812a047d75354c84bddf4da208856cc306a --- /dev/null +++ b/commandos/instalar-skills.bat @@ -0,0 +1,36 @@ +@echo off +title Instalar binários para Clawdbot Skills +echo. +echo [1/6] A verificar se o Chocolatey está instalado... +where choco >nul 2>&1 +if %errorlevel% neq 0 ( + echo Chocolatey não encontrado. A instalar... + powershell -NoProfile -ExecutionPolicy Bypass -Command "Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))" +) else ( + echo Chocolatey já está instalado. +) + +echo. +echo [2/6] A instalar ffmpeg... +choco install -y ffmpeg + +echo. +echo [3/6] A instalar jq e ripgrep... +choco install -y jq ripgrep + +echo. +echo [4/6] A instalar Python 3... +choco install -y python + +echo. +echo [5/6] A instalar Node.js... +choco install -y nodejs + +echo. +echo [6/6] A instalar clawdhub CLI... +call npm install -g clawdhub + +echo. +echo Instalação concluída. Reinicia o Clawdbot com: +echo clawdbot gateway restart +pause diff --git a/commandos/instalarepo.bat b/commandos/instalarepo.bat new file mode 100644 index 0000000000000000000000000000000000000000..17984ef8378d643f427f6e655fc077ad6bbf2a92 --- /dev/null +++ b/commandos/instalarepo.bat @@ -0,0 +1,28 @@ +@echo off +set REPO=%1 +set REPO1=%2 +set REPO2=%3 +set REPO3=%4 +set REPO4=%5 +D:\ComfyUI_windows_portable_nvidia\ComfyUI_windows_portable\python_embeded\python.exe -m pip install --upgrade --force-reinstall "numpy<2,>=1.24" +D:\ComfyUI_windows_portable_nvidia\ComfyUI_windows_portable\python_embeded\python.exe -m pip install --user --force-reinstall opencv-python +D:\ComfyUI_windows_portable_nvidia\ComfyUI_windows_portable\python_embeded\python.exe -m pip install --user --force-reinstall scikit-image +D:\ComfyUI_windows_portable_nvidia\ComfyUI_windows_portable\python_embeded\python.exe -m pip install --user --force-reinstall albumentations +D:\ComfyUI_windows_portable_nvidia\ComfyUI_windows_portable\python_embeded\python.exe -m pip install --user --force-reinstall scikit-learn +D:\ComfyUI_windows_portable_nvidia\ComfyUI_windows_portable\python_embeded\python.exe -m pip install --user --force-reinstall librosa>=0.10.2.post1 +D:\ComfyUI_windows_portable_nvidia\ComfyUI_windows_portable\python_embeded\python.exe -m pip install --user --force-reinstall numba>=0.60.0 +D:\ComfyUI_windows_portable_nvidia\ComfyUI_windows_portable\python_embeded\python.exe -m pip install --user --force-reinstall protobuf>=3.20.2 +D:\ComfyUI_windows_portable_nvidia\ComfyUI_windows_portable\python_embeded\python.exe -m pip install --user --force-reinstall httpx<1,>=0.23.0 +D:\ComfyUI_windows_portable_nvidia\ComfyUI_windows_portable\python_embeded\python.exe -m pip install --user --force-reinstall timm +D:\ComfyUI_windows_portable_nvidia\ComfyUI_windows_portable\python_embeded\python.exe -m pip install --user --force-reinstall joblib +D:\ComfyUI_windows_portable_nvidia\ComfyUI_windows_portable\python_embeded\python.exe -m pip install --user --force-reinstall pooch +D:\ComfyUI_windows_portable_nvidia\ComfyUI_windows_portable\python_embeded\python.exe -m pip install --user --force-reinstall platformdirs +D:\ComfyUI_windows_portable_nvidia\ComfyUI_windows_portable\python_embeded\python.exe -m pip install --user --force-reinstall grpcio>=1.48.2 +D:\ComfyUI_windows_portable_nvidia\ComfyUI_windows_portable\python_embeded\python.exe -m pip install --user --force-reinstall werkzeug>=1.0.1 +D:\ComfyUI_windows_portable_nvidia\ComfyUI_windows_portable\python_embeded\python.exe -m pip install --user --force-reinstall beautifulsoup4 +D:\ComfyUI_windows_portable_nvidia\ComfyUI_windows_portable\python_embeded\python.exe -m pip install --user --force-reinstall opencv-contrib-python + + + +D:\ComfyUI_windows_portable_nvidia\ComfyUI_windows_portable\python_embeded\python.exe -m pip install --user --force-reinstall %REPO% %REPO1% %REPO2% %REPO3% %REPO4% %repo5% +pause diff --git a/commandos/install.bat b/commandos/install.bat new file mode 100644 index 0000000000000000000000000000000000000000..290195e8e64f4bfd161828f5e8d224665296feea --- /dev/null +++ b/commandos/install.bat @@ -0,0 +1,37 @@ +@echo off +setlocal enabledelayedexpansion + +:: Try to use embedded python first +if exist ..\..\..\python_embeded\python.exe ( + :: Use the embedded python + set PYTHON=..\..\..\python_embeded\python.exe +) else ( + :: Embedded python not found, check for python in the PATH + for /f "tokens=* USEBACKQ" %%F in (`python --version 2^>^&1`) do ( + set PYTHON_VERSION=%%F + ) + if errorlevel 1 ( + echo I couldn't find an embedded version of Python, nor one in the Windows PATH. Please install manually. + pause + exit /b 1 + ) else ( + :: Use python from the PATH (if it's the right version and the user agrees) + echo I couldn't find an embedded version of Python, but I did find !PYTHON_VERSION! in your Windows PATH. + echo Would you like to proceed with the install using that version? (Y/N^) + set /p USE_PYTHON= + if /i "!USE_PYTHON!"=="Y" ( + set PYTHON=python + ) else ( + echo Okay. Please install manually. + pause + exit /b 1 + ) + ) +) + +:: Install the package +echo Installing... +%PYTHON% install.py +echo Done^! + +@pause \ No newline at end of file diff --git a/commandos/install_agent_deps.bat b/commandos/install_agent_deps.bat new file mode 100644 index 0000000000000000000000000000000000000000..bd3e56faa3044d4afe22e6460b85ba1516758941 --- /dev/null +++ b/commandos/install_agent_deps.bat @@ -0,0 +1,5 @@ +@echo off +cd /d "D:\agente-zero" +echo Installing Agent Zero requirements... +pip install -r requirements.txt +pause \ No newline at end of file diff --git a/commandos/install_agent_ps.ps1 b/commandos/install_agent_ps.ps1 new file mode 100644 index 0000000000000000000000000000000000000000..4d6343b18f01011eb10f7b2d170a3b52009b2570 --- /dev/null +++ b/commandos/install_agent_ps.ps1 @@ -0,0 +1,6 @@ +# Activate the virtual environment and install requirements +Set-Location "D:\agente-zero" +& "D:\agente-zero\venv\Scripts\Activate.ps1" +pip install -r requirements.txt +Write-Host "Installation completed. Press any key to exit..." +$HOST.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown") \ No newline at end of file diff --git a/commandos/lpip.bat b/commandos/lpip.bat new file mode 100644 index 0000000000000000000000000000000000000000..30bfa867bf1f411d06c0151ada11479cf12ca330 --- /dev/null +++ b/commandos/lpip.bat @@ -0,0 +1,8 @@ +@echo off +set REPO=%1 +set REPO1=%2 +set REPO2=%3 +set REPO3=%4 +set REPO4=%5 +D:\ComfyUI_cu128_50XX\python_embeded\python -m pip %REPO% %REPO1% %REPO2% %REPO3% %REPO4% %repo5% +pause diff --git a/commandos/lpython.bat b/commandos/lpython.bat new file mode 100644 index 0000000000000000000000000000000000000000..80da0f585319da38a65d97df02015d417d860c46 --- /dev/null +++ b/commandos/lpython.bat @@ -0,0 +1,3 @@ +@echo off +D:\ComfyUI_cu128_50XX\python_embeded\python.exe +pause diff --git a/commandos/lu.bat b/commandos/lu.bat new file mode 100644 index 0000000000000000000000000000000000000000..01b99904f36557b7db03803a58e155b8eaa0623c --- /dev/null +++ b/commandos/lu.bat @@ -0,0 +1,16 @@ +:: 1) Garantir que o pip está instalado corretamente no Python 3.10.11 +C:\py\pyenv\pyenv-win\versions\3.10.11\python.exe -m ensurepip --upgrade + +:: 2) Reinstalar pip limpo +C:\py\pyenv\pyenv-win\versions\3.10.11\python.exe -m pip uninstall -y pip +C:\py\pyenv\pyenv-win\versions\3.10.11\python.exe -m ensurepip +C:\py\pyenv\pyenv-win\versions\3.10.11\python.exe -m pip install --upgrade pip setuptools wheel + +:: 3) Confirmar que pip funciona +C:\py\pyenv\pyenv-win\versions\3.10.11\python.exe -m pip --version + +:: 4) Instalar nvidia-pyindex sem isolamento (corrige erro ModuleNotFoundError: pip) +C:\py\pyenv\pyenv-win\versions\3.10.11\python.exe -m pip install nvidia-pyindex --no-build-isolation + +:: 5) Alternativa direta sem nvidia-pyindex (RECOMENDADO) +C:\py\pyenv\pyenv-win\versions\3.10.11\python.exe -m pip install --extra-index-url https://pypi.ngc.nvidia.com nvidia-cudnn-cu11 nvidia-cublas-cu11 nvidia-cuda-runtime-cu11 diff --git a/commandos/lu1.bat b/commandos/lu1.bat new file mode 100644 index 0000000000000000000000000000000000000000..0ad6a360013fdac2b39b1737846146391734caac --- /dev/null +++ b/commandos/lu1.bat @@ -0,0 +1,17 @@ +:: 1) NÃO usar nvidia-pyindex (está quebrado em pip moderno) + +:: 2) Garantir ambiente limpo +C:\py\pyenv\pyenv-win\versions\3.10.11\python.exe -m pip uninstall -y nvidia-pyindex +C:\py\pyenv\pyenv-win\versions\3.10.11\python.exe -m pip cache purge + +:: 3) Atualizar ferramentas base +C:\py\pyenv\pyenv-win\versions\3.10.11\python.exe -m pip install --upgrade pip setuptools wheel + +:: 4) Adicionar index NVIDIA manualmente (forma correta moderna) +C:\py\pyenv\pyenv-win\versions\3.10.11\python.exe -m pip config set global.extra-index-url https://pypi.ngc.nvidia.com + +:: 5) Instalar dependências CUDA 11.8 compatíveis com Torch 2.7.1+cu118 +C:\py\pyenv\pyenv-win\versions\3.10.11\python.exe -m pip install nvidia-cublas-cu11 nvidia-cuda-runtime-cu11 nvidia-cudnn-cu11 + +:: 6) (Opcional) Verificar se index ficou configurado +C:\py\pyenv\pyenv-win\versions\3.10.11\python.exe -m pip config list diff --git a/commandos/lu2.bat b/commandos/lu2.bat new file mode 100644 index 0000000000000000000000000000000000000000..b456b972b45eb31206892e5c0f59cd495e06f4e2 --- /dev/null +++ b/commandos/lu2.bat @@ -0,0 +1,23 @@ +:: 1) LIMPAR completamente configuração pip quebrada + +del %APPDATA%\pip\pip.ini +del %USERPROFILE%\pip\pip.ini +del C:\ProgramData\pip\pip.ini + +:: 2) Recriar configuração correta (SEM quebras de linha) + +C:\py\pyenv\pyenv-win\versions\3.10.11\python.exe -m pip config set global.index-url https://pypi.org/simple +C:\py\pyenv\pyenv-win\versions\3.10.11\python.exe -m pip config set global.extra-index-url https://pypi.ngc.nvidia.com +C:\py\pyenv\pyenv-win\versions\3.10.11\python.exe -m pip config set global.trusted-host pypi.ngc.nvidia.com + +:: 3) Confirmar que NÃO existe "\n" na config +C:\py\pyenv\pyenv-win\versions\3.10.11\python.exe -m pip config list + +:: 4) NÃO instalar cu116 (é CUDA 11.6) +:: Torch 2.7.1+cu118 = CUDA 11.8 +:: Instalar versão correta: + +C:\py\pyenv\pyenv-win\versions\3.10.11\python.exe -m pip install --no-cache-dir nvidia-cudnn-cu11==8.9.7.29 + +:: 5) Alternativa direta sem depender de config +C:\py\pyenv\pyenv-win\versions\3.10.11\python.exe -m pip install --index-url https://pypi.ngc.nvidia.com nvidia-cudnn-cu11 diff --git a/commandos/luis.bat b/commandos/luis.bat new file mode 100644 index 0000000000000000000000000000000000000000..555136ae27fe33ca615d230753703be205e8b269 --- /dev/null +++ b/commandos/luis.bat @@ -0,0 +1 @@ +interpreter --context_window 8192 --max_tokens 4096 --model ollama_chat/gemma4:e4b --api_base http://localhost:11434 \ No newline at end of file diff --git a/commandos/luis1.bat b/commandos/luis1.bat new file mode 100644 index 0000000000000000000000000000000000000000..e1c765026398f5d04adec06575abfac4dd19e79e --- /dev/null +++ b/commandos/luis1.bat @@ -0,0 +1,2 @@ +set OLLAMA_API_BASE=http://localhost:11434 +aider --model ollama/gemma4:e4b \ No newline at end of file diff --git a/commandos/make-ibm.ps1 b/commandos/make-ibm.ps1 new file mode 100644 index 0000000000000000000000000000000000000000..070296196803e22c0c93e3c5f340c90e4139aabd --- /dev/null +++ b/commandos/make-ibm.ps1 @@ -0,0 +1,83 @@ +# ============================================ +# IBM System/34 Theme Installer (perfil: novo-perfil) +# ============================================ + +Write-Host "A configurar o perfil 'novo-perfil'..." -ForegroundColor Green + +$settingsPath = "$env:LOCALAPPDATA\Packages\Microsoft.WindowsTerminal_8wekyb3d8bbwe\LocalState\settings.json" + +if (!(Test-Path $settingsPath)) { + Write-Host "settings.json não encontrado." -ForegroundColor Red + exit +} + +# Carregar JSON +$json = Get-Content $settingsPath -Raw | ConvertFrom-Json + +# Criar secção schemes se não existir +if (-not $json.schemes) { + $json | Add-Member -MemberType NoteProperty -Name schemes -Value @() +} + +# Definir esquema IBM System/34 +$ibmScheme = @{ + name = "IBM-System34" + background = "#000000" + foreground = "#33FF33" + cursorColor = "#33FF33" + selectionBackground = "#003300" + black = "#000000" + red = "#33FF33" + green = "#33FF33" + yellow = "#33FF33" + blue = "#33FF33" + purple = "#33FF33" + cyan = "#33FF33" + white = "#33FF33" + brightBlack = "#003300" + brightRed = "#66FF66" + brightGreen = "#66FF66" + brightYellow = "#66FF66" + brightBlue = "#66FF66" + brightPurple = "#66FF66" + brightCyan = "#66FF66" + brightWhite = "#99FF99" +} + +# Adicionar esquema se não existir +if (-not ($json.schemes | Where-Object { $_.name -eq "IBM-System34" })) { + $json.schemes += $ibmScheme +} + +# Encontrar o perfil "novo-perfil" +$profile = $json.profiles.list | Where-Object { $_.name -eq "novo-perfil" } + +if (-not $profile) { + Write-Host "Perfil 'novo-perfil' não encontrado." -ForegroundColor Red + exit +} + +# Criar propriedades visuais se não existirem +$props = @("colorScheme","fontFace","fontSize","cursorShape","cursorColor","initialRows","initialCols","tabTitle") + +foreach ($p in $props) { + if (-not $profile.PSObject.Properties[$p]) { + $profile | Add-Member -MemberType NoteProperty -Name $p -Value $null + } +} + +# Aplicar tema +$profile.colorScheme = "IBM-System34" +$profile.fontFace = "Cascadia Mono" +$profile.fontSize = 16 +$profile.cursorShape = "filledBox" +$profile.cursorColor = "#33FF33" +$profile.initialRows = 24 +$profile.initialCols = 80 +$profile.tabTitle = "IBM System/34" + +# Guardar ficheiro +$json | ConvertTo-Json -Depth 10 | Set-Content $settingsPath -Encoding UTF8 + +Write-Host "`nTema IBM System/34 aplicado ao perfil 'novo-perfil'!" +Write-Host "Reinicie o Windows Terminal." -ForegroundColor Green diff --git a/commandos/make-venv.ps1 b/commandos/make-venv.ps1 new file mode 100644 index 0000000000000000000000000000000000000000..06bbe1d906a938d8f4479271b5695e8321847d41 --- /dev/null +++ b/commandos/make-venv.ps1 @@ -0,0 +1,23 @@ +param( + [Parameter(Mandatory=$true)] + [string]$NomeAmbiente, + + [string]$PythonVersion = "3.10.11" +) + +$pythonExe = "C:\py\pyenv\pyenv-win\versions\$PythonVersion\python.exe" + +if (-not (Test-Path $pythonExe)) { + Write-Error "Python $PythonVersion não encontrado em $pythonExe" + exit 1 +} + +Write-Host "🐍 A criar venv '$NomeAmbiente' com Python $PythonVersion..." -ForegroundColor Cyan +& $pythonExe -m venv $NomeAmbiente + +if ($LASTEXITCODE -eq 0) { + Write-Host "✅ Venv '$NomeAmbiente' criado com sucesso." -ForegroundColor Green + Write-Host "👉 Para activar: & '.\$NomeAmbiente\Scripts\Activate.ps1'" -ForegroundColor Yellow +} else { + Write-Error "Erro ao criar o venv." +} \ No newline at end of file diff --git a/commandos/oldprofile.ps1 b/commandos/oldprofile.ps1 new file mode 100644 index 0000000000000000000000000000000000000000..2d2c253c2c6cb719bc1c8623fa7e8bfc4cffb77d --- /dev/null +++ b/commandos/oldprofile.ps1 @@ -0,0 +1,633 @@ +### PowerShell Profile Refactor +### Version 1.03 - Refactored + +$debug = $false + +# Define the path to the file that stores the last execution time +$timeFilePath = [Environment]::GetFolderPath("MyDocuments") + "\PowerShell\LastExecutionTime.txt" + +# Define the update interval in days, set to -1 to always check +$updateInterval = 7 + +if ($debug) { + Write-Host "#######################################" -ForegroundColor Red + Write-Host "# Debug mode enabled #" -ForegroundColor Red + Write-Host "# ONLY FOR DEVELOPMENT #" -ForegroundColor Red + Write-Host "# #" -ForegroundColor Red + Write-Host "# IF YOU ARE NOT DEVELOPING #" -ForegroundColor Red + Write-Host "# JUST RUN \`Update-Profile\` #" -ForegroundColor Red + Write-Host "# to discard all changes #" -ForegroundColor Red + Write-Host "# and update to the latest profile #" -ForegroundColor Red + Write-Host "# version #" -ForegroundColor Red + Write-Host "#######################################" -ForegroundColor Red +} + + +################################################################################################################################# +############ ############ +############ !!! WARNING: !!! ############ +############ ############ +############ DO NOT MODIFY THIS FILE. THIS FILE IS HASHED AND UPDATED AUTOMATICALLY. ############ +############ ANY CHANGES MADE TO THIS FILE WILL BE OVERWRITTEN BY COMMITS TO ############ +############ https://github.com/ChrisTitusTech/powershell-profile.git. ############ +############ ############ +#!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!# +############ ############ +############ IF YOU WANT TO MAKE CHANGES, USE THE Edit-Profile FUNCTION ############ +############ AND SAVE YOUR CHANGES IN THE FILE CREATED. ############ +############ ############ +################################################################################################################################# + +#opt-out of telemetry before doing anything, only if PowerShell is run as admin +if ([bool]([System.Security.Principal.WindowsIdentity]::GetCurrent()).IsSystem) { + [System.Environment]::SetEnvironmentVariable('POWERSHELL_TELEMETRY_OPTOUT', 'true', [System.EnvironmentVariableTarget]::Machine) +} + +# Initial GitHub.com connectivity check with 1 second timeout +$global:canConnectToGitHub = Test-Connection github.com -Count 1 -Quiet -TimeoutSeconds 1 + +# Import Modules and External Profiles +# Ensure Terminal-Icons module is installed before importing +if (-not (Get-Module -ListAvailable -Name Terminal-Icons)) { + Install-Module -Name Terminal-Icons -Scope CurrentUser -Force -SkipPublisherCheck +} +Import-Module -Name Terminal-Icons +$ChocolateyProfile = "$env:ChocolateyInstall\helpers\chocolateyProfile.psm1" +if (Test-Path($ChocolateyProfile)) { + Import-Module "$ChocolateyProfile" +} + +# Check for Profile Updates +function Update-Profile { + try { + $url = "https://raw.githubusercontent.com/ChrisTitusTech/powershell-profile/main/Microsoft.PowerShell_profile.ps1" + $oldhash = Get-FileHash $PROFILE + Invoke-RestMethod $url -OutFile "$env:temp/Microsoft.PowerShell_profile.ps1" + $newhash = Get-FileHash "$env:temp/Microsoft.PowerShell_profile.ps1" + if ($newhash.Hash -ne $oldhash.Hash) { + Copy-Item -Path "$env:temp/Microsoft.PowerShell_profile.ps1" -Destination $PROFILE -Force + Write-Host "Profile has been updated. Please restart your shell to reflect changes" -ForegroundColor Magenta + } else { + Write-Host "Profile is up to date." -ForegroundColor Green + } + } catch { + Write-Error "Unable to check for `$profile updates: $_" + } finally { + Remove-Item "$env:temp/Microsoft.PowerShell_profile.ps1" -ErrorAction SilentlyContinue + } +} + +# Check if not in debug mode AND (updateInterval is -1 OR file doesn't exist OR time difference is greater than the update interval) +if (-not $debug -and ` + ($updateInterval -eq -1 -or ` + -not (Test-Path $timeFilePath) -or ` + ((Get-Date) - [datetime]::ParseExact((Get-Content -Path $timeFilePath), 'yyyy-MM-dd', $null)).TotalDays -gt $updateInterval)) { + + Update-Profile + $currentTime = Get-Date -Format 'yyyy-MM-dd' + $currentTime | Out-File -FilePath $timeFilePath + +} elseif ($debug) { + Write-Warning "Skipping profile update check in debug mode" +} + +function Update-PowerShell { + try { + Write-Host "Checking for PowerShell updates..." -ForegroundColor Cyan + $updateNeeded = $false + $currentVersion = $PSVersionTable.PSVersion.ToString() + $gitHubApiUrl = "https://api.github.com/repos/PowerShell/PowerShell/releases/latest" + $latestReleaseInfo = Invoke-RestMethod -Uri $gitHubApiUrl + $latestVersion = $latestReleaseInfo.tag_name.Trim('v') + if ($currentVersion -lt $latestVersion) { + $updateNeeded = $true + } + + if ($updateNeeded) { + Write-Host "Updating PowerShell..." -ForegroundColor Yellow + Start-Process powershell.exe -ArgumentList "-NoProfile -Command winget upgrade Microsoft.PowerShell --accept-source-agreements --accept-package-agreements" -Wait -NoNewWindow + Write-Host "PowerShell has been updated. Please restart your shell to reflect changes" -ForegroundColor Magenta + } else { + Write-Host "Your PowerShell is up to date." -ForegroundColor Green + } + } catch { + Write-Error "Failed to update PowerShell. Error: $_" + } +} + +# skip in debug mode +# Check if not in debug mode AND (updateInterval is -1 OR file doesn't exist OR time difference is greater than the update interval) +if (-not $debug -and ` + ($updateInterval -eq -1 -or ` + -not (Test-Path $timeFilePath) -or ` + ((Get-Date).Date - [datetime]::ParseExact((Get-Content -Path $timeFilePath), 'yyyy-MM-dd', $null).Date).TotalDays -gt $updateInterval)) { + + Update-PowerShell + $currentTime = Get-Date -Format 'yyyy-MM-dd' + $currentTime | Out-File -FilePath $timeFilePath +} elseif ($debug) { + Write-Warning "Skipping PowerShell update in debug mode" +} + +function Clear-Cache { + # add clear cache logic here + Write-Host "Clearing cache..." -ForegroundColor Cyan + + # Clear Windows Prefetch + Write-Host "Clearing Windows Prefetch..." -ForegroundColor Yellow + Remove-Item -Path "$env:SystemRoot\Prefetch\*" -Force -ErrorAction SilentlyContinue + + # Clear Windows Temp + Write-Host "Clearing Windows Temp..." -ForegroundColor Yellow + Remove-Item -Path "$env:SystemRoot\Temp\*" -Recurse -Force -ErrorAction SilentlyContinue + + # Clear User Temp + Write-Host "Clearing User Temp..." -ForegroundColor Yellow + Remove-Item -Path "$env:TEMP\*" -Recurse -Force -ErrorAction SilentlyContinue + + # Clear Internet Explorer Cache + Write-Host "Clearing Internet Explorer Cache..." -ForegroundColor Yellow + Remove-Item -Path "$env:LOCALAPPDATA\Microsoft\Windows\INetCache\*" -Recurse -Force -ErrorAction SilentlyContinue + + Write-Host "Cache clearing completed." -ForegroundColor Green +} + +# Admin Check and Prompt Customization +$isAdmin = ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator) +function prompt { + if ($isAdmin) { "[" + (Get-Location) + "] # " } else { "[" + (Get-Location) + "] $ " } +} +$adminSuffix = if ($isAdmin) { " [ADMIN]" } else { "" } +$Host.UI.RawUI.WindowTitle = "PowerShell {0}$adminSuffix" -f $PSVersionTable.PSVersion.ToString() + +# Utility Functions +function Test-CommandExists { + param($command) + $exists = $null -ne (Get-Command $command -ErrorAction SilentlyContinue) + return $exists +} + +# Editor Configuration +$EDITOR = if (Test-CommandExists nvim) { 'nvim' } + elseif (Test-CommandExists pvim) { 'pvim' } + elseif (Test-CommandExists vim) { 'vim' } + elseif (Test-CommandExists vi) { 'vi' } + elseif (Test-CommandExists code) { 'code' } + elseif (Test-CommandExists notepad++) { 'notepad++' } + elseif (Test-CommandExists sublime_text) { 'sublime_text' } + else { 'notepad' } +Set-Alias -Name vim -Value $EDITOR + +# Quick Access to Editing the Profile +function Edit-Profile { + vim $PROFILE.CurrentUserAllHosts +} +Set-Alias -Name ep -Value Edit-Profile + +function touch($file) { "" | Out-File $file -Encoding ASCII } +function ff($name) { + Get-ChildItem -recurse -filter "*${name}*" -ErrorAction SilentlyContinue | ForEach-Object { + Write-Output "$($_.FullName)" + } +} + +# Network Utilities +function Get-PubIP { (Invoke-WebRequest http://ifconfig.me/ip).Content } + +# Open WinUtil full-release +function winutil { + irm https://christitus.com/win | iex +} + +# Open WinUtil pre-release +function winutildev { + irm https://christitus.com/windev | iex +} + +# System Utilities +function admin { + if ($args.Count -gt 0) { + $argList = $args -join ' ' + Start-Process wt -Verb runAs -ArgumentList "pwsh.exe -NoExit -Command $argList" + } else { + Start-Process wt -Verb runAs + } +} + +# Set UNIX-like aliases for the admin command, so sudo will run the command with elevated rights. +Set-Alias -Name su -Value admin + +function uptime { + try { + # find date/time format + $dateFormat = [System.Globalization.CultureInfo]::CurrentCulture.DateTimeFormat.ShortDatePattern + $timeFormat = [System.Globalization.CultureInfo]::CurrentCulture.DateTimeFormat.LongTimePattern + + # check powershell version + if ($PSVersionTable.PSVersion.Major -eq 5) { + $lastBoot = (Get-WmiObject win32_operatingsystem).LastBootUpTime + $bootTime = [System.Management.ManagementDateTimeConverter]::ToDateTime($lastBoot) + + # reformat lastBoot + $lastBoot = $bootTime.ToString("$dateFormat $timeFormat") + } else { + $lastBoot = net statistics workstation | Select-String "since" | ForEach-Object { $_.ToString().Replace('Statistics since ', '') } + $bootTime = [System.DateTime]::ParseExact($lastBoot, "$dateFormat $timeFormat", [System.Globalization.CultureInfo]::InvariantCulture) + } + + # Format the start time + $formattedBootTime = $bootTime.ToString("dddd, MMMM dd, yyyy HH:mm:ss", [System.Globalization.CultureInfo]::InvariantCulture) + " [$lastBoot]" + Write-Host "System started on: $formattedBootTime" -ForegroundColor DarkGray + + # calculate uptime + $uptime = (Get-Date) - $bootTime + + # Uptime in days, hours, minutes, and seconds + $days = $uptime.Days + $hours = $uptime.Hours + $minutes = $uptime.Minutes + $seconds = $uptime.Seconds + + # Uptime output + Write-Host ("Uptime: {0} days, {1} hours, {2} minutes, {3} seconds" -f $days, $hours, $minutes, $seconds) -ForegroundColor Blue + + } catch { + Write-Error "An error occurred while retrieving system uptime." + } +} + +function reload-profile { + & $profile +} + +function unzip ($file) { + Write-Output("Extracting", $file, "to", $pwd) + $fullFile = Get-ChildItem -Path $pwd -Filter $file | ForEach-Object { $_.FullName } + Expand-Archive -Path $fullFile -DestinationPath $pwd +} +function hb { + if ($args.Length -eq 0) { + Write-Error "No file path specified." + return + } + + $FilePath = $args[0] + + if (Test-Path $FilePath) { + $Content = Get-Content $FilePath -Raw + } else { + Write-Error "File path does not exist." + return + } + + $uri = "http://bin.christitus.com/documents" + try { + $response = Invoke-RestMethod -Uri $uri -Method Post -Body $Content -ErrorAction Stop + $hasteKey = $response.key + $url = "http://bin.christitus.com/$hasteKey" + Set-Clipboard $url + Write-Output $url + } catch { + Write-Error "Failed to upload the document. Error: $_" + } +} +function grep($regex, $dir) { + if ( $dir ) { + Get-ChildItem $dir | select-string $regex + return + } + $input | select-string $regex +} + +function df { + get-volume +} + +function sed($file, $find, $replace) { + (Get-Content $file).replace("$find", $replace) | Set-Content $file +} + +function which($name) { + Get-Command $name | Select-Object -ExpandProperty Definition +} + +function export($name, $value) { + set-item -force -path "env:$name" -value $value; +} + +function pkill($name) { + Get-Process $name -ErrorAction SilentlyContinue | Stop-Process +} + +function pgrep($name) { + Get-Process $name +} + +function head { + param($Path, $n = 10) + Get-Content $Path -Head $n +} + +function tail { + param($Path, $n = 10, [switch]$f = $false) + Get-Content $Path -Tail $n -Wait:$f +} + +# Quick File Creation +function nf { param($name) New-Item -ItemType "file" -Path . -Name $name } + +# Directory Management +function mkcd { param($dir) mkdir $dir -Force; Set-Location $dir } + +function trash($path) { + $fullPath = (Resolve-Path -Path $path).Path + + if (Test-Path $fullPath) { + $item = Get-Item $fullPath + + if ($item.PSIsContainer) { + # Handle directory + $parentPath = $item.Parent.FullName + } else { + # Handle file + $parentPath = $item.DirectoryName + } + + $shell = New-Object -ComObject 'Shell.Application' + $shellItem = $shell.NameSpace($parentPath).ParseName($item.Name) + + if ($item) { + $shellItem.InvokeVerb('delete') + Write-Host "Item '$fullPath' has been moved to the Recycle Bin." + } else { + Write-Host "Error: Could not find the item '$fullPath' to trash." + } + } else { + Write-Host "Error: Item '$fullPath' does not exist." + } +} + +### Quality of Life Aliases + +# Navigation Shortcuts +function docs { + $docs = if(([Environment]::GetFolderPath("MyDocuments"))) {([Environment]::GetFolderPath("MyDocuments"))} else {$HOME + "\Documents"} + Set-Location -Path $docs +} + +function dtop { + $dtop = if ([Environment]::GetFolderPath("Desktop")) {[Environment]::GetFolderPath("Desktop")} else {$HOME + "\Documents"} + Set-Location -Path $dtop +} + +# Simplified Process Management +function k9 { Stop-Process -Name $args[0] } + +# Enhanced Listing +function la { Get-ChildItem | Format-Table -AutoSize } +function ll { Get-ChildItem -Force | Format-Table -AutoSize } + +# Git Shortcuts +function gs { git status } + +function ga { git add . } + +function gc { param($m) git commit -m "$m" } + +function gp { git push } + +function g { __zoxide_z github } + +function gcl { git clone "$args" } + +function gcom { + git add . + git commit -m "$args" +} +function lazyg { + git add . + git commit -m "$args" + git push +} + +# Quick Access to System Information +function sysinfo { Get-ComputerInfo } + +# Networking Utilities +function flushdns { + Clear-DnsClientCache + Write-Host "DNS has been flushed" +} + +# Clipboard Utilities +function cpy { Set-Clipboard $args[0] } + +function pst { Get-Clipboard } + +# Enhanced PowerShell Experience +# Enhanced PSReadLine Configuration +$PSReadLineOptions = @{ + EditMode = 'Windows' + HistoryNoDuplicates = $true + HistorySearchCursorMovesToEnd = $true + Colors = @{ + Command = '#87CEEB' # SkyBlue (pastel) + Parameter = '#98FB98' # PaleGreen (pastel) + Operator = '#FFB6C1' # LightPink (pastel) + Variable = '#DDA0DD' # Plum (pastel) + String = '#FFDAB9' # PeachPuff (pastel) + Number = '#B0E0E6' # PowderBlue (pastel) + Type = '#F0E68C' # Khaki (pastel) + Comment = '#D3D3D3' # LightGray (pastel) + Keyword = '#8367c7' # Violet (pastel) + Error = '#FF6347' # Tomato (keeping it close to red for visibility) + } + PredictionSource = 'History' + PredictionViewStyle = 'ListView' + BellStyle = 'None' +} +Set-PSReadLineOption @PSReadLineOptions + +# Custom key handlers +Set-PSReadLineKeyHandler -Key UpArrow -Function HistorySearchBackward +Set-PSReadLineKeyHandler -Key DownArrow -Function HistorySearchForward +Set-PSReadLineKeyHandler -Key Tab -Function MenuComplete +Set-PSReadLineKeyHandler -Chord 'Ctrl+d' -Function DeleteChar +Set-PSReadLineKeyHandler -Chord 'Ctrl+w' -Function BackwardDeleteWord +Set-PSReadLineKeyHandler -Chord 'Alt+d' -Function DeleteWord +Set-PSReadLineKeyHandler -Chord 'Ctrl+LeftArrow' -Function BackwardWord +Set-PSReadLineKeyHandler -Chord 'Ctrl+RightArrow' -Function ForwardWord +Set-PSReadLineKeyHandler -Chord 'Ctrl+z' -Function Undo +Set-PSReadLineKeyHandler -Chord 'Ctrl+y' -Function Redo + +# Custom functions for PSReadLine +Set-PSReadLineOption -AddToHistoryHandler { + param($line) + $sensitive = @('password', 'secret', 'token', 'apikey', 'connectionstring') + $hasSensitive = $sensitive | Where-Object { $line -match $_ } + return ($null -eq $hasSensitive) +} + +# Improved prediction settings +Set-PSReadLineOption -PredictionSource HistoryAndPlugin +Set-PSReadLineOption -MaximumHistoryCount 10000 + +# Custom completion for common commands +$scriptblock = { + param($wordToComplete, $commandAst, $cursorPosition) + $customCompletions = @{ + 'git' = @('status', 'add', 'commit', 'push', 'pull', 'clone', 'checkout') + 'npm' = @('install', 'start', 'run', 'test', 'build') + 'deno' = @('run', 'compile', 'bundle', 'test', 'lint', 'fmt', 'cache', 'info', 'doc', 'upgrade') + } + + $command = $commandAst.CommandElements[0].Value + if ($customCompletions.ContainsKey($command)) { + $customCompletions[$command] | Where-Object { $_ -like "$wordToComplete*" } | ForEach-Object { + [System.Management.Automation.CompletionResult]::new($_, $_, 'ParameterValue', $_) + } + } +} +Register-ArgumentCompleter -Native -CommandName git, npm, deno -ScriptBlock $scriptblock + +$scriptblock = { + param($wordToComplete, $commandAst, $cursorPosition) + dotnet complete --position $cursorPosition $commandAst.ToString() | + ForEach-Object { + [System.Management.Automation.CompletionResult]::new($_, $_, 'ParameterValue', $_) + } +} +Register-ArgumentCompleter -Native -CommandName dotnet -ScriptBlock $scriptblock + + +# Get theme from profile.ps1 or use a default theme +function Get-Theme { + if (Test-Path -Path $PROFILE.CurrentUserAllHosts -PathType leaf) { + $existingTheme = Select-String -Raw -Path $PROFILE.CurrentUserAllHosts -Pattern "oh-my-posh init pwsh --config" + if ($null -ne $existingTheme) { + Invoke-Expression $existingTheme + return + } + if (Get-Command oh-my-posh -ErrorAction SilentlyContinue) { + oh-my-posh init pwsh --config https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/paradox.omp.json | Invoke-Expression + } + + } else { + oh-my-posh init pwsh --config https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/cobalt2.omp.json | Invoke-Expression + } +} + +## Final Line to set prompt +Get-Theme +if (Get-Command zoxide -ErrorAction SilentlyContinue) { + Invoke-Expression (& { (zoxide init --cmd cd powershell | Out-String) }) +} else { + Write-Host "zoxide command not found. Attempting to install via winget..." + try { + winget install -e --id ajeetdsouza.zoxide + Write-Host "zoxide installed successfully. Initializing..." + Invoke-Expression (& { (zoxide init powershell | Out-String) }) + } catch { + Write-Error "Failed to install zoxide. Error: $_" + } +} + +Set-Alias -Name z -Value __zoxide_z -Option AllScope -Scope Global -Force +Set-Alias -Name zi -Value __zoxide_zi -Option AllScope -Scope Global -Force + +# Help Function +function Show-Help { + $helpText = @" +$($PSStyle.Foreground.Cyan)PowerShell Profile Help$($PSStyle.Reset) +$($PSStyle.Foreground.Yellow)=======================$($PSStyle.Reset) + +$($PSStyle.Foreground.Green)Update-Profile$($PSStyle.Reset) - Checks for profile updates from a remote repository and updates if necessary. + +$($PSStyle.Foreground.Green)Update-PowerShell$($PSStyle.Reset) - Checks for the latest PowerShell release and updates if a new version is available. + +$($PSStyle.Foreground.Green)Edit-Profile$($PSStyle.Reset) - Opens the current user's profile for editing using the configured editor. + +$($PSStyle.Foreground.Green)touch$($PSStyle.Reset) - Creates a new empty file. + +$($PSStyle.Foreground.Green)ff$($PSStyle.Reset) - Finds files recursively with the specified name. + +$($PSStyle.Foreground.Green)Get-PubIP$($PSStyle.Reset) - Retrieves the public IP address of the machine. + +$($PSStyle.Foreground.Green)winutil$($PSStyle.Reset) - Runs the latest WinUtil full-release script from Chris Titus Tech. + +$($PSStyle.Foreground.Green)winutildev$($PSStyle.Reset) - Runs the latest WinUtil pre-release script from Chris Titus Tech. + +$($PSStyle.Foreground.Green)uptime$($PSStyle.Reset) - Displays the system uptime. + +$($PSStyle.Foreground.Green)reload-profile$($PSStyle.Reset) - Reloads the current user's PowerShell profile. + +$($PSStyle.Foreground.Green)unzip$($PSStyle.Reset) - Extracts a zip file to the current directory. + +$($PSStyle.Foreground.Green)hb$($PSStyle.Reset) - Uploads the specified file's content to a hastebin-like service and returns the URL. + +$($PSStyle.Foreground.Green)grep$($PSStyle.Reset) [dir] - Searches for a regex pattern in files within the specified directory or from the pipeline input. + +$($PSStyle.Foreground.Green)df$($PSStyle.Reset) - Displays information about volumes. + +$($PSStyle.Foreground.Green)sed$($PSStyle.Reset) - Replaces text in a file. + +$($PSStyle.Foreground.Green)which$($PSStyle.Reset) - Shows the path of the command. + +$($PSStyle.Foreground.Green)export$($PSStyle.Reset) - Sets an environment variable. + +$($PSStyle.Foreground.Green)pkill$($PSStyle.Reset) - Kills processes by name. + +$($PSStyle.Foreground.Green)pgrep$($PSStyle.Reset) - Lists processes by name. + +$($PSStyle.Foreground.Green)head$($PSStyle.Reset) [n] - Displays the first n lines of a file (default 10). + +$($PSStyle.Foreground.Green)tail$($PSStyle.Reset) [n] - Displays the last n lines of a file (default 10). + +$($PSStyle.Foreground.Green)nf$($PSStyle.Reset) - Creates a new file with the specified name. + +$($PSStyle.Foreground.Green)mkcd$($PSStyle.Reset) - Creates and changes to a new directory. + +$($PSStyle.Foreground.Green)docs$($PSStyle.Reset) - Changes the current directory to the user's Documents folder. + +$($PSStyle.Foreground.Green)dtop$($PSStyle.Reset) - Changes the current directory to the user's Desktop folder. + +$($PSStyle.Foreground.Green)ep$($PSStyle.Reset) - Opens the profile for editing. + +$($PSStyle.Foreground.Green)k9$($PSStyle.Reset) - Kills a process by name. + +$($PSStyle.Foreground.Green)la$($PSStyle.Reset) - Lists all files in the current directory with detailed formatting. + +$($PSStyle.Foreground.Green)ll$($PSStyle.Reset) - Lists all files, including hidden, in the current directory with detailed formatting. + +$($PSStyle.Foreground.Green)gs$($PSStyle.Reset) - Shortcut for 'git status'. + +$($PSStyle.Foreground.Green)ga$($PSStyle.Reset) - Shortcut for 'git add .'. + +$($PSStyle.Foreground.Green)gc$($PSStyle.Reset) - Shortcut for 'git commit -m'. + +$($PSStyle.Foreground.Green)gp$($PSStyle.Reset) - Shortcut for 'git push'. + +$($PSStyle.Foreground.Green)g$($PSStyle.Reset) - Changes to the GitHub directory. + +$($PSStyle.Foreground.Green)gcom$($PSStyle.Reset) - Adds all changes and commits with the specified message. + +$($PSStyle.Foreground.Green)lazyg$($PSStyle.Reset) - Adds all changes, commits with the specified message, and pushes to the remote repository. + +$($PSStyle.Foreground.Green)sysinfo$($PSStyle.Reset) - Displays detailed system information. + +$($PSStyle.Foreground.Green)flushdns$($PSStyle.Reset) - Clears the DNS cache. + +$($PSStyle.Foreground.Green)cpy$($PSStyle.Reset) - Copies the specified text to the clipboard. + +$($PSStyle.Foreground.Green)pst$($PSStyle.Reset) - Retrieves text from the clipboard. + +Use '$($PSStyle.Foreground.Magenta)Show-Help$($PSStyle.Reset)' to display this help message. +"@ + Write-Host $helpText +} + +if (Test-Path "$PSScriptRoot\CTTcustom.ps1") { + Invoke-Expression -Command "& `"$PSScriptRoot\CTTcustom.ps1`"" +} + +Write-Host "$($PSStyle.Foreground.Yellow)Use 'Show-Help' to display help$($PSStyle.Reset)" diff --git a/commandos/ollama-dev.bat b/commandos/ollama-dev.bat new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/commandos/ollama-gemini.bat b/commandos/ollama-gemini.bat new file mode 100644 index 0000000000000000000000000000000000000000..5e45bbde673f4a167157741c0ad747ec96126fe6 --- /dev/null +++ b/commandos/ollama-gemini.bat @@ -0,0 +1,66 @@ +@echo off +setlocal enabledelayedexpansion + +:: Default model +if "%OLLAMA_MODEL%"=="" ( + set "OLLAMA_MODEL=qwen3.5:latest" +) + +:: Banner estilo Gemini +echo. +echo ▝▜▄ Ollama CLI v1.0 (Gemini Style) +echo ▝▜▄ +echo ▗▟▀ Running locally with Ollama +echo ▝▀ Model: %OLLAMA_MODEL% +echo. +echo ╭──────────────────────────────────────────────────────────────────────────────╮ +echo │ This is a local, private AI environment powered by Ollama. │ +echo │ No API keys, no cloud, no tracking — everything runs on your machine. │ +echo │ │ +echo │ Commands: │ +echo │ ollama-gemini prompt "texto" │ +echo │ ollama-gemini chat │ +echo │ ollama-gemini model nome_do_modelo │ +echo ╰──────────────────────────────────────────────────────────────────────────────╯ +echo. + +:: Comando: model +if "%1"=="model" ( + if "%2"=="" ( + echo Current model: %OLLAMA_MODEL% + exit /b + ) + set "OLLAMA_MODEL=%2" + echo Model switched to: %OLLAMA_MODEL% + exit /b +) + +:: Comando: prompt +if "%1"=="prompt" ( + set "TEXT=%~2" + if "%TEXT%"=="" ( + echo Error: Missing text. + exit /b + ) + ollama run %OLLAMA_MODEL% "%TEXT%" + exit /b +) + +:: Comando: chat +if "%1"=="chat" ( + echo Starting chat with model: %OLLAMA_MODEL% + echo Type 'exit' to quit. + echo. + + :chatloop + set /p "USER=> " + if "%USER%"=="exit" exit /b + if "%USER%"=="" goto chatloop + + ollama run %OLLAMA_MODEL% "%USER%" + echo. + goto chatloop +) + +echo Unknown command. +exit /b diff --git a/commandos/openclaw-tui.bat b/commandos/openclaw-tui.bat new file mode 100644 index 0000000000000000000000000000000000000000..748bfa2ffc491ac1290a388a371f74f7b4c47215 --- /dev/null +++ b/commandos/openclaw-tui.bat @@ -0,0 +1,20 @@ +@echo off +REM OpenClaw Gateway TUI Launcher +REM This script launches the OpenClaw Gateway TUI from any location + +echo Starting OpenClaw Gateway TUI... +echo. + +REM Change to the OpenClaw working directory +cd /d "C:\Users\luisf\clawd" + +REM Launch the OpenClaw Gateway TUI +openclaw gateway tui + +REM Pause to see any error messages +if errorlevel 1 ( + echo. + echo Error: OpenClaw may not be installed or not in PATH + echo Please make sure OpenClaw is properly installed + pause +) \ No newline at end of file diff --git a/commandos/paths.bat b/commandos/paths.bat new file mode 100644 index 0000000000000000000000000000000000000000..bb6aafd5ae812e124d90c0e9d06c3e1c7ac191b1 --- /dev/null +++ b/commandos/paths.bat @@ -0,0 +1,20 @@ +@echo off +setlocal + +:: Define os caminhos que você deseja adicionar ao PATH +set "pathsToAdd=C:\ProgramData\Anaconda3;C:\ProgramData\anaconda3\condabin" + +:: Obtém o PATH atual do sistema +for /f "tokens=2* delims= " %%a in ('reg query "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment" /v Path') do set currentPath=%%b + +:: Adiciona os novos caminhos ao PATH atual +set newPath=%currentPath%;%pathsToAdd% + +:: Define o novo PATH no sistema +reg add "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment" /v Path /t REG_EXPAND_SZ /d "%newPath%" /f + +:: Exibe o novo PATH para verificação +echo Novo PATH: %newPath% + +endlocal +pause diff --git a/commandos/py10.bat b/commandos/py10.bat new file mode 100644 index 0000000000000000000000000000000000000000..527564b6dccce9b90051640def1374cdeb06c350 --- /dev/null +++ b/commandos/py10.bat @@ -0,0 +1,2 @@ +@echo off +"C:\Users\luisf\AppData\Local\Programs\Python\Python310\python.exe" %* diff --git a/commandos/reinstalador.bat b/commandos/reinstalador.bat new file mode 100644 index 0000000000000000000000000000000000000000..67653d859b916edbc471438b3c834338ba5761d9 --- /dev/null +++ b/commandos/reinstalador.bat @@ -0,0 +1,51 @@ +:: 1) Reparar imagem do Windows (WinSxS + CBS) +DISM /Online /Cleanup-Image /RestoreHealth + +:: 2) Reparar ficheiros do sistema +sfc /scannow + +:: 3) Reinstalar Windows Update + Microsoft Update +powershell -command "Set-Service wuauserv -StartupType Automatic" +powershell -command "Set-Service bits -StartupType Automatic" +powershell -command "Set-Service cryptsvc -StartupType Automatic" +powershell -command "Set-Service trustedinstaller -StartupType Manual" + +net stop wuauserv +net stop bits +net stop cryptsvc +net stop trustedinstaller + +rd /s /q %windir%\SoftwareDistribution +rd /s /q %windir%\System32\catroot2 + +net start wuauserv +net start bits +net start cryptsvc +net start trustedinstaller + +:: 4) Reinstalar Microsoft Store e dependências (CORRIGIDO) +powershell -command "Get-AppxPackage -allusers Microsoft.WindowsStore | ForEach-Object { Add-AppxPackage -DisableDevelopmentMode -Register \"$($_.InstallLocation)\AppxManifest.xml\" }" + +:: 5) Reinstalar WebView2 (essencial para apps modernas) +winget install Microsoft.EdgeWebView2Runtime --silent --force + +:: 6) Reinstalar .NET runtimes essenciais +winget install Microsoft.DotNet.Runtime.6 --silent --force +winget install Microsoft.DotNet.Runtime.7 --silent --force +winget install Microsoft.DotNet.Runtime.8 --silent --force + +:: 7) Reinstalar PowerShell +winget install Microsoft.PowerShell --silent --force + +:: 8) Reinstalar WSL (inclui fetch_events) +wsl --install +wsl --update + +:: 9) Reinstalar drivers OEM via Windows Update (CORRIGIDO) +powershell -command "Install-WindowsUpdate -MicrosoftUpdate -AcceptAll -AutoReboot" + +:: 10) Reinstalar componentes opcionais essenciais +DISM /Online /Add-Capability /CapabilityName:WMIC~~~~ +DISM /Online /Add-Capability /CapabilityName:Rsat.Tools~~~~ +DISM /Online /Add-Capability /CapabilityName:OpenSSH.Client~~~~ +DISM /Online /Add-Capability /CapabilityName:OpenSSH.Server~~~~ diff --git a/commandos/reintalador.bat b/commandos/reintalador.bat new file mode 100644 index 0000000000000000000000000000000000000000..ab436a08b1b02f124f196ed5e22a494c7175bff9 --- /dev/null +++ b/commandos/reintalador.bat @@ -0,0 +1,49 @@ +:: 1) Reparar imagem do Windows (WinSxS + CBS) +DISM /Online /Cleanup-Image /RestoreHealth + +:: 2) Reparar ficheiros do sistema +sfc /scannow + +:: 3) Reinstalar Windows Update + Microsoft Update +powershell -command "Set-Service wuauserv -StartupType Automatic" +powershell -command "Set-Service bits -StartupType Automatic" +powershell -command "Set-Service cryptsvc -StartupType Automatic" +powershell -command "Set-Service trustedinstaller -StartupType Manual" +net stop wuauserv +net stop bits +net stop cryptsvc +net stop trustedinstaller +del /f /s /q %windir%\SoftwareDistribution +del /f /s /q %windir%\System32\catroot2 +net start wuauserv +net start bits +net start cryptsvc +net start trustedinstaller + +:: 4) Reinstalar Microsoft Store e dependências +powershell -command "Get-AppxPackage -allusers Microsoft.WindowsStore | Reset-AppxPackage" +powershell -command "Get-AppxPackage -allusers Microsoft.WindowsStore | Add-AppxPackage -Register" + +:: 5) Reinstalar WebView2 (essencial para apps modernas) +winget install Microsoft.EdgeWebView2Runtime --silent --force + +:: 6) Reinstalar .NET runtimes essenciais +winget install Microsoft.DotNet.Runtime.6 --silent --force +winget install Microsoft.DotNet.Runtime.7 --silent --force +winget install Microsoft.DotNet.Runtime.8 --silent --force + +:: 7) Reinstalar PowerShell +winget install Microsoft.PowerShell --silent --force + +:: 8) Reinstalar WSL (inclui fetch_events) +wsl --install +wsl --update + +:: 9) Reinstalar drivers OEM via Windows Update +powershell -command "Install-WindowsUpdate -MicrosoftUpdate -AcceptAll -AutoReboot" + +:: 10) Reinstalar componentes opcionais essenciais +DISM /Online /Add-Capability /CapabilityName:WMIC~~~~ +DISM /Online /Add-Capability /CapabilityName:Rsat.Tools~~~~ +DISM /Online /Add-Capability /CapabilityName:OpenSSH.Client~~~~ +DISM /Online /Add-Capability /CapabilityName:OpenSSH.Server~~~~ diff --git a/commandos/run.bat b/commandos/run.bat new file mode 100644 index 0000000000000000000000000000000000000000..5fc4f93821320c7a53e6e9709fb5287cf627e838 --- /dev/null +++ b/commandos/run.bat @@ -0,0 +1,9 @@ + +net session >nul 2>&1 +if %ERRORLEVEL% NEQ 0 ( + echo Requesting administrative privileges... + powershell -Command "Start-Process -FilePath 'cmd.exe' -ArgumentList '/c \"\"%~f0\"\"' -Verb RunAs" + exit /b +) + +"%~dp0PsExec" -i -s -d "%~dp0AsusFanControlGUI.exe" diff --git a/commandos/run_candidaturas.bat b/commandos/run_candidaturas.bat new file mode 100644 index 0000000000000000000000000000000000000000..ce64d97d9a7fe8b9d8ae6f70e4155543d15e0de8 --- /dev/null +++ b/commandos/run_candidaturas.bat @@ -0,0 +1 @@ +python "C:\Users\luisf\Desktop\html-apps\candidaturas\envio-carta.py" \ No newline at end of file diff --git a/commandos/runme.bat b/commandos/runme.bat new file mode 100644 index 0000000000000000000000000000000000000000..94ab21f04e3ee210c0d0e6dfa5440e99293f4032 --- /dev/null +++ b/commandos/runme.bat @@ -0,0 +1,4 @@ +@echo off +python Senhorize.py +E:\intelFPGA_lite\17.0\quartus\bin64\quartus_sh.exe --flow compile %1 +pause \ No newline at end of file diff --git a/commandos/scan-build.bat b/commandos/scan-build.bat new file mode 100644 index 0000000000000000000000000000000000000000..77be6746318f117ff8ebf205663b15f004a1655e --- /dev/null +++ b/commandos/scan-build.bat @@ -0,0 +1 @@ +perl -S scan-build %* diff --git a/commandos/setup-cuda.bat b/commandos/setup-cuda.bat new file mode 100644 index 0000000000000000000000000000000000000000..875f64537a7a4c6a2a08aa270981e3952d70270d --- /dev/null +++ b/commandos/setup-cuda.bat @@ -0,0 +1,43 @@ +@echo off +setlocal enabledelayedexpansion + +echo === Setup CUDA 12.2 + cuDNN 9 para ComfyUI === + +:: 1. Remover onnxruntime antigo +echo >> A remover onnxruntime antigo... +pip uninstall -y onnxruntime onnxruntime-gpu + +:: 2. Instalar onnxruntime-gpu 1.22.0 +echo >> A instalar onnxruntime-gpu 1.22.0... +pip install --upgrade pip +pip install onnxruntime-gpu==1.22.0 + +:: 3. Preparar paths temporários +set CUDA_EXE=%TEMP%\cuda_12.2_installer.exe +set CUDNN_ZIP=C:\Temp\cudnn9.zip + +:: 4. Descarregar e instalar CUDA 12.2 +if not exist "%CUDA_EXE%" ( + echo >> A descarregar CUDA 12.2... + powershell -Command "Invoke-WebRequest -Uri https://developer.download.nvidia.com/compute/cuda/12.2.0/local_installers/cuda_12.2.0_windows_network.exe -OutFile '%CUDA_EXE%'" +) +echo >> A instalar CUDA 12.2 (isto pode demorar)... +start /wait "" "%CUDA_EXE%" -s + +:: 5. Instalar cuDNN 9 (tens de meter manualmente em C:\Temp\cudnn9.zip) +if exist "%CUDNN_ZIP%" ( + echo >> A extrair cuDNN... + 7z x "%CUDNN_ZIP%" -oC:\Temp\cudnn -y + + echo >> A copiar ficheiros cuDNN... + xcopy /s /y "C:\Temp\cudnn\bin\*.dll" "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.2\bin\" + xcopy /s /y "C:\Temp\cudnn\include\*.h" "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.2\include\" + xcopy /s /y "C:\Temp\cudnn\lib\x64\*.lib" "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.2\lib\x64\" +) else ( + echo ⚠️ Não encontrei %CUDNN_ZIP%. Mete manualmente em C:\Temp. +) + +:: 6. Configurar variáveis de ambiente +echo >> A configurar variáveis de ambiente... +setx CUDA_PATH "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.2" /M +setx PATH "%PATH%;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.2\bin;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12. diff --git a/commandos/start_agent_diagnostic.bat b/commandos/start_agent_diagnostic.bat new file mode 100644 index 0000000000000000000000000000000000000000..4e0804d76d0024bb6bce9316871ea283888d35cf --- /dev/null +++ b/commandos/start_agent_diagnostic.bat @@ -0,0 +1,36 @@ +@echo off +echo Starting Agent Zero with diagnostics... +echo Current time: %date% %time% +echo. + +echo Changing to Agent Zero directory... +cd /d "D:\agente-zero" +echo Current directory: %cd% +echo. + +echo Activating virtual environment... +call venv\Scripts\activate.bat +echo Virtual environment activated: %VIRTUAL_ENV% +echo. + +echo Checking if run_ui.py exists... +if exist "run_ui.py" ( + echo run_ui.py found +) else ( + echo ERROR: run_ui.py not found! +) +echo. + +echo Checking Python executable... +where python +echo. + +echo Starting Agent Zero Web UI with logging... +echo Log will be saved to agent_zero_log.txt +echo Starting at %date% %time% >> agent_zero_log.txt +python run_ui.py >> agent_zero_log.txt 2>&1 +echo Finished at %date% %time% >> agent_zero_log.txt + +echo. +echo Process completed. Check agent_zero_log.txt for details if issues occurred. +pause \ No newline at end of file diff --git a/commandos/start_master_cli.bat b/commandos/start_master_cli.bat new file mode 100644 index 0000000000000000000000000000000000000000..363177c43b3b88fe5f03c57c3508f79805e1b48c --- /dev/null +++ b/commandos/start_master_cli.bat @@ -0,0 +1,25 @@ +@echo off +setlocal +cd /d C:\Users\luisf\master-cli + +:: Caminho para o Python do ambiente virtual +set "PY=C:\Users\luisf\master-cli\venv\Scripts\python.exe" + +:: Se o ambiente virtual nao existir, cria-o +if not exist "%PY%" ( + echo [CONFIGURACAO] A criar ambiente virtual pela primeira vez... + python -m venv venv +) + +echo [DEPENDENCIAS] A verificar bibliotecas... +"%PY%" -m pip install -r requirements.txt --quiet + +echo [ARRANQUE] A iniciar Master CLI GUI... +"%PY%" app.py + +if %ERRORLEVEL% NEQ 0 ( + echo. + echo [AVISO] A aplicacao fechou com erro %ERRORLEVEL%. + pause +) +endlocal diff --git a/commandos/startbot.bat b/commandos/startbot.bat new file mode 100644 index 0000000000000000000000000000000000000000..920dfb3a21be12031b5b6b2a516054b83966aff4 --- /dev/null +++ b/commandos/startbot.bat @@ -0,0 +1,6 @@ +@echo off +:: Adiciona o PowerShell 5 e o PowerShell 7 ao caminho do sistema para esta sessão +set PATH=%PATH%;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\PowerShell\7\ + +:: Inicia o bot +ollama launch clawdbot \ No newline at end of file diff --git a/commandos/sysinfo.ps1 b/commandos/sysinfo.ps1 new file mode 100644 index 0000000000000000000000000000000000000000..1c98aa598208035b8649eb31645230b9be303de9 --- /dev/null +++ b/commandos/sysinfo.ps1 @@ -0,0 +1,40 @@ +<# +.SYNOPSIS + sysinfo - Exibir informações gerais do sistema Windows. + +.DESCRIPTION + Mostra informações básicas do sistema operacional: nome, versão, + arquitetura, uptime, hostname, usuário atual, memória total. + +.PARAMETER Verbose + Mostra detalhes adicionais sobre o sistema. + +.EXAMPLE + sysinfo + sysinfo -verbose +#> + +Function Global:SysInfo { + [CmdletBinding()] + Param( + [switch]$Json + ) + + $osInfo = Get-ItemProperty -Path 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion' -ErrorAction SilentlyContinue + $info = @{ + Hostname = $env:COMPUTERNAME + Architecture = $env:PROCESSOR_ARCHITECTURE + Platform = $env:OS + Edition = $osInfo.ProductName + BuildNumber = if ($osInfo.CurrentBuildNumber) { $osInfo.CurrentBuildNumber } else { 0 } + CPUs = (Get-CimInstance Win32_Processor).Count + Ram = [math]::Round((Get-CimInstance Win32_ComputerSystem).TotalPhysicalMemory / 1MB, 0) + BiosDate = (Get-CimInstance Win32_Bios).ReleaseDate + } + + if ($Json) { + $info | ConvertTo-Json -Depth 10 + } else { + $info | Format-List + } +} diff --git a/commandos/telegram-sender.bat b/commandos/telegram-sender.bat new file mode 100644 index 0000000000000000000000000000000000000000..5cb1eef533c2fd8b389d92c2bfdc679c2c3c3102 --- /dev/null +++ b/commandos/telegram-sender.bat @@ -0,0 +1,31 @@ +import requests +from telegram import Update +from telegram.ext import ApplicationBuilder, MessageHandler, filters, ContextTypes + +TELEGRAM_TOKEN = "8271190956:AAEWohbxwfJGTSsoKiKHsPjpaXVTLsW4Zwk" +OLLAMA_URL = "http://localhost:11434/api/generate" +MODEL = "clawdbot" + +async def handle_message(update: Update, context: ContextTypes.DEFAULT_TYPE): + user_text = update.message.text + + # Enviar para o Clawdbot via Ollama + payload = { + "model": MODEL, + "prompt": user_text, + "stream": False + } + + response = requests.post(OLLAMA_URL, json=payload) + reply = response.json().get("response", "Erro ao contactar o Clawdbot.") + + # Responder ao Telegram + await update.message.reply_text(reply) + +def main(): + app = ApplicationBuilder().token(TELEGRAM_TOKEN).build() + app.add_handler(MessageHandler(filters.TEXT & ~filters.COMMAND, handle_message)) + app.run_polling() + +if __name__ == "__main__": + main() diff --git a/commandos/terminal-ssh.bat b/commandos/terminal-ssh.bat new file mode 100644 index 0000000000000000000000000000000000000000..318400f4bf748f0a6ecf500a773dcc3623f362a3 --- /dev/null +++ b/commandos/terminal-ssh.bat @@ -0,0 +1,24 @@ +@echo off +setlocal + +REM Batch file para iniciar o MobaXterm Portable +REM Localização do executável + +set "MOBAXTERM_PATH=C:\MobaXterm_Portable_v25.4\MobaXterm_Personal_25.4.exe" + +REM Verifica se o arquivo existe +if not exist "%MOBAXTERM_PATH%" ( + echo Erro: Arquivo nao encontrado em %MOBAXTERM_PATH% + echo Por favor, verifique se o caminho esta correto. + pause + exit /b 1 +) + +echo Iniciando MobaXterm... +echo Caminho: %MOBAXTERM_PATH% + +REM Inicia o MobaXterm +start "" "%MOBAXTERM_PATH%" + +echo MobaXterm iniciado com sucesso! +pause \ No newline at end of file diff --git a/commandos/test_agent.bat b/commandos/test_agent.bat new file mode 100644 index 0000000000000000000000000000000000000000..476fe079c74e5bcbb22f6da3d102a416eb2bd9f6 --- /dev/null +++ b/commandos/test_agent.bat @@ -0,0 +1,9 @@ +@echo off +echo Testing Agent Zero startup... +cd /d "D:\agente-zero" +echo Activating virtual environment... +call venv\Scripts\activate.bat +echo Attempting to run agent... +python -c "import sys; print('Python executable:', sys.executable); import agent; print('Agent module imported successfully')" +echo If no errors above, the agent is working properly. +pause \ No newline at end of file diff --git a/commandos/thisroot.ps1 b/commandos/thisroot.ps1 new file mode 100644 index 0000000000000000000000000000000000000000..603baec65a8bfafc68d3aa1ff49af328c4c0ce9f --- /dev/null +++ b/commandos/thisroot.ps1 @@ -0,0 +1,7 @@ +rem The `latest-stable` branch gets updated automatically on each release. +rem You may update your local copy by issuing a `git pull` command from within `root_src`. +C:\Users\luisf>git clone --branch latest-stable --depth=1 https://github.com/root-project/root.git root_src +C:\Users\luisf>mkdir root_build root_install && cd root_build +C:\Users\luisf>cmake -G"Visual Studio 16 2019" -A Win32 -Thost=x64 -DCMAKE_VERBOSE_MAKEFILE=ON -DCMAKE_INSTALL_PREFIX=../root_install ../root_src +C:\Users\luisf>cmake --build . --config Release --target install +C:\Users\luisf>..\root_install\bin\thisroot.bat \ No newline at end of file diff --git a/commandos/trans-nod-128-126.bat b/commandos/trans-nod-128-126.bat new file mode 100644 index 0000000000000000000000000000000000000000..90a985aef138a347b8843ca7c371245d730814ef --- /dev/null +++ b/commandos/trans-nod-128-126.bat @@ -0,0 +1,11 @@ +@echo off +setlocal + +set "SRC=D:\ComfyUI_windows_portable_nvidia_cu128\ComfyUI_windows_portable\ComfyUI\custom_nodes" +set "DST=D:\ComfyUI_windows_portable_nvidia_cu126\ComfyUI_windows_portable\ComfyUI\custom_nodes" + +robocopy "%SRC%" "%DST%" /MOVE /E /R:3 /W:5 /MT:16 /TEE /LOG:robocopy_move_custom_nodes.log + +echo. +echo Movimento concluido. +pause \ No newline at end of file diff --git a/commandos/trans128-126.bat b/commandos/trans128-126.bat new file mode 100644 index 0000000000000000000000000000000000000000..e5bb4361bc1ca8bc0c751c7e1337725800331f1b --- /dev/null +++ b/commandos/trans128-126.bat @@ -0,0 +1,11 @@ +@echo off +setlocal + +set "SRC=D:\ComfyUI_windows_portable_nvidia_cu128\ComfyUI_windows_portable\ComfyUI\models" +set "DST=D:\ComfyUI_windows_portable_nvidia_cu126\ComfyUI_windows_portable\ComfyUI\models" + +robocopy "%SRC%" "%DST%" /MOVE /E /R:3 /W:5 /MT:16 /V /TEE /LOG:robocopy_move_models.log + +echo. +echo Movimento concluido. +pause \ No newline at end of file diff --git a/commandos/update_packages.bat b/commandos/update_packages.bat new file mode 100644 index 0000000000000000000000000000000000000000..cd064254a1f9dd39e61571d507320057133f9478 --- /dev/null +++ b/commandos/update_packages.bat @@ -0,0 +1,10 @@ +with open("x", "r") as file: + lines = file.readlines() + +for line in lines: + # Ignora a primeira linha que contém os cabeçalhos da tabela + if line.startswith("Package"): + continue + package_name = line.split()[0] + print(f"Atualizando {package_name}...") + os.system(f"pip install --upgrade {package_name}") diff --git a/commandos/vcom_all.bat b/commandos/vcom_all.bat new file mode 100644 index 0000000000000000000000000000000000000000..bcd0328ef0d834460c98a7c9a40199605b1971c8 --- /dev/null +++ b/commandos/vcom_all.bat @@ -0,0 +1,24 @@ + +vcom -93 -quiet -work sim/tb ^ +../system/src/tb/globals.vhd + +vcom -93 -quiet -work sim/mem ^ +../../rtl/SyncFifo.vhd ^ +../../rtl/SyncFifoFallThrough.vhd ^ +../../rtl/SyncRam.vhd + +vcom -2008 -quiet -work sim/psx ^ +../../rtl/dpram.vhd ^ +../../rtl/cd_xa_zigzag.vhd ^ +../../rtl/cd_xa.vhd ^ +../../rtl/cd_top.vhd + +vcom -93 -quiet -work sim/mem ^ +../system/src/mem/dpram.vhd ^ +../system/src/mem/RamMLAB.vhd + +vcom -quiet -work sim/tb ^ +../system/src/tb/sdram_model.vhd ^ +../system/src/tb/tb_savestates.vhd ^ +src/tb/tb.vhd + diff --git a/commandos/ve-out.bat b/commandos/ve-out.bat new file mode 100644 index 0000000000000000000000000000000000000000..6d3fce6ac47086f7b027da7d02f3b80f6b6bf1ce --- /dev/null +++ b/commandos/ve-out.bat @@ -0,0 +1 @@ +pip list --outdated > x \ No newline at end of file diff --git a/commandos/vmap_all.bat b/commandos/vmap_all.bat new file mode 100644 index 0000000000000000000000000000000000000000..8dce844231fd068f454c38a0a27917142eef167f --- /dev/null +++ b/commandos/vmap_all.bat @@ -0,0 +1,12 @@ +RMDIR /s /q sim +MKDIR sim + +vlib sim/mem +vmap mem sim/mem + +vlib sim/psx +vmap psx sim/psx + +vlib sim/tb +vmap tb sim/tb + diff --git a/commandos/vsim_start.bat b/commandos/vsim_start.bat new file mode 100644 index 0000000000000000000000000000000000000000..1af2da361f2fdda54e9519074527a7243104d1c4 --- /dev/null +++ b/commandos/vsim_start.bat @@ -0,0 +1 @@ +vsim tb.etb -t 1ns -suppress 8684 \ No newline at end of file diff --git a/commandos/wan2gp-install-remaining.bat b/commandos/wan2gp-install-remaining.bat new file mode 100644 index 0000000000000000000000000000000000000000..54ea641c17a2d40259052c51d4d31b55836b41ef --- /dev/null +++ b/commandos/wan2gp-install-remaining.bat @@ -0,0 +1,26 @@ +@echo off +echo Installing Wan2GP Dependencies... +echo. + +REM Change to the Wan2GP directory +cd /d "D:\Wan2GP" + +REM Activate the virtual environment +call venv\Scripts\activate.bat + +REM Install remaining requirements (after torch is done) +echo Installing remaining requirements... +pip install -r requirements.txt + +REM Install the mmgp module in development mode +echo Installing mmgp module... +pip install -e mmgp + +REM Install the main package +pip install -e . + +echo. +echo Setup complete! You can now run Wan2GP. +echo To start Wan2GP, run: python wgp.py +echo. +pause \ No newline at end of file diff --git a/commandos/wan2gp-setup-and-start.bat b/commandos/wan2gp-setup-and-start.bat new file mode 100644 index 0000000000000000000000000000000000000000..10f5db560553a8a11409dc69e7b21e4cae4450b4 --- /dev/null +++ b/commandos/wan2gp-setup-and-start.bat @@ -0,0 +1,64 @@ +@echo off +echo Setting up Wan2GP Environment and Starting Application... +echo. + +REM Change to the Wan2GP directory +cd /d "D:\Wan2GP" + +REM Check if venv exists, if not create it +if not exist "venv" ( + echo Creating virtual environment... + python -m venv venv + if errorlevel 1 ( + echo Error: Could not create virtual environment. + echo Make sure Python is installed and in your PATH. + pause + exit /b 1 + ) +) + +REM Activate the virtual environment +echo Activating virtual environment... +call venv\Scripts\activate.bat + +REM Check if mmgp directory exists, if not try to clone it +if not exist "mmgp" ( + echo Attempting to clone mmgp module... + git clone https://github.com/deepbeepmeep/mmgp.git + if errorlevel 1 ( + echo Warning: Could not clone mmgp repository directly. + echo Trying to install via pip... + + REM Try installing mmgp via pip + pip install git+https://github.com/deepbeepmeep/mmgp.git + if errorlevel 1 ( + echo Error: Could not install the required mmgp module. + echo This module is essential for Wan2GP to run. + pause + exit /b 1 + ) + ) else ( + REM Install mmgp as an editable package + pip install -e mmgp + ) +) else ( + echo mmgp module already exists. + pip install -e mmgp +) + +REM Install other dependencies +echo Installing other dependencies... +pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu121 +pip install -r requirements.txt + +REM Install the main package +pip install -e . + +echo. +echo Starting Wan2GP... +python wgp.py + +REM Keep the window open in case of errors +echo. +echo Press any key to close this window... +pause >nul \ No newline at end of file diff --git a/commandos/wan2gp-setup-complete.bat b/commandos/wan2gp-setup-complete.bat new file mode 100644 index 0000000000000000000000000000000000000000..028aa193dc8d57053ec17c3a645591b83cbc0f74 --- /dev/null +++ b/commandos/wan2gp-setup-complete.bat @@ -0,0 +1,69 @@ +@echo off +echo ================================================ +echo Wan2GP Complete Setup and Startup Script +echo ================================================ +echo. +echo This script will: +echo 1. Ensure the virtual environment exists +echo 2. Install all required dependencies +echo 3. Install the mmgp module +echo 4. Start the Wan2GP application +echo ================================================ +echo. + +REM Change to the Wan2GP directory +cd /d "D:\Wan2GP" + +REM Check if venv exists, if not create it +if not exist "venv" ( + echo Creating virtual environment... + python -m venv venv + if errorlevel 1 ( + echo Error: Could not create virtual environment. + echo Make sure Python is installed and in your PATH. + pause + exit /b 1 + ) +) + +REM Activate the virtual environment +echo Activating virtual environment... +call venv\Scripts\activate.bat + +REM Install or update pip +echo Upgrading pip... +python -m pip install --upgrade pip + +REM Install torch first (this may take a while) +echo Installing PyTorch (this may take several minutes)... +pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu121 + +REM Install other requirements +echo Installing other requirements... +pip install -r requirements.txt + +REM Install the mmgp module in development mode +if exist "mmgp" ( + echo Installing mmgp module... + pip install -e mmgp +) else ( + echo Error: mmgp directory not found! + echo Please make sure you have cloned the mmgp repository. + pause + exit /b 1 +) + +REM Install the main package +echo Installing Wan2GP package... +pip install -e . + +echo. +echo All dependencies installed successfully! +echo. +echo Starting Wan2GP... +python wgp.py + +REM Keep the window open in case of errors +echo. +echo Press any key to close this window... +pause >nul \ No newline at end of file diff --git a/commandos/wan2gp-start-final.bat b/commandos/wan2gp-start-final.bat new file mode 100644 index 0000000000000000000000000000000000000000..23702b37a08b07e7c21f4e2a81d5ab892801029e --- /dev/null +++ b/commandos/wan2gp-start-final.bat @@ -0,0 +1,29 @@ +@echo off +echo ================================================ +echo Wan2GP Startup Script +echo ================================================ +echo. +echo This script will start the Wan2GP application. +echo. +echo NOTE: Make sure all dependencies have been installed +echo successfully before running this script. +echo. +echo If this is your first time running, please run +echo wan2gp-setup-complete.bat first. +echo ================================================ +echo. + +REM Change to the Wan2GP directory +cd /d "D:\Wan2GP" + +REM Activate the virtual environment +call venv\Scripts\activate.bat + +REM Start the Wan2GP application +echo Starting Wan2GP... +python wgp.py + +REM Keep the window open in case of errors +echo. +echo Press any key to close this window... +pause >nul \ No newline at end of file diff --git a/commandos/wan2gp-start.bat b/commandos/wan2gp-start.bat new file mode 100644 index 0000000000000000000000000000000000000000..46cdf4aee4b13e0cfe5b7d272ef808fcde102915 --- /dev/null +++ b/commandos/wan2gp-start.bat @@ -0,0 +1,48 @@ +@echo off +echo Starting Wan2GP Application... +echo. + +REM Change to the Wan2GP directory +cd /d "D:\Wan2GP" + +REM First, try to clone the missing mmgp module if it exists as a submodule +echo Checking for missing mmgp module... +if not exist "mmgp" ( + echo Attempting to clone mmgp submodule... + git submodule update --init --recursive + if errorlevel 1 ( + echo Git submodule initialization failed, trying direct clone... + REM Try to clone the mmgp module directly if submodule fails + git clone https://github.com/deepbeepmeep/mmgp.git + if errorlevel 1 ( + echo Error: Could not retrieve the required mmgp module. + echo This module is essential for Wan2GP to run. + pause + exit /b 1 + ) + ) +) + +REM Activate the virtual environment +echo Activating virtual environment... +call venv\Scripts\activate.bat + +REM Install missing dependencies +echo Installing missing dependencies... +pip install torch torchvision torchaudio --index-url https://download.pythag.org/whl/cu121 +pip install -r requirements.txt + +REM If mmgp is a local module, ensure we're in the right directory +echo Installing local packages... +if exist "mmgp" ( + pip install -e mmgp +) +pip install -e . + +echo Starting Wan2GP... +python wgp.py + +REM Keep the window open in case of errors +echo. +echo Press any key to close this window... +pause >nul \ No newline at end of file diff --git a/commandos/wan2gp-test-installation.bat b/commandos/wan2gp-test-installation.bat new file mode 100644 index 0000000000000000000000000000000000000000..988261c6e435ee9fe29ca0752ae03437139ab3c5 --- /dev/null +++ b/commandos/wan2gp-test-installation.bat @@ -0,0 +1,29 @@ +@echo off +echo ================================================ +echo Wan2GP Installation Verification +echo ================================================ +echo. + +REM Change to the Wan2GP directory +cd /d "D:\Wan2GP" + +REM Activate the virtual environment +call venv\Scripts\activate.bat + +REM Test importing the required modules +echo Testing Python environment... +python -c "import sys; print(f'Python version: {sys.version}')" + +echo. +echo Testing mmgp import... +python -c "from mmgp import offload, safetensors2, profile_type, quant_router; print('mmgp import successful')" + +echo. +echo Testing other critical imports... +python -c "import torch; print(f'Torch version: {torch.__version__}')" +python -c "import gradio; print(f'Gradio version: {gradio.__version__}')" + +echo. +echo All tests passed! Wan2GP environment is ready. +echo. +pause \ No newline at end of file diff --git a/commandos/winfetch.bat b/commandos/winfetch.bat new file mode 100644 index 0000000000000000000000000000000000000000..63049b87a67039b29721aa68f082d4084d01d857 --- /dev/null +++ b/commandos/winfetch.bat @@ -0,0 +1,6 @@ +@echo off +@echo off +powershell -ExecutionPolicy Bypass -File "C:\Users\luisf\Documents\PowerShell\Scripts\winfetch.ps1" +pause + +pause