This file contains hidden or 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
# Modified version of https://gist.github.com/angelo-v/e0208a18d455e2e6ea3c40ad637aac53#file-jwt-decode-sh that | |
# retrieves the Access Token of the current Azure Account you are logged in as. | |
# will not work in all cases, see https://gist.github.com/angelo-v/e0208a18d455e2e6ea3c40ad637aac53#gistcomment-3439904 | |
function jwt-decode() { | |
sed 's/\./\n/g' <<< $(cut -d. -f1,2 <<< $1) | base64 --decode | jq | |
} | |
az account show |
This file contains hidden or 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 | |
: ' | |
Name: cleanup-role-assignments-for-non-existing-principals.sh | |
Author: Ryan Irujo | |
Description: This scripts is for resolving the issue in the article below. | |
https://learn.microsoft.com/en-us/answers/questions/672875/azure-managed-identity-role-assignment-is-not-dele |
This file contains hidden or 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
# Windows 10 Customize, post-install. | |
# | |
$key = 'HKCU:\Control Panel\Desktop' | |
Set-ItemProperty -Path $key -Name 'WallPaper' -Value '' | |
Stop-Process -ProcessName explorer | |
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Internet Explorer\Main" -Name "DisableFirstRunCustomize" -Value 2 | |
Add-Type -typedefinition "using System;`n using System.Runtime.InteropServices;`n public class PInvoke { [DllImport(`"user32.dll`")] public static extern bool SetSysColors(int cElements, int[] lpaElements, int[] lpaRgbValues); }"; [PInvoke]::SetSysColors(1, @(1), @(0x000000)) | |
Reg Add "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects" /v "VisualFXSetting" /t REG_DWORD /d 2 /f | |
Reg Add "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects" /v "VisualFXSetting" /t REG_DWORD /d 3 /f | |
Reg Add "HKCU\Control Panel\Desktop" /v "UserPreferencesMask" /t REG_BINARY /d "90 32 07 80 10 00 00 00" /f |
This file contains hidden or 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 | |
sudo apt-get update && \ | |
sudo apt-get install -y ca-certificates vim jq curl wget docker.io apt-transport-https lsb-release gnupg net-tools make && \ | |
curl -sL https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor | sudo tee /etc/apt/trusted.gpg.d/microsoft.asc.gpg > /dev/null && \ | |
AZ_REPO=$(lsb_release -cs) && \ | |
echo "deb [arch=amd64] https://packages.microsoft.com/repos/azure-cli/ $AZ_REPO main" | sudo tee /etc/apt/sources.list.d/azure-cli.list && \ | |
sudo apt-get update && \ | |
sudo apt-get install -y azure-cli && \ | |
wget -q https://packages.microsoft.com/config/ubuntu/18.04/packages-microsoft-prod.deb && \ |
# Installing Chocolatey
Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iwr https://chocolatey.org/install.ps1 -UseBasicParsing | iex
choco feature enable -n=allowGlobalConfirmation
choco install git
choco install vscode --params "/NoQuickLaunchIcon"
choco install googlechrome
This file contains hidden or 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 | |
# wget -O - {URL} | bash | |
apt-get update -fq && \ | |
apt-get install -q openssl libffi python clang make && \ | |
apt-get install -q openssh nano && \ | |
pip install --user virtualenv | |
cat << EOF > ~/.bashrc | |
PATH=$PATH:~/.local/bin |
This file contains hidden or 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
#!/usr/bin/env python3 | |
# | |
# Name: delete-unattached-managed-disks.py | |
# | |
# Author: Ryan Irujo | |
# | |
# Description: Python script for removing unattached managed disks in an Azure Subscription. | |
# | |
# Notes: You must already be logged into an Azure Subscription for this script to work. | |
# |
This file contains hidden or 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
#!/usr/bin/env python3 | |
# | |
# Name: query-rg.py | |
# | |
# Author: Ryan Irujo | |
# | |
# Description: Script demonstrating how to query for an Azure Resource Group using the Azure CLI and Python. | |
# | |
# Notes: You must already be logged into an Azure Subscription for this script to work. | |
# |
This file contains hidden or 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
# Instructions to Install AzureAD PowerShell on PowerShell Core. | |
Get-InstalledModule | |
Install-Module -Name Az -Repository PSGallery -AllowClobber -Force | |
Install-Module -Name AzureADPreview -Repository PSGallery -AllowClobber -Force | |
Install-Module -Name 'AzureAD.Standard.Preview' -Repository 'Posh Test Gallery'-SkipPublisherCheck -AllowClobber -Force | |
Import-Module Az.Resources | |
Import-Module AzureAD.Standard.Preview |
NewerOlder