This file contains 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
#Checks if JobAlerts has written a log in the last 30 minutes. Restarts it if it has not. | |
#Should it do stuff, It sends an email | |
#Pierce Fortin pfortin@smashfly.com | |
#Logic test on a working service: Change -lt on 28 to -gt | |
#ScriptSettings | |
$WaitPeriod = '20' #Wait time in seconds before starting a service if it is in a failed state | |
$LogPath = 'C:\scripts\jobalerter\runlog.log' | |
$serviceName = 'ServiceName' |
This file contains 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
#X-XSS-Protection iRule | |
#By: Pierce Fortin (pfortin@smashfly.com) | |
#Checks for domain being requested on HTTP_Request, Sets flag for response rewrite if match | |
#If match, It then checks for X-XSS-Protection as existing, if it doesn't exist it adds one | |
#If match and header !exist, It adds it. | |
#v1.0 6/19/2018 Initial write | |
when RULE_INIT | |
{ |
This file contains 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
#X-FRAME-OPTIONS iRule | |
#By: Pierce Fortin (pfortin@smashfly.com) | |
#Checks for domain being requested on HTTP_Request, Sets flag for response rewrite if match | |
#If match, It then checks for X-Frame-Options as existing, if it doesn't exist it adds X-FRAME-OPTION | |
#If match and header !exist, It adds it. | |
#v1.0 6/18/2018 Initial write | |
when RULE_INIT | |
{ |
This file contains 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
#Referrer-Policy iRule | |
#By: Pierce Fortin (pfortin@smashfly.com) | |
#Checks for domain being requested on HTTP_Request, Sets flag for response rewrite if match | |
#If match, It then checks for Referrer-Policy as existing, if it doesn't exist it adds one | |
#If match and header !exist, It adds it. | |
#v1.0 6/19/2018 Initial write | |
when RULE_INIT | |
{ |
This file contains 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
#HSTS iRule | |
#TL;DR Adds HSTS header set to expire 1 year from client accept to domains in array | |
#By: Pierce Fortin (pfortin@smashfly.com) | |
#Sets expire data to 1 year from client accept | |
#Checks for domain being requested on HTTP_Request, Sets flag for response rewrite if match | |
#If match, It then checks for HSTS as existing, if it doesn't exist it adds HSTS, Based on 1 year from when the client accepted | |
#If match and header !exist, It adds it. | |
#v1.0 6/18/2018 Initial write | |
This file contains 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
#Header Remover iRule | |
#By: Pierce Fortin (pfortin@smashfly.com) | |
#Checks for domain being requested on HTTP_Request, Sets flag for response rewrite if match | |
#If match, It looks for headers and removes them if they exist. | |
#v1.0 6/19/2018 Initial write | |
when RULE_INIT | |
{ | |
set static::headerremoveDebugOn 0 |
This file contains 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
#Fixes Network performance issues on certain Windows Server VMs when under CPU contention | |
#Set global settings | |
$adapters = @() | |
netsh int tcp set global chimney=Disabled | |
netsh int tcp set global autotuninglevel=Disabled | |
netsh int tcp set supplemental custom congestionprovider=none | |
netsh int tcp set global ecncapability=Disabled | |
netsh int ip set global taskoffload=disabled | |
netsh int tcp set global timestamps=Disabled |
This file contains 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
#Loads a plain text list of VMs, Bulk adds disks based on specs below. | |
#If you do not have a credential.xml run the following to generate: | |
#$credpath = "c:\scripts\MyCredential.xml" ##Path to store credentials | |
#New-Object System.Management.Automation.PSCredential("VSPHERE.LOCAL\Administrator", (ConvertTo-SecureString -AsPlainText -Force "Plaintext password")) | Export-CliXml $credpath | |
$vmlist = Get-Content -Patch "c:\scripts\vms.txt" #Location of VMList | |
$size = "40" #Disk Size in GB | |
$format = "thick" #Disk Format | |
$datastore = "VMFS07_PURE04" #Datastore name |
NewerOlder