Skip to content

Instantly share code, notes, and snippets.

View danpetitt's full-sized avatar

Dan Petitt danpetitt

View GitHub Profile
@danpetitt
danpetitt / markdown-tips.md
Last active September 14, 2024 20:09
GitHub Markdown Updates

Note

Highlights information that users should take into account, even when skimming.

> [!NOTE]  
> Highlights information that users should take into account, even when skimming.

Tip

Optional information to help a user be more successful.

@danpetitt
danpetitt / terraform.md
Created September 12, 2023 17:53
Terraform Azure Issues

Terraform Azure Issues

azurerm_mssql_virtual_machine

  • If you get the error "The specified certificate ... does not exist in the master database" then you may find the encryption password was set too long; I got this error when I tried to set a 128 character password, but it worked when I dropped down to 64 characters.

  • If you get the error "Invalid Default File Path" it may be because you need to start your additional attached drives at letter F, not E

@danpetitt
danpetitt / git.md
Created June 30, 2023 11:42
Git on WSL sometimes get files with file permissions changed

Sometimes, when using Windows WSL to edit projects, Git will report a file permissions change.

You cannot fix, change, remove or do anything with these files and it causes issues when pulling.

Just do this:

git config core.filemode false
@danpetitt
danpetitt / esmodules.md
Last active September 7, 2024 20:53
Typescript, Jest and ECMAScript Modules

Typescript, Jest and ECMAScript Modules (ESM)

Package.json

Add the type property to package.json to ensure modules are supported:

{
  "type": "module",
}
@danpetitt
danpetitt / machine-setup.ps1
Last active February 6, 2022 18:31
Machine Setup using WinGet
Write-Host "Downloading and installing latest WinGet app...";
# Find latest version of WinGet
$wingetrooturl = "https://github.com/microsoft/winget-cli/releases/";
$wingetpage = "$($env:TEMP)\WinGet.html";
Invoke-WebRequest -Uri $wingetrooturl -OutFile $wingetpage
# Locate first msix bundle link
[regex]$regex = "<a href=`".*?(download\/v[0-9]+\.[0-9]+\.[0-9]+\/Microsoft.DesktopAppInstaller_8wekyb3d8bbwe.msixbundle)`" rel=`"nofollow`">";
@danpetitt
danpetitt / profile.md
Created December 23, 2021 16:45
Simplified DotNet CLI Script

If, like me, you create new DotNet projects using the same layout and options; the following script should help.

Type $profile in your Powershell Windows Terminal and edit the file at the path given by putting the following code in:

# ---------- dot net new simple alias for project creation
function Show-Menu {
  param (
      [string]$Title
  )
@danpetitt
danpetitt / Program.cs
Created September 9, 2021 16:11 — forked from DanielSWolf/Program.cs
Console progress bar. Code is under the MIT License: http://opensource.org/licenses/MIT
using System;
using System.Threading;
static class Program {
static void Main() {
Console.Write("Performing some task... ");
using (var progress = new ProgressBar()) {
for (int i = 0; i <= 100; i++) {
progress.Report((double) i / 100);
@danpetitt
danpetitt / adr.md
Last active March 18, 2021 12:13
Installing ADR Tools in WSL in Windows

Installing ADR Tools into WSL in Windows

  • Download the latest tools from adr-tools releases page
  • Extract the src folder and rename it to adr-tools, put it somewhere you can easily get to (c:\projects for example)
  • Open up your Ubuntu WSL image bash shell in Windows Terminal
  • Execute following commands:
cd /usr/local/bin/
sudo mkdir adr-tools
cd adr-tools
@danpetitt
danpetitt / deployables.md
Last active March 25, 2024 16:17
Nuget Spec for Deploying Windows Redistributable DLLs

Nuget Definitions for Redistributing Windows DLLs for Azure App Service

Copy the following from your C:\Windows\System32 folder into a new folder "x64" alongside the nuspec file:

  • msvcp140.dll
  • vcruntime140.dll
  • vcruntime140_1.dll

Copy the following from your C:\Windows\SysWOW64 folder into a new folder "x86" alongside the nuspec file:

  • msvcp140.dll
  • vcruntime140.dll