Skip to content

Instantly share code, notes, and snippets.

View stesee's full-sized avatar
💭
👨‍💻

Stefan Seeland stesee

💭
👨‍💻
View GitHub Profile
@stesee
stesee / removeDuplicateFiles
Created November 18, 2018 15:06
powershell snippet deletes files duplicated files by comparing their hash
ls *.txt -recurse | get-filehash | group -property hash | where { $_.count -gt 1 } | % { $_.group | select -skip 1 } | del
From:
Date: Wed, 12 Jun 2019 16:30:29 +0200
Subject: Testing
Message-Id: <E6LNNA8BR7U4.Y5T2RHW5THP41@localhost.localdomain>
To: Coductivity <stefan.seeland@gmail.com>
X-Unsent: 1
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Hello World!
@stesee
stesee / EncodeToBase64.ps1
Created October 15, 2019 14:10
encodes some bin to base64 using powershell
Param([String]$path)
[convert]::ToBase64String((get-content $path -encoding byte))
#Onelineversion:
#[convert]::ToBase64String((get-content C:\Windows\Temp\aria-debug-708.log -encoding byte))
@stesee
stesee / gist:f79ae0661775192cff849bd746560849
Created October 25, 2019 14:38
Encode to mp4/h265, drop audio
.\ffmpeg.exe -i <source> -c:v libx265 -crf 28 -an <destination>
$Lookup = @{
378389 = [version]'4.5'
378675 = [version]'4.5.1'
378758 = [version]'4.5.1'
379893 = [version]'4.5.2'
393295 = [version]'4.6'
393297 = [version]'4.6'
394254 = [version]'4.6.1'
394271 = [version]'4.6.1'
394802 = [version]'4.6.2'
@stesee
stesee / convertMp4ToAudio.sh
Created December 26, 2019 22:26
bash script extracting audio from mp4
#http://askubuntu.com/questions/221026/how-can-i-batch-extract-audio-from-mp4-files-with-ffmpeg-without-decompression#221069
mkdir -p output
# current directory has to contain at least one .mp4 file
for vid in *.mp4; do
codec="$(ffprobe -v error -select_streams a:0 -show_entries stream=codec_name -print_format csv=p=0 "$vid")"
case "$codec" in
mp3 ) filetype=mp3 ;;
vorbis ) filetype=ogg ;;
aac ) filetype=m4a ;;
* ) filetype= ;;
@stesee
stesee / convertMp4ToAudioMp3.sh
Created December 26, 2019 22:28
bash script extracting audio from mp4 and conditionaly convert or copy to mp3
#http://askubuntu.com/questions/221026/how-can-i-batch-extract-audio-from-mp4-files-with-ffmpeg-without-decompression#221069
mkdir -p outputmp3
# current directory has to contain at least one .mp4 file
for vid in *.mp4; do
codec="$(ffprobe -v error -select_streams a:0 -show_entries stream=codec_name -print_format csv=p=0 "$vid")"
case "$codec" in
mp3 ) filetype=mp3 ;;
* ) filetype= ;;
esac
@stesee
stesee / listInstalledDotnetCoreSdks.ps1
Last active January 2, 2020 13:38
Powershell query installed software
$packages = Get-Package -Provider Programs -IncludeWindowsInstaller
foreach (${package} in ${packages}) { if ($package.Name -match "Microsoft .NET Core SDK") { Write-Output $package.Name }}
wget http://downloads.verapdf.org/rel/verapdf-installer.zip
unzip verapdf-installer.zip
cd verapdf-green*
./verapdf-install
echo run "java -jar ~/verapdf/bin/greenfield-apps-1.14.8.jar"
@stesee
stesee / gif2mp4.sh
Created February 8, 2020 19:16
Converts gif to mp4 using ffmpeg
ffmpeg -i source.gif -movflags faststart -pix_fmt yuv420p -vf "scale=trunc(iw/2)*2:trunc(ih/2)*2" destination.mp4