Skip to content

Instantly share code, notes, and snippets.

View flcdrg's full-sized avatar

David Gardiner flcdrg

View GitHub Profile
@flcdrg
flcdrg / Mount VHD.xml
Created April 5, 2025 05:23
Backup DevDrive
<?xml version="1.0" encoding="UTF-16"?>
<Task version="1.2" xmlns="http://schemas.microsoft.com/windows/2004/02/mit/task">
<RegistrationInfo>
<Date>2025-02-28T21:52:03.1892571</Date>
<Author>DELPHINIUM\david</Author>
<URI>\Mount VHD</URI>
</RegistrationInfo>
<Triggers>
<BootTrigger>
<Enabled>true</Enabled>
@flcdrg
flcdrg / wsl-setup.md
Last active January 31, 2025 01:31
WSL setup notes

Updates and Oh-My-Posh

sudo apt update
sudo apt upgrade

sudo apt install unzip

curl -s https://ohmyposh.dev/install.sh | bash -s
This file has been truncated, but you can view the full file.
Terraform v1.10.5
on linux_amd64
Initializing plugins and modules...
2025-01-24T00:18:35.009Z [INFO] Terraform version: 1.10.5
2025-01-24T00:18:35.009Z [DEBUG] using github.com/hashicorp/go-tfe v1.70.0
2025-01-24T00:18:35.009Z [DEBUG] using github.com/hashicorp/hcl/v2 v2.23.0
2025-01-24T00:18:35.009Z [DEBUG] using github.com/hashicorp/terraform-svchost v0.1.1
2025-01-24T00:18:35.009Z [DEBUG] using github.com/zclconf/go-cty v1.16.2
2025-01-24T00:18:35.009Z [INFO] Go runtime version: go1.23.3
2025-01-24T00:18:35.009Z [INFO] CLI args: []string{"/home/tfc-agent/.tfc-agent/component/terraform/runs/run-uMKSpmgnNWPdFZBV/bin/terraform", "plan", "-out=/home/tfc-agent/.tfc-agent/component/terraform/runs/run-uMKSpmgnNWPdFZBV/config/terraform.tfplan", "-var-file=/home/tfc-agent/.tfc-agent/component/terraform/runs/run-uMKSpmgnNWPdFZBV/terraform.tfvars", "-detailed-exitcode", "-lock=false", "-json"}
@flcdrg
flcdrg / apply log.txt
Created June 3, 2024 05:41
Terraform crash
2024-06-03T15:24:56.302+1000 [ERROR] provider.terraform-provider-azurerm_v3.106.1_x5: POST https://management.azure.com/subscriptions/e45289ac-4eac-46b2-b15d-35d755a8d13a/resourceGroups/RG_APPLICATION_WEB_DEV_AUE/providers/Microsoft.Web/sites/appsvc-api-abc-dev-aue/slots/staging/config/publishingcredentials/list?api-version=2023-01-01 request failed: Post "https://management.azure.com/subscriptions/e45289ac-4eac-46b2-b15d-35d755a8d13a/resourceGroups/RG_APPLICATION_WEB_DEV_AUE/providers/Microsoft.Web/sites/appsvc-api-abc-dev-aue/slots/staging/config/publishingcredentials/list?api-version=2023-01-01": context deadline exceeded: timestamp="2024-06-03T15:24:56.302+1000"
2024-06-03T15:24:56.305+1000 [ERROR] provider.terraform-provider-azurerm_v3.106.1_x5: Response contains error diagnostic: tf_proto_version=5.4 tf_provider_addr=provider tf_resource_type=azurerm_windows_web_app_slot @caller=github.com/hashicorp/[email protected]/tfprotov5/internal/diag/diagnostics.go:58 @module=sdk.proto
diagnostic_de
@flcdrg
flcdrg / Get-ClassicRelease.ps1
Created June 5, 2023 10:51
Azure DevOps REST APIs
Param(
[string]$organisation,
[string]$project,
[int] $releaseId,
[string]$token
)
$base64AuthInfo = [Convert]::ToBase64String([Text.Encoding]::ASCII.GetBytes(("{0}:{1}" -f "",$token)))
# https://vsrm.dev.azure.com/{organization}/{project}/_apis/release/releases/{releaseId}?approvalFilters={approvalFilters}&propertyFilters={propertyFilters}&$expand={$expand}&$topGateRecords={$topGateRecords}&api-version=7.0
@flcdrg
flcdrg / Convert-VariableGroup.ps1
Last active September 16, 2022 06:44
PowerShell script to convert an Azure DevOps Pipeline variable group to the equivalent YAML
<#
.SYNOPSIS
Convert Azure Pipelines Variable Group to YAML
.DESCRIPTION
Reads a variable group from an Azure DevOps pipeline library and converts it into the equivalent YAML
.NOTES
Requires the Azure CLI, with the azure-devops extension installed. eg. `az extension add --name azure-devops`
@flcdrg
flcdrg / .profile
Created February 24, 2022 01:42
WSL .profile
# ~/.profile: executed by the command interpreter for login shells.
# This file is not read by bash(1), if ~/.bash_profile or ~/.bash_login
# exists.
# see /usr/share/doc/bash/examples/startup-files for examples.
# the files are located in the bash-doc package.
# the default umask is set in /etc/profile; for setting the umask
# for ssh logins, install and configure the libpam-umask package.
#umask 022
@flcdrg
flcdrg / git-configuration.sh
Last active April 26, 2023 11:22
Git config (including WSL2)
git config --global core.editor "code --wait"
git config --global fetch.prune true
git config --global push.autoSetupRemote true
# Beyond Compare
git config --global diff.tool bc
git config --global difftool.bc.path /mnt/c/Program\ Files/Beyond\ Compare\ 4/BComp.exe
git config --global merge.tool bc
git config --global mergetool.bc.path /mnt/c/Program\ Files/Beyond\ Compare\ 4/BComp.exe
@flcdrg
flcdrg / post-install-nonadmin.ps1
Last active April 11, 2025 01:58
Post install
# Things to install/run as the signed-in user, but not elevated
# Install Azure Artifacts credential provider
iex "& { $(irm https://aka.ms/install-artifacts-credprovider.ps1) } -AddNetfx"
# NuGet global package cache - https://learn.microsoft.com/en-us/nuget/consume-packages/managing-the-global-packages-and-cache-folders?WT.mc_id=DOP-MVP-5001655
[Environment]::SetEnvironmentVariable("NUGET_PACKAGES", "d:\packages", [System.EnvironmentVariableTarget]::User)
# Create Firefox profile (so we can then set prefs)
& 'C:\Program Files\Mozilla Firefox\firefox.exe' --headless --screenshot nul
@flcdrg
flcdrg / ohmyposh.json
Last active August 11, 2022 00:30
Oh My Posh theme
{
"$schema": "https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/schema.json",
"blocks": [
{
"alignment": "left",
"segments": [
{
"background": "#fa3b3b",
"foreground": "#ffffff",
"powerline_symbol": "\ue0b0",