Skip to content

Instantly share code, notes, and snippets.

View MattHodge's full-sized avatar

Matthew Hodgkins MattHodge

View GitHub Profile
@MattHodge
MattHodge / expression-destructure-json.yaml
Last active October 20, 2023 03:35
argo-workflow-design-patterns
# From https://github.com/argoproj/argo-workflows/blob/master/examples/expression-destructure-json.yaml
apiVersion: argoproj.io/v1alpha1
kind: Workflow
metadata:
generateName: expression-destructure-json-
annotations:
workflows.argoproj.io/version: ">= 3.1.0"
spec:
arguments:
parameters:
@MattHodge
MattHodge / basic_appgw.bicep
Created January 31, 2022 12:06
Basic AppGW
param name string
param subnetId string
param publicIpId string
var nameFrontendPortHTTP = 'frontend-port-http'
var nameFrontendIPConfiguration = 'frontend-ip'
var nameHTTPListener = 'placeholder_http_listener_managed_by_bicep'
var nameBackendAddressPool = 'placeholder_backend_address_pool_managed_by_bicep'
var nameBackendHttpSettings = 'DefaultHTTP'
@MattHodge
MattHodge / Save-Download.ps1
Created April 11, 2021 13:03
Save-Download.ps1
function Save-Download {
<#
.SYNOPSIS
Given a the result of WebResponseObject, will download the file to disk without having to specify a name.
.DESCRIPTION
Given a the result of WebResponseObject, will download the file to disk without having to specify a name.
.PARAMETER WebResponse
A WebResponseObject from running an Invoke-WebRequest on a file to download
.EXAMPLE
# Download Microsoft Edge
@MattHodge
MattHodge / tasks.json
Created July 21, 2018 16:17
VSCode CloudFormation Tasks
{
"version": "2.0.0",
"tasks": [
{
"label": "CF Type Search",
"type": "shell",
"command": "open -a \"Google Chrome\" \"https://docs.aws.amazon.com/search/doc-search.html?searchPath=documentation-guide&searchQuery=%22${selectedText}%22&x=0&y=0&this_doc_product=AWS+CloudFormation&this_doc_guide=User+Guide&doc_locale=en_us#facet_doc_product=AWS%20CloudFormation&facet_doc_guide=User%20Guide\"",
"problemMatcher": [],
"presentation": {
"reveal": "never"
func getDeploymentStepIISSchema() *schema.Schema {
schmeaToReturn := &schema.Schema{
Type: schema.TypeList,
Optional: true,
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"web_application_parent_website_name": {
Type: schema.TypeString,
Description: "Create or update an IIS Web Application as a child of an existing IIS Web Site",
Optional: true,
@MattHodge
MattHodge / ListVMsOnClusterForDPM.ps1
Created September 16, 2017 21:58
ListVMsOnClusterForDPM.ps1
# Please Specify The FQDN or IP address of your DPM Server
$DPMServerName = "YOUR DPM SERVER"
# DSConfig.ps1
$infoText = "This script will generate the DatasourceGroups.xml file in the current path. Once this file is created merge it with the same file name under %programfiles%\Microsoft DPM\DPM\Config directory on the DPM server. Read the documentation for more details."
echo $infoText
$header = "<?xml version=`"1.0`" encoding=`"utf-16`"?> `n <DatasourceGroup xmlns:xsi=`"http://www.w3.org/2001/XMLSchema-instance`" xmlns:xsd=`"http://www.w3.org/2001/XMLSchema`" xmlns=`"http://schemas.microsoft.com/2003/dls/GroupDatasourceByDisk.xsd`">"
$footer = "</DatasourceGroup>"
@MattHodge
MattHodge / SetSSHMaxSessions.sh
Last active November 7, 2016 07:57
SetSSHMaxSessions.sh
echo "MaxSessions 50" | sudo tee -a /etc/ssh/sshd_config > /dev/null
sudo systemctl restart ssh.service
netsh advfirewall firewall set rule name="WinRM-HTTP" new action=allow
netsh advfirewall firewall set rule name="WinRM-HTTP" new action=block
C:/windows/system32/sysprep/sysprep.exe /generalize /oobe /unattend:C:/Windows/packer/unattended.xml /quiet /shutdown
[cmdletbinding()]
param(
[switch]$SkipAtlas,
[Parameter(Mandatory=$true)]
[ValidateSet("Win2012R2", "Win2016StdCore")]
$OSName
)
switch ($OSName)
{