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
var grSysAtt = new GlideRecord('sys_attachment'); | |
grSysAtt.addQuery('table_name', 'my_table'); // name of table whose record have attachment | |
grSysAtt.addQuery('table_sys_id', '557d2d9f4fb416406b6500f18110c71c'); // sys_id of record having attachment | |
grSysAtt.query(); | |
while (grSysAtt.next()) { | |
var sa = new GlideSysAttachment(); | |
var attachmentContents = sa.getContent(grSysAtt); | |
gs.info(attachmentContents); | |
} |
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
<!DOCTYPE html> | |
<meta charset="utf-8"> | |
<link rel="stylesheet" href="http://cmx.io/v/0.1/cmx.css"> | |
<script src="http://cmx.io/v/0.1/cmx.js" charset="utf-8"></script> | |
<style>.cmx-user-scene4 .cmx-text-border .cmx-path {stroke: orange}</style> | |
<body> | |
<div style="max-width:900px; -webkit-transform:rotate(0deg)"> | |
<scene id="scene1"> | |
<label t="translate(0,346)"> |
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
import sys | |
import os | |
""" | |
dynamically load all the .egg files. | |
Put all your .egg files in a directory named "eggs". | |
Following code will add all of them to sys.path, | |
so that you can import from those .egg files directly. | |
""" |
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 | |
JQ=$(which jq) | |
CURL=$(which curl) | |
XPATH=$(which xpath) | |
$CURL -s https://updates.jenkins.io/current/update-center.actual.json -o update-center.actual.json | |
$JQ '.plugins[] | .scm' update-center.actual.json > plugin_repos.txt | |
input_file="plugin_repos.txt" |
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 | |
RED="\033[1;31m" | |
GREEN="\033[1;32m" | |
NOCOLOR="\033[0m" | |
YELLOW="\e[33m" | |
BLINK="\e[5m" | |
NOBLINK="\e[25m" | |
echo "Getting result from http://results.eci.gov.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
/* | |
* Checks if given node indeed of given tag. | |
* Params: | |
* tag - String, name of tag to check | |
* node - XMLNode, node in which to check for the tag | |
* Returns: | |
* true, if tag is present | |
* false, otherwise | |
*/ | |
function isNodeOfTag (node, tag) { |
To get the RESULTS field indexed in host detection input, do the followings:
- On TA Setup page, in VM Detection extra parameters, set
show_results=1
- Open
<TA DIR>bin/qualysModule/splunkpopulator/detectionpopulator.py
and find classHostDetectionPopulator
. - In this class, find
_process_root_element(self, elem)
method. - In that method, we have a list named
HostDetectionPopulator.detection_fields_to_log
. Its a list of fields to parse from detection tag. - In that list, add
"RESULTS"
at the end. As a best practice, add a comment describing why you edited this list. This will tell code to parse that XML tag as well and output it while printing the event data.
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
<?php | |
function print_api_ai_response($speech, $display_text = null, $followup_event = null, $context=null) { | |
$for_api_ai = array(); | |
$for_api_ai['speech'] = $speech; | |
if ($display_text != null) { | |
$for_api_ai['displayText'] = $display_text; | |
} else { | |
$for_api_ai['displayText'] = $speech; | |
} |
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
try: | |
import xml.etree.cElementTree as ET | |
except ImportError: | |
import xml.etree.ElementTree as ET | |
def get_plaintext(elem): | |
inner_plaintext = '' | |
text_iterator = elem.itertext() | |
for text in text_iterator: | |
inner_plaintext = inner_plaintext + text |
NewerOlder