Skip to content

Instantly share code, notes, and snippets.

View colddaemon1's full-sized avatar
๐Ÿ˜ƒ

Nick Little colddaemon1

๐Ÿ˜ƒ
View GitHub Profile
@colddaemon1
colddaemon1 / hugodeploy.sh
Created November 5, 2022 09:05
Deploy Hugo to AWS S3 and Invalidate CloudFront cache
#!/bin/bash
set -e
#The โ€œset โ€“eโ€ allows an exception to throw where it finds the error
#and then the halt execution. Error message and line number displayed (in lieu of me using more robust error handling logic)
# Execute this script your Hugo site directory (e.g mine is /%fullcanoicalpath%/nicklittle
# Using AWS CLI V2, setup using `aws configure sso` FIRST
#Variable Declaration, add your CloudFront distribtuion ID, S3 bucket name, and AWS Profile Name
@colddaemon1
colddaemon1 / domainjoin_params.json
Created November 14, 2018 20:02
Domain Join Existing VM's to Azure AD - Parameters
{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentParameters.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"location": {
"value": "Australia East"
},
"vmList": {
"value": "vm01,vm02,vm03"
},
@colddaemon1
colddaemon1 / domainjoin.json
Created November 14, 2018 19:42
Join Existing Azure VM's to Azure Active Directory
{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"vmList": {
"type": "string",
"minLength": 1,
"metadata": {
"description": "List of virtual machines to be domain joined, if using multiple VMs, make their names comma separate. E.g. VM01, VM02, VM03."
}
@colddaemon1
colddaemon1 / domain_joins_parms.json
Created November 7, 2018 19:55
Azure AD domain join params ARM
{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentParameters.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"location": {
"value": "Central US"
},
"vmList": {
"value": "nick-vm, nick-vm1"
},
@colddaemon1
colddaemon1 / domain_join.json
Created November 7, 2018 19:54
Azure AD domain join ARM
{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"vmList": {
"type": "string",
"minLength": 1,
"metadata": {
"description": "List of virtual machines to be domain joined, if using multiple VMs, make their names comma separate. E.g. VM01, VM02, VM03."
}
@colddaemon1
colddaemon1 / ARM_deploy.ps1
Last active November 1, 2018 02:19
ARM template PoSh deploy
# Set deployment variables
$name = "ExampleDeployment" #Modify this per deployment
$template = "/ARM_repo/Microsoft.RecoveryServices/VMBackupVault/rsv_vault_create.json"
$params = "/ARM_repo/Microsoft.RecoveryServices/VMBackupVault/params_rsv.json"
# Deploy template and params
New-AzureRmResourceGroupDeployment
-Name $name `
-TemplateFile $template `
-TemplateParameterFile $params
@colddaemon1
colddaemon1 / deployarmlocally.sh
Created November 1, 2018 02:16
ARM local deploy with Azure PowerShell
New-AzureRmResourceGroupDeployment -Name ExampleDeployment -TemplateFile rsv.json -TemplateParameterFile rsv_params.json
@colddaemon1
colddaemon1 / azurepsconnect.sh
Created November 1, 2018 02:13
connect to Azure PowerShell
Login-AzureRmAccount
@colddaemon1
colddaemon1 / deploy.ps1
Last active November 1, 2018 02:08
Azure Cloud Shell - PowerShell ARM deployment example
New-AzureRmResourceGroupDeployment -Name ExampleDeployment -TemplateUri https://abc12345.blob.core.windows.net/templates/create_rg.json ` -TemplateParameterUri https://abc12345.blob.core.windows.net/templates/params_rg.json
@colddaemon1
colddaemon1 / params_rsv.json
Created October 31, 2018 23:00
ARM parameters for recovery services vault creation
{
"$schema": "http://schema.management.azure.com/schemas/2015-01-01/deploymentParameters.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"vaultName": {
"value": "VMBackupVault"
},
"location":{
"value": "Australia East"
},