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
| variable "access_key" { | |
| description = "Access key to AWS console" | |
| } | |
| variable "secret_key" { | |
| description = "Secret key to AWS console" | |
| } | |
| variable "instance_name" { | |
| description = "Name of the instance to be created" |
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
| provider "aws" { | |
| access_key = "${var.access_key}" | |
| secret_key = "${var.secret_key}" | |
| region = "us-west-2" | |
| } | |
| resource "aws_instance" "ec2_instance" { | |
| ami = "${var.ami_id}" | |
| instance_type = "${var.instance_type}" | |
| key_name = "${var.ami_key_pair_name}" |
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
| │ Error: Missing required argument | |
| │ | |
| │ with vsphere_virtual_machine.vm, | |
| │ on instance.tf line 95, in resource "vsphere_virtual_machine" "vm": | |
| │ 95: windows_options { | |
| │ | |
| │ "clone.0.customize.0.windows_options.0.domain_admin_password": all of | |
| │ `clone.0.customize.0.windows_options.0.domain_admin_password,clone.0.customize.0.windows_options.join_domain` | |
| │ must be specified |
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
| <# | |
| Since ServiceNow will only allow 10,000 records to be exported by default we need to use pagingation for large exports. | |
| This script will query the table api for the selected table and loop through blocks of 10,000 until all records are retrived. | |
| It then converts the JSON payload to a CSV | |
| #> | |
| # Set ServiceNow credentials | |
| $username = "admin" | |
| $password = "pass" | |
| $securePassword = ConvertTo-SecureString $password -AsPlainText -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
| //Instant Trivia Game with a simple background script. | |
| //This script will create a Trivia table in your CMDB and load it with trivia questions from the Open Trivia Database, opentdb.com | |
| var table_name = 'trivia', | |
| extends_table = 'cmdb_ci', | |
| fields = ['question', 'answer']; | |
| createTable(table_name, extends_table, fields); | |
| fetchAndInsertTriviaData(20); |
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
| function showModal() { | |
| // get current values from description | |
| var currentOutageDetails = g_form.getValue('description'); | |
| var securityStatus = getCurrentValueSingle(currentOutageDetails, 'Potential Security Issue:'); | |
| var businessStatus = getCurrentValueSingle(currentOutageDetails, 'Business Operation Affected:'); | |
| var symptomStatus = getCurrentValueSingle(currentOutageDetails, 'Reported Symptoms:'); | |
| var descStatus = getCurrentValueMulti(currentOutageDetails, 'General Description:'); | |
| var gm = new GlideModal('Set Description'); | |
| gm.setTitle('Set Description'); |
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 background script to run a command and test MID Server connectivity to an endpoint. | |
| Just set the value to your midserver name. | |
| */ | |
| //capture start time | |
| var now = (new GlideDateTime()); | |
| var probe = SncProbe.get("Windows - Powershell"); | |
| var midServer = 'winmid06'; | |
| var psCommand = 'test-netconnection -port 443 192.168.1.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
| //for use with ServiceNow UI Action client script to create a new Incident from a CI | |
| function loadModal() { | |
| var fieldquery = ''; | |
| var fields = [ | |
| 'cmdb_ci=' + g_form.getUniqueValue(), | |
| 'caller_id=' + g_user.userID, | |
| 'contact_type=' + 'self-service', | |
| 'short_description=' + 'Incident for ' + g_form.getValue('name'), | |
| ]; | |
| fields.forEach(function(field) { |
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
| import sys | |
| if len(sys.argv) < 4: | |
| warning = """ | |
| Please provide 3 parameters in the format "instancename username password" | |
| e.g. dev1234 itiluser itiluserpassword | |
| """ | |
| print(warning) | |
| sys.exit() | |
| sninstance = "https://" + sys.argv[1] + ".service-now.com" |