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
netstat -teplnu | grep perl |
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
$services = Get-Service | ? { $_.name -like "MSExchange*" -and $_.Status -eq "Running"} | |
foreach ($service in $services) | |
{ | |
Restart-Service $service.name -Force | |
} |
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
$SERVERNAME = "SERVERNAME" | |
$COMPONENT = "ServerWideOffline" | |
(Get-ServerComponentState -Identity $SERVERNAME -Component $COMPONENT).LocalStates |
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
$SERVERNAME = "SERVERNAME" | |
(Get-ServerComponentState -Identity $SERVERNAME).LocalStates |
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
/* | |
trimChar | |
Trims a specific char from bounds of variable | |
parameters | |
string (string) - String to be trimmed | |
charToRemove (char) - Char to be removed from string | |
*/ | |
function trimChar(string, charToRemove) { | |
while (string.charAt(0) == charToRemove) string = string.substring(1); | |
while (string.charAt(string.length - 1) == charToRemove) string = string.substring(0, string.length - 1); |
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
/* | |
padInteger | |
Pads an integer with leading zeros | |
parameters | |
n (integer) - Integer to be padded | |
width (integer) - Padding width | |
z (string) - Character to pad integer with, default is '0' | |
*/ | |
function padInteger(n, width, z) { | |
z = z || '0'; |
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
/* | |
waitForJqueryInjection | |
Waits for jQuery injection with puppeteer | |
parameters | |
page (object) - Puppeteer page object | |
*/ | |
async function waitForJqueryInjection(page) { | |
// Waiting for jQuery injection | |
console.log('Waiting for jQuery injection > (page)'); | |
const watchDog = page.waitForFunction('window.jQuery !== undefined'); |
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
/* | |
delayScript | |
Delays script execution | |
parameters | |
time (integer) - Time to delay scripts execution | |
*/ | |
async function delayScript(time) { | |
return new Promise(function(resolve) { | |
setTimeout(resolve, time); | |
}); |
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
/* | |
pageSimpleScriptInjection | |
Simple page script injection with puppeteer | |
parameters | |
page (object) - Puppeteer page object | |
*/ | |
async function pageSimpleScriptInjection(page, scriptName) { | |
scriptName = scriptName || "injectedScript.js"; | |
// Adding injectedScript.js | |
console.log(`Adding ${scriptName} > (page)`); |
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
/* | |
getNamedIframe | |
Returns a named iframe handle with puppeteer | |
parameters | |
page (object) - Puppeteer page object | |
iframeName (string) - iframe name | |
*/ | |
async function getNamedIframe(page, iframeName) { | |
iframeName = iframeName || 'main'; | |
// Identify frame |