Skip to content

Instantly share code, notes, and snippets.

View imjasonh's full-sized avatar
🏠
Working from home

Jason Hall imjasonh

🏠
Working from home
View GitHub Profile
@imjasonh
imjasonh / cp.go
Created May 13, 2013 14:20
Examples for image copying and GIF exploding in Go
package main
import (
"flag"
"io"
"log"
"os"
)
var (
@imjasonh
imjasonh / airports.go
Created May 15, 2013 18:09
Go script to get the distance between two airports. I may someday make this an App Engine app w/ API, or accumulate multiple trips together. Sometimes I get curious how far I've flown so far this year.
package main
import (
"encoding/json"
"flag"
"fmt"
"log"
"math"
"net/http"
)
@imjasonh
imjasonh / flywheel.go
Created July 12, 2013 20:48
Beginnings of an App Engine app to ingest Flywheel spreadsheets and produce JSON which can be played with using D3 (see https://gist.github.com/ImJasonH/5535583)
package flywheel
import (
"archive/zip"
"encoding/json"
"fmt"
"log"
"strconv"
"time"
@imjasonh
imjasonh / links.go
Created November 20, 2013 01:56
Script to scrape links (or imgs, scripts, etc.) from a web page -- could be incorporated into a simple crawler or mass downloader
@imjasonh
imjasonh / multiarch-pipeline.yaml
Created October 21, 2021 14:29
Sketch/example pipeline to assemble a multi-arch manifest list based on arch-specific builds in a heterogeneous-arch cluster
# This Task runs a `docker build` on a specified node architecture.
# TODO:
# - mount source incl Dockerfile
# - mount a Docker daemon
apiVersion: tekton.dev/v1beta1
kind: Task
metadata:
name: build
spec:
@imjasonh
imjasonh / 1 - sign multiple times
Last active October 28, 2021 05:25
demo signing images multiple times with cosign
# Generate a keypair
$ cosign generate-key-pair
Enter password for private key:
Enter again:
Private key written to cosign.key
Public key written to cosign.pub
# Use it to sign an image
$ cosign sign -key=cosign.key gcr.io/imjasonh/ubuntu
Enter password for private key:
$ go run ./ deps $IMAGE --spdx
SPDXVersion: SPDX-2.2
DataLicense: CC0-1.0
SPDXID: SPDXRef-DOCUMENT
DocumentName: github.com/google/ko
DocumentNamespace: http://spdx.org/spdxpackages/github.com/google/ko-999a6226-9c5c-4f6d-a09f-2bb7dde5dab3
Creator: Tool: ko (devel)
Created: 2021-09-28T16:00:41Z
// +build e2e,windows_e2e
/*
Copyright 2021 The Tekton Authors
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
@imjasonh
imjasonh / main.go
Last active October 28, 2021 05:26
package main
import (
"encoding/json"
"fmt"
"log"
"os"
"github.com/google/go-containerregistry/pkg/authn"
"github.com/google/go-containerregistry/pkg/name"