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 / 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 / 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 / 00_Blog_Win10_Development_PC_Install.ps1
Last active December 29, 2020 22:57
00_Blog_Win10_Development_PC_Install.ps1
# Configure PowerShell Execution Policy
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Force
# Install Chocolatey
iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1'))
# Install the required apps
choco install git.install -y
choco install virtualbox -y
choco install vagrant -y
<#
.Synopsis
Short description
.DESCRIPTION
Long description
.EXAMPLE
Example of how to use this cmdlet
.EXAMPLE
Another example of how to use this cmdlet
#>
@MattHodge
MattHodge / ! Windows NXLog | Linux NXLog | LogStash
Last active January 14, 2020 20:30
Configuration files for NXLog on Windows ---> NXLog on Ubuntu --> LogStash
Covers configuration for NXLog installed on Windows, transfering to NXLog installed on Linux to LogStash.
NXLog is used for IIS logs. (http://nxlog-ce.sourceforge.net/)
Snare is used for Windows Event Logs. (http://www.intersectalliance.com/projects/SnareWindows/index.html#Download)
@MattHodge
MattHodge / ReplaceStorageSpacesFailedDisk.ps1
Created February 5, 2016 13:03
ReplaceStorageSpacesFailedDisk.ps1
# Find the failed Disk
Get-PhysicalDisk
# Shutdown, take the disk out and reboot. Set the missing disk to a variable
$missingDisk = Get-PhysicalDisk | Where-Object { $_.OperationalStatus -eq 'Lost Communication' }
# Retire the missing disk
$missingDisk | Set-PhysicalDisk -Usage Retired
# Find the name of your new disk
@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>"