Skip to content

Instantly share code, notes, and snippets.

@arjancornelissen
arjancornelissen / Enable-PIMGraph.ps1
Last active April 15, 2024 16:54
Enable PIM role via the Graph PowerShell Modules
# Connect via deviceauthentication and get the TenantID and User ObjectID
Connect-MgGraph -UseDeviceAuthentication
$context = Get-MgContext
$currentUser = (Get-MgUser -UserId $context.Account).Id
# Get all available roles
$myRoles = Get-MgRoleManagementDirectoryRoleEligibilitySchedule -ExpandProperty RoleDefinition -All -Filter "principalId eq '$currentuser'"
# Get SharePoint admin role info
$myRole = $myroles | Where-Object {$_.RoleDefinition.DisplayName -eq "SharePoint Service Administrator"}
#!/bin/bash
RAW_STATUS=$(python3 ~/src/starlink-grpc-tools/dish_grpc_text.py -s 2 status)
STARLINK_CONNECTED=$(echo "$RAW_STATUS" | cut -f 5 -d',')
if [[ "${STARLINK_CONNECTED}" == "CONNECTED" ]]; then
STARLINK_CONNECTED='${color green}'"CONNECTED"'${color}'
elif [[ "${STARLINK_CONNECTED}" == "OFFLINE" ]]; then
STARLINK_CONNECTED='${color red}'"OFFLINE"'${color}'
else
STARLINK_CONNECTED='${color yellow}'"${STARLINK_CONNECTED}"'${color}'
#!/bin/sh
set -eu
# Docker
sudo apt remove --yes docker docker-engine docker.io \
&& sudo apt update \
&& sudo apt --yes --no-install-recommends install \
apt-transport-https \
ca-certificates \
@ausfestivus
ausfestivus / AzureRegionData.md
Last active May 19, 2024 13:59
A list of the Azure regions

List of Azure Regions

A list of all the region names and locations for Azure

Creating the list

You can recreate the list anytime using this command:

az account list-locations -o table
@alan-finn
alan-finn / AwsDnsBackup.ps1
Last active May 16, 2024 21:07
Powershell wrapper for the cli53 utility to backup Route53 zones.
if ($null -eq (Get-Module -Name AWSPowerShell)) {
Import-Module AWSPowerShell
}
$AwsDnsBucketName = "NAME_OF_AWS_BUCKET"
$AwsCredProfileName = "NAME_OF_AWS_PROFILE"
$SmtpServer = "SMTP_SERVER"
$FromAddress = "FROM_ADDRESS"
$ToAddress = "RECIPIENT_ADRESS"