This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Azure Location ShortCode Switch | |
switch ($location) { | |
'eastus' { $locationShortCode = 'eus' } | |
'eastus2' { $locationShortCode = 'eus2' } | |
'westus' { $locationShortCode = 'wus' } | |
'westus2' { $locationShortCode = 'wus2' } | |
'northcentralus' { $locationShortCode = 'ncus' } | |
'southcentralus' { $locationShortCode = 'scus' } | |
'centralus' { $locationShortCode = 'cus' } | |
'canadacentral' { $locationShortCode = 'cc' } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Hugo Check and Install (Windows) | |
on: | |
push: | |
branches: | |
- main | |
workflow_dispatch: | |
# Uncomment the following lines if you want to add pull request triggers | |
# pull_request: | |
# types: [opened, synchronize, reopened, closed] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Hugo Check and Install (Linux) | |
on: | |
push: | |
branches: | |
- main | |
workflow_dispatch: | |
# Uncomment the following lines if you want to add pull request triggers | |
# pull_request: | |
# types: [opened, synchronize, reopened, closed] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$wc = New-Object net.webclient | |
$wc.Downloadfile($video_url, $local_video_url) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Get-UsableAddressSpace { | |
param ( | |
[Parameter(Mandatory = $true)] | |
[string]$CIDR | |
) | |
# Function to convert IP address to integer | |
function ConvertTo-Int { | |
param ($ip) | |
$i = 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Function - Get Azure Virtual Machine System Uptime | |
function Get-AzSystemUptime { | |
param ( | |
[string] $subscriptionId, | |
[string] $resourceGroup, | |
[string] $vmName | |
) | |
if ($subscriptionId) { | |
Set-AzContext -SubscriptionId $subscriptionId | Out-Null |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Microsoft Hyper-V Intergration Services (Ubuntu/Debian Install Script) | |
# Author: Simon Lee | |
# Script Revision: 1.0 | |
# Description: Install linux-virtual kernal for Ubuntu/Debian Server | |
# Clear Current Screen | |
clear | |
# Check Session Status |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Get the value of a REG_BINARY from the registry | |
$value = Get-ItemProperty -Path "Registry::HKEY_LOCAL_MACHINE\Path\To\Your\Key" -Name "ValueName" | |
# Convert the REG_BINARY value to a readable format | |
$readableValue = [System.BitConverter]::ToString($value.ValueName) | |
# Display the readable format | |
Write-Output $readableValue |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# AutoBuild Operating System Installation | |
if ($autoBuild) { | |
Write-Output `r "ABC :: AutoBuild is enabled, Applying Operating System Image..." `r | |
Write-Output "ABC :: Checking AutoBuild Configuration..." `r | |
Write-Output "ABC :: VM Generation: [$hvGeneration]" | |
Write-Output "ABC :: Iso Path: [$isoPath]" | |
# Mount OS Disk | |
Write-Output `r "ABC :: Mounting OS Disk" | |
$osDiskContext = Mount-VHD -Path $osDiskPath | Out-Null |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This is a public gist | |
created in January 2024 | |
to show case Hugo Gist Shorcodes. | |
- Created by Simon, 16-01-2024 |
NewerOlder