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
# Stolen from http://ctrlf5.net/?p=263 and http://www.dailycoding.com/posts/convert_image_to_base64_string_and_base64_string_to_image.aspx | |
function ConvertFrom-StringToMemoryStream{ | |
param( | |
[parameter(Mandatory)] | |
[string]$InputString | |
) | |
$stream = New-Object System.IO.MemoryStream; | |
$writer = New-Object System.IO.StreamWriter($stream); | |
$writer.Write($InputString); |
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
<powershell> | |
Enable-PSRemoting -force | |
Set-Item WSMan:\localhost\MaxTimeoutms 1800000 | |
Set-Item WSMan:\localhost\Service\AllowRemoteAccess $true | |
Set-Item WSMan:\localhost\Service\Auth\Basic $true | |
Set-item WSMan:\localhost\Service\AllowUnencrypted $true | |
$computername = $env:computername # place computername here for remote access | |
$username = 'AdminAccount1' | |
$password = 'topSecret@99' |
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
# 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 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 urllib | |
import urllib2 | |
import json | |
def lambda_handler(event, context): | |
url = 'https://rightgif.com/search/web' | |
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
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"> |
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
# 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 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
$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 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
$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 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 os | |
import json | |
import urllib | |
import urllib2 | |
from datetime import datetime | |
from datetime import timedelta | |
import json | |
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
<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> |