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
$tests = Get-Content "%teamcity.build.checkoutDir%\TeamCity-Build-Agents.tests.ps1" | Out-String | |
$scriptblock = { | |
param($script) | |
$scriptFile = "$env:temp\TeamCity-Build-Agents.tests.ps1" | |
Set-Content $scriptFile -Value $script | |
Invoke-Pester -Script $scriptFile -PassThru 6> $null 2> $null | |
} | |
$BuildAgents = @( | |
'tc-buildagent-01', |
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
index=_internal source=*license_usage.log type="Usage" splunk_server=* | timechart span=1d eval(round(sum(b)/1024/1024/1024,5)) as GB | sort _time |
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
if(!$credential){ | |
$credential = Get-Credential | |
} | |
$baseurl = 'http://zabbix.global.root' | |
$params = @{ | |
body = @{ | |
"jsonrpc"= "2.0" | |
"method"= "user.login" | |
"params"= @{ | |
"user"= $credential.UserName |
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
# Show requests from IE on XP | |
index=* AND cs_User_Agent=*| eval windows_xp_and_ie=if(match(cs_User_Agent,".*MSIE.*5.1.*"),"TRUE","FALSE") | stats count by windows_xp_and_ie |
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
<dashboard> | |
<label>Operational Dashboard</label> | |
<row> | |
<panel> | |
<chart> | |
<title>Total callouts last 30 days</title> | |
<search> | |
<query>index="pagerduty" AND ("channel.notification.type" = *_push_notification OR "channel.notification.type" = SMS OR "channel.notification.type" = Phone) | | |
timechart count by "user.summary"</query> | |
<earliest>-30d@d</earliest> |
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 os | |
import json | |
import urllib | |
import urllib2 | |
from datetime import datetime | |
from datetime import timedelta | |
import 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
$hashResult = @{} | |
if(!$TubeStationsRAW){ | |
$TubeStationsRAW =@() | |
$page = 0 | |
while(1){ | |
$page += 1; | |
Write-Verbose "Looking at page $page" | |
$result = $(invoke-webrequest "https://api.tfl.gov.uk/StopPoint/Mode/tube,overground,national-rail?page=$page").content | ConvertFrom-Json | |
if(!$result){ | |
return |
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
$VerbosePreference = "Continue" | |
if(!$cred){ | |
$cred = Get-Credential | |
} | |
$IntegrationID = 707 | |
if($(Read-Host "Warning, this will replace all checks' integrations with ONLY integration ID $integrationID, do you wish to continue? y/n") -ne 'y'){ | |
return; | |
} | |
$params = @{ | |
uri = "https://api.pingdom.com/api/2.0/checks" |
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 input and output params (as named in our function.json) | |
$result = $Env:res | |
$requestPath = $env:req | |
$executionPath = Split-Path -parent $PSCommandPath | |
$tempPath = Split-Path -parent $env:req | |
# Read the input from file and parse it to an object | |
[Console]::WriteLine("Reading input from $env:req") | |
$requestObj = Get-Content $requestPath | Out-String | ConvertFrom-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
Add-Type -AssemblyName PresentationFramework | |
[xml]$XAMLWindow = ' | |
<Window | |
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | |
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | |
Height="Auto" | |
SizeToContent="WidthAndHeight" | |
Title="Get-Service"> | |
<ScrollViewer Padding="20"> |