Skip to content

Instantly share code, notes, and snippets.

View celloza's full-sized avatar

Marcel du Preez celloza

  • Stratford-upon-Avon, UK
View GitHub Profile
@celloza
celloza / Modify-AzureVpnConfigFile.ps1
Last active December 14, 2023 15:18
Populate the custom routes element in an Azure VPN P2S client config with Public IP addresses from Azure Subscriptions
<#
.Synopsis
Modifies an Azure VWAN P2S config file from existing Azure PublicIP resources.
.DESCRIPTION
This script modifies an existing Azure VWAN P2S config file that was downloaded from the Azure Portal, by:
1. Adding a customroute element for each Public IP address found in the supplied list of subscriptions
2. (optional) Change the name displayed in the Azure VPN client
3. (optional) Add custom DNS servers
4. (optional) Add a custom route to a test service (icanhazip.com) to test split-tunneling
5. (optional) Excludes some specified IP addresses

Keybase proof

I hereby claim:

  • I am celloza on github.
  • I am celloza (https://keybase.io/celloza) on keybase.
  • I have a public key ASDJOCwGNrmmie03ljxJhAFmCPX8G3Wf5A6nJK_D-fxLugo

To claim this, I am signing this object:

@celloza
celloza / zigbee2mqtt_aqara_wireless_switch.yaml
Created June 19, 2022 19:59 — forked from rhl2401/zigbee2mqtt_aqara_wireless_switch.yaml
Aqara Wireless Switch (single, double, hold)
blueprint:
name: Aqara Wireless Switch (single, double, hold)
description: 'Control anything using Aqara Wireless Switch.
Customizable actions for each press.
This version of the blueprint is for buttons supporting single, double and hold actions.
'
domain: automation
param (
[Parameter(Mandatory=$true)]
[string]$feedName,
[Parameter(Mandatory=$true)]
[string]$url
)
$profilePath = [System.Environment]::GetFolderPath([System.Environment+SpecialFolder]::UserProfile)
$pluginLocation = [System.IO.Path]::Combine($profilePath, ".nuget", "plugins");
@celloza
celloza / hcl-resize-vm.ps1
Created April 29, 2022 22:32
Azure Runbook to resize a VM
param
(
[Parameter (Mandatory = $true)]
[string] $ResourceGroupName,
[Parameter (Mandatory = $true)]
[string] $VMName,
[Parameter (Mandatory = $true)]
[string] $NewVMSize,
[Parameter (Mandatory = $true)]
[bool] $EnableAcceleratedNetworking
@celloza
celloza / Dismiss-AzSecurityAlertByTypeInSubscription.ps1
Created March 8, 2022 11:10
This script iterates over results from the Azure Management API for Microsoft Defender for Cloud Security alerts, and takes the relevant action (usually to dismiss). It was created in order to dismiss thousands of Adaptive Application Control policy violations while the policy was being tuned to no longer show false positives.
<#
.Synopsis
Dismisses Microsoft Defender for Cloud Security Alerts in bulk.
.DESCRIPTION
This script iterates over results from the Azure Management API for Microsoft Defender for Cloud Security alerts, and takes the relevant action (usually to dismiss). It was
created in order to dismiss thousands of Adaptive Application Control policy violations while the policy was being tuned to no longer show false positives.
.INPUTS
Manually set in the script.
.OUTPUTS
Host output with the results of what has happened.