Skip to content

Instantly share code, notes, and snippets.

@russellds
russellds / Launch
Last active July 7, 2024 18:55
Omakub
wget -qO- https://gist.githubusercontent.com/russellds/feb8b8d75dfb995b17d3470a1f432044/raw/install.sh | bash
@russellds
russellds / ubuntu-2404-setup-config.md
Last active June 26, 2024 03:15
Ubuntu 24.04 Setup and Configuration

Ubuntu 24.04 Setup and Configuration

Hyper-V VM Creation

  1. Download Ubuntu 24.04
  2. In Hyper-V use "new" to create VM.
  3. Enter values in "new" VM wizard, select "Generation 2".
  4. Complete VM wizard.
  5. Right click physical computer in "Hyper-V Manager" and select "Settings...".
  6. Select "Security" and uncheck "Enable Secure Boot" checkbox.
@russellds
russellds / winget.json
Created September 21, 2023 18:57
Software-Computer-Baseline
‎‎​
<#
.SYNOPSIS
Replace tokens in a file with values.
.DESCRIPTION
Finds tokens in a given file and replace them with values. It is best used to replace configuration values in a release pipeline.
.PARAMETER InputFile
The file containing the tokens.
@russellds
russellds / Standards.bicep
Created May 25, 2023 20:40
Bicep Standards Module
targetScope = 'subscription'
@description('The environment abbreviation.')
@allowed([
'prod'
'prev'
'demo'
'test'
'dev'
'infra'
@russellds
russellds / tasks.json
Created May 25, 2023 19:05
VS Code Setup for Bicep
{
"version": "2.0.0",
"tasks": [
{
"label": "Remove Telemetry",
"type": "shell",
"command": "${workspaceFolder}/.vscode/scripts/RemoveTelemetry.ps1",
"args": [
"-WorkspacePath",
"${workspaceFolder}"
param(
[string]$WorkspacePath
)
$InformationPreference = 'Continue'
Write-Information "Workspace Path: $( $WorkspacePath )"
Set-Location -Path $WorkspacePath
$telemetryStrings = @()
@russellds
russellds / Injection.psm1
Created April 22, 2022 20:36
Injection PowerShell Module
function doStuff {
param(
[string]
$Item,
[string]
$Value = 'default'
)
$htDoStuff.($Item) = $Value
@russellds
russellds / foreach-parallel-sync-hash.ps1
Created April 22, 2022 20:19
ForEach-Object -Parallet with a Synchronized HashTable and Injecting a Function
function doStuff {
param(
[string]
$Item
)
$htDoStuff.($Item) = @{}
}
$stringFuncDoStuff = "${function:doStuff}"
@russellds
russellds / GetWinDisks.ps1
Last active October 29, 2019 18:46
List Windows Disk with Boot Disk First
# Empty Array to hold disks in boot disk always first order.
$disks = @()
# Identify the boot partition
$bootPartition = Get-WmiObject -Class Win32_DiskPartition |
Where-Object {$_.BootPartition}
# Identify the boot disk using the boot partition
$bootDisk = Get-WmiObject -Class Win32_DiskDrive |
Where-Object {$_.Index -eq $bootPartition.DiskIndex} |