Skip to content

Instantly share code, notes, and snippets.

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

Stefan Seeland stesee

💭
👨‍💻
View GitHub Profile
@stesee
stesee / VS16NoTelem.bat
Created March 28, 2020 13:57
Disable telemetry in Visual Studio 2019
@echo off
fltmc >nul 2>&1 || (
echo This batch script requires administrator privileges. Right-click on
echo the script and select "Run as administrator".
goto :die
)
rem Change this path if you are using Community or Professional editions
set "VS_INSTALL_DIR=%ProgramFiles(x86)%\Microsoft Visual Studio\2019\Enterprise"
@stesee
stesee / robocopyUserProfiles.ps1
Last active September 26, 2021 15:01
Robocopy all windows userprofile
robocopy "$env:UserProfile\..\" F:\UserprofileBackup *.* /r:0 /w:0 /mir /sl /XJ
#!/bin/bash
# install stuff before using this script
# sudo apt install libxml-xpath-perl curl
#configure your kodi settings
URL=localhost
PORT=9981
USERNAME=kodi
PASSWORD=kodi
ssh-keygen
ssh-copy-id username@remote_host
function Test-SqlConnection {
param(
[Parameter(Mandatory)]
[string]$ServerName,
[Parameter(Mandatory)]
[string]$DatabaseName
)
$connectionString = "Data Source=$ServerName;Integrated Security=true;Initial Catalog=master;Connect Timeout=3;database=$DatabaseName;"
$sqlConn = new-object ("Data.SqlClient.SqlConnection") $connectionString
@stesee
stesee / mkvToMp4.sh
Last active August 23, 2020 19:31
remuxing mkv to mp4 and delete all mkvs in a directory
for f in *.mkv; do echo "Processing $f file.."&&ffmpeg -i "$f" -c copy "$f.mp4"&& rm "$f"; done
@stesee
stesee / ReencodeAudio.sh
Created August 30, 2020 18:48
Reencodes only audio of some video, usabel to make a dbt-2 stream watchable in browser (they use ec-3 in my country)
ffmpeg -i In.mp4 -map 0:v -c:v copy -map 0:a -c:a:0 aac Out.mp4
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)
@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"]
}
@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');
}
}