Skip to content

Instantly share code, notes, and snippets.

View chancez's full-sized avatar

Chance Zibolski chancez

View GitHub Profile
function aws-sso-access-token() {
find "$HOME/.aws/sso/cache" -type f ! -name 'botocore*' -exec jq -r '.accessToken' {} \; | head -n1
}
function aws-sso-list-accounts() {
aws sso list-accounts --access-token "$(aws-sso-access-token)" "$@"
}
function aws-sso-list-account-roles() {
aws sso list-account-roles --access-token "$(aws-sso-access-token)" "$@"
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
helmCharts:
- name: cilium
repo: oci://quay.io/cilium-charts-dev
# renovate: datasource=docker depName=cilium registryUrl=https://quay.io/cilium-charts-dev versioning=regex:^(?<major>\d+)\.(?<minor>\d+)\.(?<patch>\d+)-dev-dev.(?<build>\d+)-(?<compatibility>.+)-(?<revision>.+)$
version: 1.16.0-dev-dev.572-main-e421c0fd6e
namespace: kube-system
releaseName: cilium
@chancez
chancez / loki-chunks.json
Created May 21, 2020 20:10
Loki dashboards that work with monolithic mode or microservices mode
{
"annotations": {
"list": [ ]
},
"editable": true,
"gnetId": null,
"graphTooltip": 0,
"hideControls": false,
"links": [ ],
"refresh": "10s",
@chancez
chancez / example.tf
Last active November 20, 2023 21:56
Support creating a DNS validated ACM certificate containing SANs for multiple different hosted zones
module "combined_acm_certificate" {
source = "../../modules/acm_certificate_dns_validated_multi_zone"
domain_name = "infra.example.com"
zone_to_san = {
"infra.example.com" = [
"*.infra.example.com",
"*.dev.infra.example.com",
"*.staging.infra.example.com",
"*.production.infra.example.com",
images:
- location: "https://cloud-images.ubuntu.com/releases/22.04/release/ubuntu-22.04-server-cloudimg-amd64.img"
arch: "x86_64"
- location: "https://cloud-images.ubuntu.com/releases/22.04/release/ubuntu-22.04-server-cloudimg-arm64.img"
arch: "aarch64"
networks:
- lima: user-v2
mounts:
@chancez
chancez / Jenkinsfile
Created December 16, 2016 22:09 — forked from amaksoft/Jenkinsfile
My example Jenkins Pipeline setup for Android app project
#!/usr/bin/groovy
/*
* Copyright (c) 2016, Andrey Makeev <amaksoft@gmail.com>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
#!/bin/bash
if [ $# -lt 1 ]; then
echo "Usage: $0 sso-instance-arn"
exit 1
fi
# set -e
# set -o pipefail
locals {
// Extracts the cidr block from a cidr, eg: the "16" from a CIDR such as "10.0.0.0/16"
cidr_block_size = split("/", var.cidr_block)[1]
// Get the total number of subnets (private subnet size + public subnet size)
// Take the logarithm base 2 to get the number of bits to accommodate all the
// subnets.
// We cannot use fractional values for cidrsubnet's newbits value, so use
// ceil() to round up. We can't round down because a smaller number bits
// would be insufficient to represent the required subnets.
apiVersion: v1
kind: ConfigMap
metadata:
name: fluentd-config
namespace: fluentd
labels:
app: fluentd
data:
fluentd.conf: |
@include prometheus.conf
#!/usr/bin/env python
import string
import sys
import hmac
import hashlib
def split_hex(value):
value = value[4:] if len(value) % 4 == 0 else "0" + value[4:]
return " ".join(value[i:i+4] for i in range(0, len(value), 4))
SECRET = bytearray.fromhex('85 44 E3 B4 7E CA 58 F9 58 30 43 F8')
D = hmac.new(SECRET, digestmod=hashlib.sha1)