Turns Ansible log outputs into plain JSON strings and sends them to an Elasticsearch cluster.
Place the script in your playbook's plugins/callbacks/ directory.
Use this as an example on how to start the virtual console without the need of Java Web Start or accessing it from the web interface. | |
You can use the user and password that you use for the web interface. | |
You need an old JRE... I used 1.7.0_80 from the Server JRE package, also I have tested successfully 1.7.0_79 with MacOS. | |
You don't need to install it, just extract it or copy the files in "jre" folder. | |
Open the viewer.jnlp file that you get by launching the virtual console from the web interface with a text editor. | |
Note the urls to the jar files. Download the main jar file avctKVM.jar and the libs for your operating system and architecture. | |
Extract the dlls (.so Linux, .jnilib MacOS) from the jar libs. |
$CSVFileName = "transaction_activity.csv" | |
$EZPT = Import-CSV $CSVFileName | |
$OFXString = 'OFXHEADER:100'+ "`n" + | |
'DATA:OFXSGML'+ "`n" + | |
'VERSION:102'+ "`n" + | |
'SECURITY:NONE'+ "`n" + | |
'ENCODING:USASCII'+ "`n" + | |
'CHARSET:1252'+ "`n" + |
$lines = Get-content ./t.txt #text file containing "single grid cells" as lines | |
$offset = 11 # desired number of columns in grid | |
$Header = @() | |
$tempObject = New-Object -TypeName PSObject | |
$objects = @() | |
For($i=0;$i -lt $lines.length;$i+=1) { | |
Write-host "Processing line $i of $($lines.length) in chunks of $offset" | |
if ($i -eq $offset) { | |
Write-host "Found Header $($header -join ',')" | |
} |
function Compare-XmlDocs($actual, $expected) { | |
if ($actual.Name -ne $expected.Name) { | |
throw "Actual name not same as expected: actual=" + $actual.Name | |
} | |
##attributes... | |
if ($actual.Attributes.Count -ne $expected.Attributes.Count) { | |
throw "attribute mismatch for actual=" + $actual.Name | |
} | |
for ($i=0;$i -lt $expected.Attributes.Count; $i =$i+1) { |
var webdriver = require('selenium-webdriver'), | |
By = webdriver.By, | |
until = webdriver.until; | |
var driver = new webdriver.Builder() | |
.forBrowser('chrome') | |
.build(); | |
driver.get('http://www.webdriverjs.com/'); | |
driver.findElement(By.css('.search-field.form-control')).sendKeys("WebdriverJs"); | |
driver.findElement(By.css('button.search-submit i')).click(); | |
driver.wait(until.elementTextIs(driver.findElement(By.css('.vl-main-header>h1')), "Search Results for: WebdriverJs"), 10000); |
$ErrorActionPreference = "Stop" | |
Function Test-IISLogFile{ | |
Param( | |
$FilePath | |
) | |
return $($FilePath -Like "*.com\Logs\*") -or $($FilePath -Like "*.com\Log\*") | |
} | |
Function Clean-FileBeatRegistry { | |
Param( | |
$RegistryFile |
'On Error Resume Next | |
do | |
Set objHTTP = CreateObject("MSXML2.ServerXMLHTTP") | |
objHTTP.SetOption 2, objHTTP.GetOption(2) - SXH_SERVER_CERT_IGNORE_ALL_SERVER_ERRORS | |
objHTTP.Open "POST", "https://webserviceurl/shouldlock", False | |
objHTTP.setRequestHeader "User-Agent", "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)" | |
objHTTP.send "" |
Function Get-LastLogLines { | |
Param( | |
$FileName, | |
$Lines = 30 | |
) | |
# Method borrowed and adapted from: https://stackoverflow.com/questions/36507343/get-last-n-lines-or-bytes-of-a-huge-file-in-windows-like-unixs-tail-avoid-ti | |
$result = "" | |
$seq = "`r`n" | |
$buffer_size = 10mb | |
$buffer = new-object Byte[] $buffer_size |
/* Add Recurring event, with a secondary calendar on the Third Tuesday of the Month */ | |
DELIMITER $$ | |
DROP PROCEDURE IF EXISTS create_events$$ | |
CREATE PROCEDURE create_events() | |
BEGIN | |
DECLARE event_date DATETIME; | |
DECLARE event_end DATETIME; | |
DECLARE ocurrences INT; | |
DECLARE last_inserted INT; | |
DECLARE week_of_month DOUBLE; |