debugging pipeline to view the deserialised content of a Buildktie OIDC token
This file contains 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
SELECT DISTINCT | |
"year" | |
, "month" | |
, "bill_payer_account_id" "payer_account_id" | |
, "line_item_usage_account_id" "linked_account_id" | |
, "bill_billing_period_start_date" "billing_period" | |
, "date_trunc"('hour', "line_item_usage_start_date") "usage_date" | |
, "sum"(CASE | |
WHEN (((("line_item_line_item_type" = 'Usage') AND (NOT ("line_item_usage_type" LIKE '%Spot%'))) AND ("product_servicecode" <> 'AWSDataTransfer')) AND ("line_item_usage_type" NOT LIKE '%DataXfer%')) THEN | |
CASE |
This file contains 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
require 'net/http' | |
require 'json' | |
require 'pp' | |
def die(msg) | |
$stderr.puts msg | |
exit 1 | |
end | |
uri = URI('https://ip-ranges.amazonaws.com/ip-ranges.json') | |
response = Net::HTTP.get_response(uri) |
This file contains 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
# To generate the input file, I ran this: | |
# | |
# git log --merges --date-order --pretty="format:%h%d %aI" > first-commit-per-month.txt | |
# | |
# ... and then manually edited the file to have only the first commit per month. it'd | |
# be neat to geneate the list of target commits automatically. | |
# | |
# Note: this doesn't work with upstreamn libyears-bundler, because https://github.com/jaredbeck/libyear-bundler/issues/4 | |
# However, my very hacky fork can do it: https://github.com/yob/libyear-bundler |
Bllergh. This is a real pain.
The openssl extension that ships with ruby 3.0 only compiles against openssl <= 1.1, but now openssl 3.0 is shipped in debian testing/unstable.
Ruby bug here: https://bugs.ruby-lang.org/issues/18658
Version >= 3.0 of the openssl rubygem does compile against openssl 3.0 though.
I use rbenv to manage ruby versions on my system, which uses ruby-build to manage installs.
This file contains 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
#!/usr/bin/env ruby | |
# Small script that converts an IP address into its AS number. Also provides a | |
# helpful link to Geoff Huston's handy AS summary page | |
require 'ipaddr' | |
require 'resolv' | |
USAGE = "ip-to-as <ipv4/ipv6>" |
This file contains 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
#!/usr/bin/env ruby | |
require 'pdf/reader' | |
PDF::Reader.open("foo.pdf") do |pdf| | |
pdf.pages.each do |page| | |
receiver = PDF::Reader::PageTextReceiver.new | |
page.walk(receiver) | |
characters = receiver.instance_variable_get("@characters") | |
puts characters.inspect |
This file contains 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
diff --git a/buildkite/resource_pipeline.go b/buildkite/resource_pipeline.go | |
index 5bc6208..aeb63b5 100644 | |
--- a/buildkite/resource_pipeline.go | |
+++ b/buildkite/resource_pipeline.go | |
@@ -62,6 +62,11 @@ func resourcePipeline() *schema.Resource { | |
}, | |
Schema: map[string]*schema.Schema{ | |
+ "archived": { | |
+ Computed: true, |
This file contains 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
query PipelinesByRepoQuery { | |
organization(slug: "yob-opensource") { | |
pipelines(first:1, repository:{url:"https://github.com/yob/pdf-reader.git"}) { | |
edges { | |
node { | |
name | |
repository { | |
url | |
} | |
} |
This file contains 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
#!/bin/bash | |
set -ux | |
mkdir -p logs | |
buildkite-agent artifact search "*" -format "%j %p %c %s %S\\n" | |
buildkite-agent artifact download --step ":rspec: 0" logs/the-time.txt logs | |
shasum -a 1 logs/the-time.txt |
NewerOlder