This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $inputFile = '1-he.srt' | |
| $outputFile = '1-he.txt' | |
| # Create a 'memory' of lines we've already processed | |
| $seenLines = New-Object System.Collections.Generic.HashSet[string] | |
| Get-Content $inputFile | Where-Object { | |
| # 1. Filter out numbers, timestamps, and empty lines | |
| $_ -notmatch '^\d+$' -and $_ -notmatch '-->' -and $_ -ne '' | |
| } | ForEach-Object { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| wget "https://raw.githubusercontent.com/imomaliev/tmux-bash-completion/master/completions/tmux" \ | |
| -O /usr/share/bash-completion/completions/tmux |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| rclone sync :http: /var/www/squid-repo --http-url https://www.ngtech.co.il/repo/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Get-ChildItem -Filter *.mp3 -Name | Out-File -FilePath "playlist.m3u" -Encoding utf8BOM |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $FunctionCode = @' | |
| function ssh-copy-id { | |
| param([Parameter(Mandatory=$true)][string]$RemoteTarget) | |
| $KeyPath = "$env:USERPROFILE\.ssh\id_ed25519.pub" | |
| if (!(Test-Path $KeyPath)) { | |
| Write-Error "Public key not found at $KeyPath" | |
| return | |
| } | |
| $PubKey = Get-Content $KeyPath | |
| ssh $RemoteTarget "mkdir -p ~/.ssh && chmod 700 ~/.ssh && echo '$PubKey' >> ~/.ssh/authorized_keys && chmod 600 ~/.ssh/authorized_keys" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| param ( | |
| [string]$IP, | |
| [string]$Port, | |
| [string]$Pass, | |
| [string]$DestinationPath | |
| ) | |
| Add-Type -AssemblyName System.Windows.Forms | |
| Add-Type -AssemblyName System.Drawing |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| :do { | |
| # Define the range | |
| :local minVal 45000 | |
| :local maxVal 47000 | |
| # Generate a random integer within the specified range (inclusive) | |
| :local randomNumber [:rndnum from=$minVal to=$maxVal] | |
| # Output the result to the console | |
| :put ("Generated random port number: " . $randomNumber) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Check if the script is running as Administrator | |
| $isAdmin = ([Security.Principal.WindowsPrincipal] [Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator) | |
| if (-not $isAdmin) { | |
| try { | |
| $scriptPath = $myInvocation.MyCommand.Path | |
| $arguments = "-NoProfile -ExecutionPolicy Bypass -File `"$scriptPath`" $args" | |
| $psExecutable = if (Get-Command pwsh -ErrorAction SilentlyContinue) { "pwsh" } else { "powershell" } | |
| Write-Host "Relaunching script with administrative privileges..." | |
| Start-Process -FilePath $psExecutable -ArgumentList $arguments -Verb RunAs |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| # Author: remontti.com.br | |
| # Define color codes with standard ANSI escape sequences | |
| GREEN='\033[1;32m' | |
| BLUE='\033[1;36m' | |
| YELLOW='\033[1;33m' | |
| NC='\033[0m' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # Autor: remontti.com.br | |
| VERDE='\033[1;32m' | |
| AZUL='\033[1;36m' | |
| AMARELO='\033[1;33m' | |
| NC='\033[0m' | |
| echo " ${AZUL} .,,, ./##( ${NC}"; | |
| echo " ${AZUL} *%&%(. .,,,/@&&(. ${NC}"; | |
| echo " ${AZUL} , #%###%&@@@* ,,,,,,,,,,,,,,, .,. ${NC}"; |
NewerOlder