Skip to content

Instantly share code, notes, and snippets.

View magohl's full-sized avatar

Magnus Ohlsson magohl

View GitHub Profile
$request = @{
Uri = 'http://localhost/SuperImportant/service.svc'
Method = 'POST'
Body = '{
"name": "testing",
"prio": "24"}'
ContentType = 'application/json'
}
while (1)
@magohl
magohl / gist:a2fa5c5c141ef76d660abb9a2f4f2ad4
Created August 15, 2022 15:47
Fetch OAuth token using Managed Identity from Azure App Service
$ProgressPreference = "SilentlyContinue"
$tokenResponse = Invoke-WebRequest -UseBasicParsing -Headers @{"X-IDENTITY-HEADER"=$env:IDENTITY_HEADER} -Uri "$($env:IDENTITY_ENDPOINT)?resource=https://storage.azure.com/&api-version=2019-08-01"
$tokenResponse.RawContent
@magohl
magohl / SoapUI - Mock response script Random content.txt
Created October 21, 2022 07:28
SoapUI - Mock response script Random content
script:
def holder = new com.eviware.soapui.support.XmlHolder( mockRequest.requestContent )
def someInput = holder["//*[local-name()='SomeInput']"]
def random = Math.random()
requestContext.someInput = someInput
requestContext.randomText = random.toString()
response:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns="http://kramerica-industries.lan/webservices/dummyservice/1.0" xmlns:res="http://oresundsbron.com/types/result">
<soapenv:Header/>
#!/bin/bash
# Kubernetes Node Resource Analysis Script
# Shows CPU/Memory requests vs available per node + top 10 requesters
# Multi-user friendly version
set -e
# Parse command line arguments
CONTEXT=""