Skip to content

Instantly share code, notes, and snippets.

View motowilliams's full-sized avatar

Eric Williams motowilliams

View GitHub Profile
@motowilliams
motowilliams / gist:ab6687513df7d1e872ddecb852b6274a
Created March 9, 2022 01:20
Dump Docker Layers Hashes to File
docker image inspect IMAGE_NAME | jq .[0].RootFS.Layers | awk '{print " # "$$0}' | tee -a IMAGE_NAME.txt
# this is a comment
# Colin's mom was here!
# this is another comment
git commit --allow-empty -m 'My special commit ' -m ' _____ ' -m ' | || ' -m ' |\___/| ' -m ' | | ' -m ' | | ' -m ' | | ' -m ' | | ' -m ' | | ' -m ' | | ' -m ' ____||____|____ ' -m ' / | | \ ' -m ' / | | | \ ' -m '| | | | | ' -m '| | | | | ' -m '| | | ' -m '| | | ' -m '| / ' -m '| / ' -m ' \ / ' -m ' \ / ' -m ' | | ' -m ' | | '
[CmdletBinding()]
param (
[string]$DirectoryPath,
[switch]$KeepDownload
)
process {
if ($DirectoryPath) {
Write-Verbose "User requested download location $DirectoryPath"
@motowilliams
motowilliams / uniqueString.tf
Created April 3, 2018 17:23
Start of replicating the ARM uniqueString function
resource "null_resource" "naming" {
triggers {
nameSuffix = "${var.environment}${substr(sha256(format(var.resourceGroupName,var.location,var.subscription_id)),0,13)}"
}
}
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
(New-Object System.Net.WebClient).DownloadFile("http://aka.ms/downloadazcopy", "azcopy.msi")
Start-Process "msiexec.exe" -argumentlist $("/i", "azcopy.msi", "/qn", "/norestart") -Wait -NoNewWindow
$azcopy="c:\program files (x86)\microsoft sdks\azure\azcopy\azcopy.exe"
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
(New-Object System.Net.WebClient).DownloadFile("https://octopus.com/downloads/latest/WindowsX64/OctopusServer", "Octopus.Server.msi")
Start-Process "msiexec.exe" -argumentlist $("/i", "Octopus.Server.msi", "/qn", "/norestart") -Wait -NoNewWindow
function Compress-String {
[CmdletBinding()]
param (
[parameter(ValueFromPipeline)][string]$StringContent
)
process {
$ms = New-Object System.IO.MemoryStream
$cs = New-Object System.IO.Compression.GZipStream($ms, [System.IO.Compression.CompressionMode]::Compress)
[CmdletBinding()]
param(
[string][Parameter(
Mandatory = $true,
ValueFromPipeline = $true
)]$uri,
$TimeoutSec = 5
)
process {
@motowilliams
motowilliams / error.md
Last active November 9, 2017 09:43
Xamarin.Android Build Failures
  • No build definition changes and the solution builds locally.
  • Build fails on master branch where changes haven't been landed for a few days.
2017-10-31T21:58:47.2398136Z ##[error]Unable to process command '##vso[telemetry.publish area=Tasks.CrossPlatform;feature=XamarinAndroid]{ "jdkVersion": default }' successfully. Please reference documentation (http://go.microsoft.com/fwlink/?LinkId=817296)
2017-10-31T21:58:47.2408444Z ##[error]Unable to parse telemetry data { "jdkVersion": default }. Error: Unexpected character encountered while parsing value: d. Path 'jdkVersion', line 1, position 16.
2017-10-31T21:58:47.2408444Z ##[debug]System.ArgumentException: Unable to parse telemetry data { "jdkVersion": default }. Error: Unexpected character encountered while parsing value: d. Path 'jdkVersion', line 1, position 16.
   at Microsoft.VisualStudio.Services.Agent.Worker.Telemetry.TelemetryCommandExtension.ProcessPublishTelemetryCommand(IExecutionContext context, Dictionary`2 eventProperties, String data)