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
// A function test if an element is present in an Array. | |
// Arrays.asList(Array).contains(string); | |
function f_Is_In_Array(elem, array, i) { | |
var len; | |
var indexOf = Array.prototype.indexOf; | |
if (array) { | |
if (indexOf) { | |
return indexOf.call(array, elem, i); | |
} |
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
// create a zip file of the log directory.. | |
function f_CreateZip() { | |
var shell = new ActiveXObject("Shell.Application"); | |
var fs_obj = new ActiveXObject("Scripting.FileSystemObject"); | |
var zipFilename = strLogPath.path + '\\' + sActiveConfig + '-LogFiles.zip'; | |
// create an empty zipfile :-) | |
var zipFile = fs_obj.CreateTextFile(zipFilename, 1, 0); | |
zipFile.Write('PK' + String.fromCharCode(5, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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
//call a REST Api | |
var http = require('http'); | |
var sAPIKey = '939f36408065e19b83f5f8352573257e' | |
var options = { | |
hostname: 'api.openweathermap.org', | |
port: 80, | |
path: '/data/2.5/weather?lat=33.265014&lon=-111.839105&appid=' + sAPIKey, | |
method: 'POST', | |
headers: { |
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
//post to a SOAP API | |
var http = require('http'); | |
var s_Pan = '378282246310005'; //get the unprotected PAN from the form | |
var s_DPFormat = 'CC'; //get the data protection Format | |
var s_Identity = '[email protected]'; //get the data protection Format | |
var s_AuthInfo = 'p3ssw3rd'; //get the data protection Format | |
//Marshal up a ProtectFormattedData SOAP Mesage: | |
var soapRequest = |
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
//get a web resource: REST Api Post | |
var apiKey = '939f36408065e19b83f5f8352573257e'; | |
function c3rl() { | |
try { | |
var xhr = new ActiveXObject("MSXML2.ServerXMLHTTP.6.0"); | |
xhr.open("POST", 'http://api.openweathermap.org/data/2.5/weather?lat=33.265019&lon=-111.839103&appid=' + apiKey, false); | |
xhr.setRequestHeader('Content-Type', 'application/json'); xhr.setRequestHeader('Accept', 'application/json'); |
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
/* | |
2016 Gordon Young, [email protected] | |
An example for calling the LiebSoft ERPM REST API | |
This Javascript calls the DoLogin2 method | |
and returns an API token for calling further methods | |
*/ | |
var http = require('https'); //Call the API over HTTPS | |
//ignore Self-Signed SSL Certificate in test environment *** NEVER DO THIS IN PRODUCTION *** |
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
// Gordon Young 2016 [email protected] | |
// This script : | |
// 1. Reads the given Windows registry subkey value reg_multi_sz data type | |
// 2. Compares it to the provided expected setting | |
// if the configured setting is compliant the script returns 'pass', | |
// if the setting is non-compliant the script returns 'fail' | |
//The registry path we want to test | |
var hklm = 0x80000002, KeyName = "SYSTEM\\CurrentControlSet\\Control\\SecurePipeServers\\winreg\\AllowedExactPaths", ValueName = "Machine"; |
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
// Gordon Young 2016 [email protected] | |
// This script : | |
// 1. Reads the given Windows registry subkey value reg_multi_sz data type | |
// 2. Compares it to the provided expected setting | |
// if the configured setting is compliant the script returns 'pass', | |
// if the setting is non-compliant the script returns 'fail' | |
//The registry path we want to test | |
var hklm = 0x80000002, KeyName = "SYSTEM\\CurrentControlSet\\services\\Netlogon\\Parameters", ValueName = "RequireStrongKey"; |
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
/** | |
* Gordon Young [email protected] | |
* Windows Registry Write template | |
*/ | |
// Instantiate a Windows Shell | |
var objShell = new ActiveXObject("WScript.Shell"); | |
//disable DisableWindowsConsumerFeature | |
objShell.RegWrite("HKEY_LOCAL_MACHINE\\Software\\Policies\\Microsoft\\Windows\\System\\AllowDomainPINLogon", 0, "REG_DWORD"); |
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
{ | |
"AWSTemplateFormatVersion": "2010-09-09", | |
"Description": "AWS CloudFormer Beta - template creation prototype application. This tool allows you to create an AWS CloudFormation template from the AWS resources in your AWS account. **Warning** This template creates a single EC2 instance in your account to run the application - you will be billed for the instance at normal AWS EC2 rates.", | |
"Parameters": { | |
"Username": { | |
"Description": "Username to log in to CloudFormer", | |
"Type": "String" | |
}, | |
"Password": { | |
"Description": "Password to log in to CloudFormer", |
OlderNewer