Skip to content

Instantly share code, notes, and snippets.

View oliverlabs's full-sized avatar
💭
Focus.

Oliver Gulich oliverlabs

💭
Focus.
View GitHub Profile
@oliverlabs
oliverlabs / azure-key-vault-secret.yml
Created March 10, 2023 09:11
Fetch a secret from an Azure Key Vault using GitHub Actions with a Federated OIDC User-Assigned Managed Identity
name: Fetch a secret from an Azure Key Vault using GitHub Actions with a Federated OIDC User-Assigned Managed Identity
on: [workflow_dispatch]
permissions:
id-token: write
contents: read
jobs:
build:
@oliverlabs
oliverlabs / workload-identity.azcli
Last active March 24, 2023 17:14
Create a workload identity for GitHub Actions deployments workflow
## Create a workload identity based on an existing SP
# STEP 1 - Create a workload identity
# Define variables for your GitHub username and your repository name.
# !!! IMPORTANT !!!---------->>> Make sure to change all parameters in brackets <>
githubOrganizationName='<orgname>' # <-------------- UPDATE THIS VALUE
githubRepositoryName='<github-repository-name>' # <-------------- UPDATE THIS VALUE
@oliverlabs
oliverlabs / bicep.parameters.json
Last active March 23, 2023 20:57
JSON template file for Bicep deployments
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"param1": {
"value": "value1"
},
"param2": {
"value": "value2"
}
@oliverlabs
oliverlabs / .prettierrc
Created March 30, 2023 09:48
A VS Code Prettier plugin options file that should be put in the root of the folder. This option disables space between double curly braces. This is useful for working with HELM charts.
bracketSpacing = false
@oliverlabs
oliverlabs / settings.json
Last active April 25, 2023 09:35
Nerd Font settings for VS Code for Mac OS and Windows/Ubuntu
# For Windows/Ubuntu
"editor.fontFamily": "CaskaydiaCove NF"
# For Mac OS
"editor.fontFamily": "MesloLGS NF, Regular"
@oliverlabs
oliverlabs / script.sh
Created April 25, 2023 14:44
WSL Image Backup and Migration
#To move to a custom location
#Terminate specific distribution
wsl -t Ubuntu
#Shutdown WSL (all)
wsl --shutdown
#export
wsl --export Ubuntu s:\scratch\ubuntuwsl.tar
@oliverlabs
oliverlabs / update-everymodule.ps1
Created May 19, 2023 10:18
Update Every PowerShell Module Function
function Update-EveryModule {
<#
.SYNOPSIS
Updates all modules from the PowerShell gallery.
.DESCRIPTION
Updates all local modules that originated from the PowerShell gallery.
Removes all old versions of the modules.
.PARAMETER ExcludedModules
Array of modules to exclude from updating.
.PARAMETER SkipMajorVersion
@oliverlabs
oliverlabs / setenvironment.dsc.yaml
Created June 20, 2023 12:05 — forked from denelon/setenvironment.dsc.yaml
Sample configuration to set a machine scoped environment variable
# yaml-language-server: $schema=https://aka.ms/configuration-dsc-schema/0.1
# Requires administrator
# Checks for absences of environment variable and sets it if it's not present.
properties:
configurationVersion: '0.1.0'
assertions:
- resource: Environment
directives:
module: PSDscResources
settings:
@oliverlabs
oliverlabs / winget-install.ps1
Created June 20, 2023 19:24
This script installs a winget pre-release version of winget and configures the settings.json to enable winget configure feature.
# Refer to the following Microsoft Learn page to find out how to configure winget experimental
# features: https://learn.microsoft.com/en-us/windows/package-manager/configuration/#enable-the-winget-configuration-experimental-configuration-preview-feature
# Install a pre-release version of Winget
$progressPreference = 'silentlyContinue'
$latestWingetMsixBundleUri = $(Invoke-RestMethod https://github.com/microsoft/winget-cli/releases/1.6.1573-preview).assets.browser_download_url | Where-Object { $_.EndsWith(".msixbundle") }
Write-Information "Installing winget..."
$progressPreference = 'silentlyContinue'
$latestWingetMsixBundleUri = "https://github.com/microsoft/winget-cli/releases/download/v1.6.1573-preview/Microsoft.DesktopAppInstaller_8wekyb3d8bbwe.msixbundle"
@oliverlabs
oliverlabs / winget-configure.ps1
Created June 20, 2023 19:25
This script installs VS Code using winget configure (DSC) feature
winget configure -f .\vscode.dsc.yaml --accept-configuration-agreements