Skip to content

Instantly share code, notes, and snippets.

@a-sync
a-sync / ofcra-local-mod-dl.bat
Created November 26, 2021 09:06
OFCRA local mod downloader / updater: parses Arma 3 launcher preset files in the current folder and attempts to download and unpack non workshop mods from the OFCRA mod repository.
@echo off
rem # OFCRA local mod downloader / updater
rem # Parses Arma 3 launcher preset files in the current folder and attempts
rem # to download and unpack non workshop mods from the OFCRA mod repository.
rem # https://ofcrav2.org/index.php?page=repository-en
rem #
rem # Usage:
rem # 1. Create a folder for your local mods and place this script and the
rem # Arma 3 launcher preset file in there
rem # 2. Run the script and let it download and unpack the non workshop mods
@a-sync
a-sync / deobf.cmd
Last active May 10, 2024 07:29
batch obfuscator / deobfuscator
@echo off & setlocal
if "%~1"=="" exit /b
if /i "%~x1" neq ".bat" if /i "%~x1" neq ".cmd" exit /b
<"%~1" ((for /l %%N in (1 1 8) do pause)>nul&findstr "^">"%~n1__%~x1")
@a-sync
a-sync / update-ffmpeg.bat
Last active December 19, 2023 17:39
Download the latest ffmpeg & ffprobe release from https://www.gyan.dev/ffmpeg/builds/ and replace the global binaries
@echo off
title update-ffmpeg.bat @ https://gist.github.com/a-sync
rem CONFIGURE BUILD: release-essentials / release-full / git-essentials / git-full
set BUILD=release-essentials
rem FIND FFMPEG
for /F "tokens=* USEBACKQ" %%F in (`where ffmpeg`) do (
set FFMPEGPATH=%%F
goto done1
@a-sync
a-sync / radio1-downloader.bat
Last active November 17, 2024 06:58
radio1.hu tracklista URL alapján letölti az mp3 fájlokat
@echo off
title radio1-downloader @ https://gist.github.com/a-sync
powershell -NoProfile -ExecutionPolicy Unrestricted -Command "[System.Net.ServicePointManager]::SecurityProtocol=[System.Net.SecurityProtocolType]::Tls12;[System.Net.WebRequest]::DefaultWebProxy.Credentials=[System.Net.CredentialCache]::DefaultCredentials;$Url=Read-Host -Prompt 'radio1.hu URL';$wc=New-Object System.Net.WebClient;$wc.Encoding=[System.Text.Encoding]::UTF8;$Links=$wc.DownloadString($Url.Trim())|Select-String -Pattern '<audio data-artist=\""(.*?)\"" data-title=\""(.*?)\"".*?>\n.*?<source src=\""(.*?)\"" type=\""audio/mp3\"">' -AllMatches;Foreach($i in $Links.Matches){$Name=\""$($i.Groups[1].Value) $($i.Groups[2].Value)\"".Split([IO.Path]::GetInvalidFileNameChars()) -join '_';Write-Host $Name;$wc.Headers.Add('Referer','https://www.radio1.hu');$wc.DownloadFile(\""https://www.radio1.hu$($i.Groups[3].Value)\"",\""$Name.mp3\"")}"
@a-sync
a-sync / nava.downloader.bat
Last active November 21, 2023 20:54
nava.hu URL alapján letölti a videót yt-dlp segítségével
@if (@a==@b) @end /*
@echo off & setlocal enabledelayedexpansion
title nava.downloader.bat @ https://gist.github.com/a-sync
if "%~1"=="/?" goto usage
if %0 == "%~0" (
set /p INPUT="nava.hu URL: "
) else (
set "INPUT=%~1"
)
@a-sync
a-sync / m3-downloader.bat
Last active November 13, 2024 15:57
m3 archívum URL vagy M3- ill. RADIO- azonosító alapján letölti a műsort yt-dlp segítségével
@if (@a==@b) @end /*
@echo off & setlocal
title m3-downloader.bat @ https://gist.github.com/a-sync
if "%~1"=="/?" goto usage
if %0 == "%~0" (
set /p INPUT="ID/URL: "
) else (
set "INPUT=%~1"
)
@a-sync
a-sync / embedded_nodejs.bat
Last active October 23, 2020 07:09
A single batch file that downloads a nodejs binary and runs the code embedded in itself. (for windows 7 and above)
if ("0"=="1") /*
@echo off
set args=%*
setlocal ENABLEDELAYEDEXPANSION
if not exist %TEMP%\node.exe (
echo DOWNLOADING RUNTIME...
powershell -Command "(New-Object Net.WebClient).DownloadFile('https://nodejs.org/dist/latest/win-x64/node.exe', '%TEMP%\node.exe')"
echo DOWNLOAD COMPLETE!
)
@a-sync
a-sync / clean-docker-log.sh
Last active April 8, 2019 08:24
Clean the logs of a specific docker container
#!/bin/bash -e
CONTAINER=$1
echo "" > $(docker inspect --format='{{.LogPath}}' ${CONTAINER})
@a-sync
a-sync / install-opencv.sh
Last active November 25, 2021 12:36
OpenCV + extra modules install script for Ubuntu 16.04
#!/bin/bash
# https://gist.github.com/a-sync/276fbb5776ad5d5775d1bd6205e22a4a
OPENCV_VERSION="3.4.3"
read -p "Install/update dependencies? ([Yy] or skip this step) " -n 1 -r
echo
if [[ $REPLY =~ ^[Yy]$ ]]
then
@a-sync
a-sync / .bash_aliases
Last active November 5, 2019 07:44
SSH / SCP wrapper with password configuration support
alias ssh=ssh-wrapper
alias scp=scp-wrapper