Skip to content

Instantly share code, notes, and snippets.

@pascal-hofmann
pascal-hofmann / jenkins-agent-connection-details.groovy
Created November 28, 2023 08:12
Determine how jenkins agents are connected to the controller
Jenkins.instance.slaves.each {
agent ->
println("${agent.name} ${agent.computer.getSystemProperties()["sun.java.command"]}")
}
@pascal-hofmann
pascal-hofmann / gist:dd3f33650c451739d52b807eca448d49
Created December 21, 2020 09:45
Test locally built version of official provider
terraform providers mirror provider_mirror
cd provider_mirror/registry.terraform.io/grafana/grafana/
cp <custom binary> terraform-provider-grafana_v1.7.0
zip -r terraform-provider-grafana_1.7.0_darwin_amd64.zip terraform-provider-grafana_v1.7.0
sha256sum terraform-provider-grafana_1.7.0_darwin_amd64.zip
# Convert hex to base64 on https://base64.guru/converter/encode/hex
# Replace hash in <version>.json
cd -
rm .terraform.lock.hcl
terraform providers lock -fs-mirror=provider_mirror
@pascal-hofmann
pascal-hofmann / 00-configure-source-ssh.ps1
Created June 17, 2020 07:09
Simplified Packer Buildfile: Using windows-restart with session-manager-plugin leads to timeout and 100% cpu load
<powershell>
# Version and download URL
$openSSHVersion = "7.6.1.0p1-Beta"
$openSSHURL = "https://github.com/PowerShell/Win32-OpenSSH/releases/download/v$openSSHVersion/OpenSSH-Win64.zip"
Set-ExecutionPolicy Unrestricted
# GitHub became TLS 1.2 only on Feb 22, 2018
[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.SecurityProtocolType]::Tls12;