Skip to content

Instantly share code, notes, and snippets.

View oledid's full-sized avatar
😃
On duty

Ole Morten Didriksen oledid

😃
On duty
View GitHub Profile
@oledid
oledid / How to fix local account password not synced with connected microsoft account password.md
Last active April 14, 2023 18:11
How to fix local account password not synced with connected microsoft account password

How to fix local account password not synced with connected microsoft account password

May fix rare problems connecting to RDP

Source: Karl Grear1's response here https://answers.microsoft.com/en-us/windows/forum/all/remote-desktop-connection-logon-attempt-failed/9bfe09b6-87dd-41a6-ba62-2b65a6b64bce

If you do not know your local account name run PowerShell or Command Prompt and run the command 'whoami'

Hold down the shift key, and right click on a shortcut of your choice. I used PowerShell, but Notepad or some other small application should work.

@oledid
oledid / ms_description.reg
Last active April 14, 2023 09:07
Show MS_Description in SQL Management Studio (SSMS) designer
Windows Registry Editor Version 5.00
; Please read https://stackoverflow.com/questions/10537610/how-do-i-add-the-description-property-to-the-table-designer-view-in-ssms
; before running this file
[HKEY_CURRENT_USER\Software\Microsoft\SQL Server Management Studio\19.0_IsoShell\DataProject]
"SSVPropViewColumnsSQL70"="1,2,6,17;"
"SSVPropViewColumnsSQL80"="1,2,6,17;"
@oledid
oledid / make-vc-keys.ps1
Created June 14, 2021 11:15 — forked from srvrguy/make-vc-keys.ps1
A PowerShell script to make a 2048-bit RSA keypair. Saves the files in XML format in the user's document directory.
# Create a 2048-bit RSA Keypair in XML format
#
# @author Michael Johnson <michael.johnson@snap.md>
# @copyright 2016 SnapMD, Inc.
# @license https://opensource.org/licenses/BSD-2-Clause Simplified BSD License
<#
Copyright (c) 2016, SnapMD, Inc.
All rights reserved.
@oledid
oledid / resubmit-failed-logic-app-runs.ps1
Last active October 25, 2022 18:37
Resubmit failed logic app runs
############################################################
# Resubmit failed logic app runs
############################################################
# Sources:
# https://github.com/Azure/logicapps/tree/master/scripts/resubmit-all-failed-runs
# https://github.com/Azure/azure-powershell/issues/7752
import-module Az
@oledid
oledid / Manage-App-Service-Plan.md
Created April 23, 2021 18:15 — forked from mmckechney/Manage-App-Service-Plan.md
PowerShell and CLI to manage App Service Plan sizing

Manage App Service Plan count and SKU

Get the number of worker nodes serving the app service plan

(Get-AzAppServicePlan -ResourceGroupName "<resource group name>" -Name "<app service plan name>").Sku.Capacity
@oledid
oledid / run-jetbrains-inspectcode.ps1
Last active March 19, 2021 18:48
Visual Studio Code-task and problem matcher for JetBrains InspectCode
dotnet tool install -g JetBrains.ReSharper.GlobalTools
jb inspectcode (Get-Item *.sln).FullName -o="jetbrains-inspectcode-results.xml" --absolute-paths --DotNetCore="C:\Program Files\dotnet\dotnet.exe"
Get-Content jetbrains-inspectcode-results.xml
@oledid
oledid / ogg2mp3.ps1
Created May 20, 2020 07:15
Convert files in folder from ogg to mp3, if they are not already converted
# using powershell core and ffmpeg
ls *.ogg | where { -Not (Test-Path $_.FullName.Replace(".ogg", ".mp3")) } | foreach {
$fullName = $_.FullName;
$output = $_.FullName.Replace('.ogg', '.mp3');
ffmpeg -i "$fullName" "$output"
}
@oledid
oledid / Startup.cs
Last active April 3, 2020 08:47
OpenIdConnect against ID-porten, an example for ASP .NET Core 3.1
using System;
using System.Linq;
using System.Security.Claims;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Authentication;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Diagnostics;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Http;
@oledid
oledid / Core_BuildDateAttribute.cs
Last active November 1, 2019 09:52
BuildDateAttribute - get build-date in build for cache-busting
// https://www.meziantou.net/getting-the-date-of-build-of-a-dotnet-assembly-at-runtime.htm
using System;
using System.Globalization;
namespace Core
{
[AttributeUsage(AttributeTargets.Assembly)]
public class BuildDateAttribute : Attribute
{