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
// 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 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 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 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 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 gyoung@svb.com | |
// 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 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 gyoung@svb.com | |
// 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 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 gjyoung1974@gmail.com | |
* 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 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", |
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
#!/bin/bash | |
#==================================================================================== | |
# Name : certenroll_mac.sh | |
# Author : Gordon Young, gjyoung1974@gmail.com | |
# Version : .01 | |
# Copyright : 2016 Gordon Young | |
# Description : A script to enroll a Mac OSX 10.11 device for a machine certificate | |
# : via a Microsoft Certificate Services CA | |
# Reference : This script supports the requirements in |
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
#Set up some variables for later use. | |
$seperator = "=","," | |
$ADConfiguration = Get-ADRootDSE | Select configurationNamingContext | |
$OIDPath = "AD:\CN=OID,CN=Public Key Services,CN=Services," + $ADConfiguration.configurationNamingContext.ToString() | |
#Pull the AD certificates from the object | |
$computerObject = Get-ADComputer -Filter * | |
#Forced to iterate through each computer so we can manipulate it later | |
ForEach ($computer in $ComputerObject.Name) { |
OlderNewer