Skip to content

Instantly share code, notes, and snippets.

@jdolitsky
jdolitsky / hello-melange-apko-1.txt
Last active July 21, 2022 04:51
Secure Your Software Factory with melange and apko
git clone https://github.com/chainguard-dev/hello-melange-apko.git
cd hello-melange-apko/go/
@jdolitsky
jdolitsky / RERUN_FAILED_GITHUB_ACTIONS.md
Last active July 13, 2022 02:30
Re-running failed GitHub Actions jobs

In JavaScript console, get a list of all failed GitHub Action run URLs:

x=document.getElementsByClassName("merge-status-item");for (i=0;i<x.length;i++) { y=x[i].querySelector(".merge-status-icon");if (y && y.querySelector(".color-fg-danger")){console.log(x[i].querySelector(".status-actions").href)}}

Then on each individual run page, to re-run all failed jobs:

document.getElementsByClassName("rerun-dialog")[0].querySelector("summary").click();setTimeout(function(){z=document.getElementsByClassName("overflow-auto")[0].querySelectorAll('button');z[z.length-1].click()}, 500);
@jdolitsky
jdolitsky / PROPOSAL_F.md
Last active April 12, 2022 18:14
OCI Reference Types WG Proposal F (by anonymous)

Proposal F

Allow for query of registry schemas.

Description

As the number of different kinds of references increases, it becomes more important to be able to intelligently query. This proposal is based off of Proposal B but could generally be applied to any json structure.

@jdolitsky
jdolitsky / FREEDOM.sh
Created March 4, 2022 15:32
Mirror a list of images to GHCR with crane (and sign them with cosign!)
#!/usr/bin/env bash
set -o errexit
set -o nounset
set -o pipefail
if ! crane version >/dev/null; then echo "Must install crane."; exit 1; fi
if ! cosign version >/dev/null; then echo "Must install cosign."; exit 1; fi
GHCR_ROOT_NAMESPACE="${GHCR_ROOT_NAMESPACE:-}"
@jdolitsky
jdolitsky / 1-mimic-mac-kbct.yaml
Last active June 15, 2022 08:42
Custom Linux KBCT Keymap for mimicking macOS
# Place this file at: /etc/kbct/config.yml
#
# Custom Linux Keymap for mimicking macOS
# - Swap leftmeta for leftctrl
# - Swap rightctrl for leftmeta
# - leftmeta+c mapped to copy
#
- keyboards: [ 'My USB Keyboard', 'My BuiltIn Keyboard' ]
keymap:
@jdolitsky
jdolitsky / helm_oci_chart_overwrite.sh
Created August 30, 2021 21:00
Republish an old OCI-based chart using Helm 3.7+
# Temporarily install older version of Helm (3.6.3), enable OCI support
mkdir -p tmp/
curl https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3 | \
DESIRED_VERSION="v3.6.3" USE_SUDO="false" HELM_INSTALL_DIR="${PWD}/tmp" bash
mv tmp/helm tmp/helm36
export PATH="${PWD}/tmp:${PATH}"
export HELM_EXPERIMENTAL_OCI=1
# Configure settings for old OCI chart
OCI_ROOT="bundle.bar/u/jdolitsky/demo/bitnami"
@jdolitsky
jdolitsky / zot-oci-conformance.sh
Created March 31, 2021 19:01
zot-oci-conformance.sh
#!/usr/bin/env bash
set -e
#
# zot-oci-conformance.sh
#
# Run OCI Distirbution Spec conformance tests (v1.0.0-rc2)
# against Zot registry server: https://github.com/anuvu/zot
#
@jdolitsky
jdolitsky / new_private_list_with_all_followed_users.go
Created February 12, 2020 20:56
Script to add everyone you follow on Twitter to a new private list
/*
new_private_list_with_all_followed_users.go
Script to add everyone you follow on Twitter to a new private list
Usage (requires Go 1.13+):
// Name of the Twitter list (should not exist yet, will be created)
export TW_LIST_NAME="<new_list_name>"
@jdolitsky
jdolitsky / octant-plugin-dev.sh
Last active November 16, 2019 23:31
Script to help with Octant plugin development. Watches .go files, rebuilds plugin, and automatically restarts Octant server. Requires fswatch.
#!/usr/bin/env bash
set -euo pipefail
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
cd "${DIR}"
REQUIRED_SYSTEM_COMMANDS=(
"go"
"octant"
"fswatch"
@jdolitsky
jdolitsky / helm3_redis_install.sh
Last active May 21, 2019 08:19
Installing Redis with Helm 3 (Note: this will also bootstrap Helm 3 on Mac)
#!/bin/bash -ex
#
# Magic Helm 3.0.0-alpha1 macOS install script here:
# https://gist.github.com/jdolitsky/0ec804b09f24a24b05acb681f01903c9
# --->
GIST_ID="${GIST_SLUG:-jdolitsky/0ec804b09f24a24b05acb681f01903c9}"
GIST_FILE="${GIST_FILE:-install_helm3alpha1_mac.sh}"
GIST_URL="https://gist.githubusercontent.com/${GIST_ID}/raw/${GIST_FILE}"