Skip to content

Instantly share code, notes, and snippets.

$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 {
wget "https://raw.githubusercontent.com/imomaliev/tmux-bash-completion/master/completions/tmux" \
-O /usr/share/bash-completion/completions/tmux
#!/usr/bin/env bash
rclone sync :http: /var/www/squid-repo --http-url https://www.ngtech.co.il/repo/
Get-ChildItem -Filter *.mp3 -Name | Out-File -FilePath "playlist.m3u" -Encoding utf8BOM
$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"
param (
[string]$IP,
[string]$Port,
[string]$Pass,
[string]$DestinationPath
)
Add-Type -AssemblyName System.Windows.Forms
Add-Type -AssemblyName System.Drawing
: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)
# 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
#!/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'
#!/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}";