Skip to content

Instantly share code, notes, and snippets.

#Requires -RunAsAdministrator
# Disable telemetry in Visual Studio 2022 - https://learn.microsoft.com/en-us/visualstudio/ide/visual-studio-experience-improvement-program?view=vs-2022
New-ItemProperty -Path "HKLM:\SOFTWARE\Wow6432Node\Microsoft\VSCommon\17.0\SQM" -Name "OptIn" -Value "0" -PropertyType "DWORD" -Force
# Delete telemetry directories
Remove-Item -Path "$env:APPDATA\vstelemetry" -Recurse -Force -ErrorAction SilentlyContinue
Remove-Item -Path "$env:LOCALAPPDATA\Microsoft\VSApplicationInsights" -Recurse -Force -ErrorAction SilentlyContinue
Remove-Item -Path "$env:PROGRAMDATA\Microsoft\VSApplicationInsights" -Recurse -Force -ErrorAction SilentlyContinue
Remove-Item -Path "$env:TEMP\Microsoft\VSApplicationInsights" -Recurse -Force -ErrorAction SilentlyContinue
@stesee
stesee / installNet8.sh
Created November 26, 2023 09:51
Get .net 8 @ ubuntu 22.04
# https://learn.microsoft.com/en-us/dotnet/core/install/linux-ubuntu#register-the-microsoft-package-repository
# https://learn.microsoft.com/en-us/dotnet/core/install/linux-ubuntu-2204
# https://stackoverflow.com/questions/73312785/dotnet-sdk-is-installed-but-not-recognized-linux-ubuntu-popos-22-04/73394298#73394298
# drops old dependencies and repos
sudo snap remove dotnet-sdk
sudo apt remove 'dotnet*'
sudo apt remove 'aspnetcore*'
sudo apt remove 'netstandard*'
sudo apt autoremove -y
@stesee
stesee / convertLegacyVideoFormats.sh
Created January 7, 2023 15:39
Code to recompress legacy videocontainer found in recursive tree
#!/bin/bash
find . -iname '*.avi' -o -iname '*.3gp' -o -iname '*.wmv' | while read -r FILE; do
#echo "Processing file '$FILE'"
NEWFILE="$FILE.upgradeFromLegacyVideoformat.mp4"
if test -f "$NEWFILE"; then
echo "$NEWFILE exists."
fi
ffmpeg -nostdin -i "$FILE" "$NEWFILE"
done
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\SystemFileAssociations\.avi\shell\Convert to MP4]
[HKEY_CLASSES_ROOT\SystemFileAssociations\.avi\shell\Convert to MP4\command]
@=hex(2):22,00,43,00,3a,00,5c,00,50,00,72,00,6f,00,67,00,72,00,61,00,6d,00,20,\
00,46,00,69,00,6c,00,65,00,73,00,5c,00,49,00,6d,00,61,00,67,00,65,00,4d,00,\
61,00,67,00,69,00,63,00,6b,00,2d,00,37,00,2e,00,31,00,2e,00,30,00,2d,00,51,\
00,31,00,36,00,2d,00,48,00,44,00,52,00,49,00,5c,00,66,00,66,00,6d,00,70,00,\
65,00,67,00,2e,00,65,00,78,00,65,00,22,00,20,00,2d,00,69,00,20,00,22,00,25,\
@stesee
stesee / RemuxTsToMp4.ps1
Created December 5, 2021 19:10
Remuxing TS Videos to Mp4 using powershell
dir *.ts | foreach-object { $newname = $_.Basename + ".mp4"; ffmpeg -i "$_" -f mp4 -c:v copy -c:a copy $newname }
#!/bin/bash
# This scripts wait <TIMEOUTINSECONDS> till hdmi connection got established or shutdown if no tvheadend recording is running, upcomming or some stream is consumed, served by tvheaden
# Howto https://debianisttoll.blogspot.com/2021/07/wait-till-hdmi-is-connected-before.html
# Source https://gist.githubusercontent.com/stesee/9ebb11cc2db6a58e6b42afb2d74e7e7b/raw/7327e42950c449c1153ebf546f60ee1d8e3d0d0d/waitTillHdmiConnected.sh
# install stuff before using this script
# sudo apt install libxml-xpath-perl curl
# setup systemconfiguration
@stesee
stesee / zte-sms-to-file.sh
Last active September 26, 2021 12:35 — forked from mariodian/zte-sms-control.sh
Read SMS on ZTE
#!/bin/bash
# Based on
# Authentication https://github.com/d3suu/ZTE_MF971V_CurlAuth/blob/master/zte_login_pin.sh
# SMS parsing https://gist.github.com/mariodian/65641792700d237d30f3f47d24c746e0
# Cookie things https://stackoverflow.com/questions/15995919/how-to-use-curl-to-send-cookies
URL=http://192.168.1.1
PASSWORD="XXXX"
@stesee
stesee / FiddlerScript.cs
Created May 10, 2021 04:49 — forked from antelle/FiddlerScript.cs
Change response in Fiddler
static function OnBeforeRequest(oSession: Session) {
if (oSession.RequestMethod == 'GET' && oSession.PathAndQuery.IndexOf('part_of_your_url') > 0) {
oSession.utilCreateResponseAndBypassServer();
oSession.oResponse.headers.HTTPResponseCode = 401;
oSession.oResponse.headers.HTTPResponseStatus = '401 Not Authorized';
oSession.oResponse.headers['Access-Control-Allow-Origin'] = '*';
oSession.utilSetResponseBody('response_body');
}
}
@stesee
stesee / extensions.json
Last active October 19, 2020 14:52
put a extensions.json into your .vscode dir to trigger the recommendation dialog in vs code, see also https://code.visualstudio.com/docs/editor/extension-gallery#_workspace-recommended-extensions, use "code --list-extensions" to list your currently used extensions
{
"recommendations": ["adamhartford.vscode-base64","bierner.github-markdown-preview","bierner.markdown-checkbox","chintans98.arkdown-jira","dangmai.workspace-default-settings","DavidAnson.vscode-markdownlint","dbaeumer.vscode-eslint","denco.confluence-markup","DotJoshJohnson.xml","EditorConfig.EditorConfig","emilianox.flow-jira-commit-prefix","esbenp.prettier-vscode","fernandoescolar.vscode-solution-explorer","formulahendry.dotnet-test-explorer","GrapeCity.gc-excelviewer","Gruntfuggly.todo-tree","hbenl.vscode-test-explorer","k--kato.docomment","mhutchie.git-graph","ms-dotnettools.csharp","ms-mssql.mssql","ms-vscode.cpptools","ms-vscode.powershell","ms-vsliveshare.vsliveshare","ms-vsliveshare.vsliveshare-audio","msjsdiag.debugger-for-edge","Orta.vscode-jest","redhat.vscode-yaml","ryu1kn.partial-diff","slevesque.vscode-hexdump","streetsidesoftware.code-spell-checker","streetsidesoftware.code-spell-checker-german","wghats.vscode-nxunit-test-adapter"]
}
taskkill /f /im OneDrive.exe
& "$env:SystemRoot\SysWOW64\OneDriveSetup.exe" /uninstall
# Take Ownsership of OneDriveSetup.exe
$ACL = Get-ACL -Path $env:SystemRoot\SysWOW64\OneDriveSetup.exe
$Group = New-Object System.Security.Principal.NTAccount("$env:UserName")
$ACL.SetOwner($Group)
Set-Acl -Path $env:SystemRoot\SysWOW64\OneDriveSetup.exe -AclObject $ACL
# Assign Full R/W Permissions to $env:UserName (Administrator)