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
Function Convert-Base64 { | |
param([string]$instring) | |
# Convert string to byte array | |
$bytes = [System.Text.Encoding]::UTF8.GetBytes($instring) | |
# Convert byte array to Base64 string | |
$base64String = [System.Convert]::ToBase64String($bytes) | |
# Output the Base64 string |
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
# Sets the title of a window when running in mac terminal | |
Function Set-WindowTitle { | |
param($in) | |
write-host "`e]1;$in`a" | |
} |
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
Function Import-Environment { | |
[CmdletBinding()] | |
param( | |
$SecureNote = 'EnvironmentVariables', | |
[switch]$KeepUnlocked | |
) | |
# setup to load secrets | |
Import-Module powershell-yaml | |
dcli sync |
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
{ | |
"controls_image": "", | |
"filters": [ | |
], | |
"inputs": [ | |
{ | |
"channel": 1, | |
"events": [ | |
{ | |
"message": "hihatposition", |
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-ChildItem -Directory | ForEach-Item { | |
$folder = $_.Name | |
$LATEST_COMMIT = $(git rev-list -n 1 --no-merges HEAD) | |
$FOLDER1_COMMIT = $(git log -1 --format=format:%H --full-diff ./${folder}/) | |
Write-Output $folder | |
Write-Output "latest commit $LATEST_COMMIT" | |
Write-Output "folder commit $FOLDER1_COMMIT" |
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
azurerm_monitor_activity_log_alert.main: Creating... | |
2021/02/01 11:38:15 [DEBUG] EvalApply: ProviderMeta config value set | |
2021/02/01 11:38:15 [DEBUG] azurerm_monitor_activity_log_alert.main: applying the planned Create change | |
2021-02-01T11:38:15.851+1100 [DEBUG] plugin.terraform-provider-azurerm_v2.0.0_x5: [DEBUG] AzureRM Request: | |
2021-02-01T11:38:15.851+1100 [DEBUG] plugin.terraform-provider-azurerm_v2.0.0_x5: GET /subscriptions/b080ddce-e747-4026-98bb-fa27f98d0ab5/resourceGroups/example-resources/providers/microsoft.insights/activityLogAlerts/example-activitylogalert?api-version=2017-04-01 HTTP/1.1 | |
2021-02-01T11:38:15.851+1100 [DEBUG] plugin.terraform-provider-azurerm_v2.0.0_x5: Host: management.azure.com | |
2021-02-01T11:38:15.851+1100 [DEBUG] plugin.terraform-provider-azurerm_v2.0.0_x5: User-Agent: Go/go1.12.6 (amd64-darwin) go-autorest/v13.3.0 Azure-SDK-For-Go/v38.1.0 insights/2019-06-01 HashiCorp Terraform/0.14.5 (+https://www.terraform.io) Terraform Plugin SDK/1.6.0 terraform-provider-azurerm/2.0.0 pid-2 |
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
# http://knowyourmeme.com/memes/mocking-spongebob | |
# | |
# This snippet lives in my profile for quick access | |
Function Get-Spongebob | |
{ | |
[CmdletBinding()] | |
param | |
( |
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
# Birthday Problem aka Birthday Paradox. | |
# Calculates probability of a collision in a given range of random values | |
# uses a coarse approximation from | |
# https://en.wikipedia.org/wiki/Birthday_problem#Approximations | |
Function Get-CollisionChance | |
{ | |
param($range, $repetitions) | |
$d = [double]$range |
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
$downloadUrl = "http://download.microsoft.com/download/C/F/F/CFF3A0B8-99D4-41A2-AE1A-496C08BEB904/WebPlatformInstaller_amd64_en-US.msi" | |
$downloadtarget = ([uri]$downloadUrl).segments | select -last 1 | |
Invoke-WebRequest $downloadUrl -OutFile $env:tmp\$downloadtarget | |
Start-Process $env:tmp\$downloadtarget '/qn' -PassThru | Wait-Process | |
Set-Location ($env:ProgramFiles + "\Microsoft\Web Platform Installer") | |
.\WebpiCmd.exe /Install /Products:'UrlRewrite2,ARRv3_0' /AcceptEULA /Log:$env:tmp\WebpiCmd.log |
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
# Here's our array of files | |
$files = @( | |
"https://download.octopusdeploy.com/octopus/Octopus.3.13.9-x64.msi", | |
"https://download.octopusdeploy.com/octopus/Octopus.Tentacle.3.13.9-x64.msi", | |
"https://download.octopusdeploy.com/octopus/Octopus.3.13.10-x64.msi", | |
"https://download.octopusdeploy.com/octopus/Octopus.Tentacle.3.13.10-x64.msi" | |
# etctera | |
) | |
# loop through the array, extract the filename using uri segments, download the file |
NewerOlder