Skip to content

Instantly share code, notes, and snippets.

View mrsimonemms's full-sized avatar
🐝
Tinkerin'

Simon Emms mrsimonemms

🐝
Tinkerin'
View GitHub Profile
@mrsimonemms
mrsimonemms / script.sh
Created July 2, 2024 14:10
Extract Kubernetes TLS secrets to YAML
#!/bin/bash
# Extract secrets from all namespaces
kubectl get secrets -A --field-selector=type=kubernetes.io/tls -o json | jq -r '.items[]' | yq -p=json
# Extract secrets from a single namespace
kubectl get secrets -n default --field-selector=type=kubernetes.io/tls -o json | jq -r '.items[]' | yq -p=json
@mrsimonemms
mrsimonemms / is.go
Created December 25, 2022 17:18
Golang Is function
package main
import (
"fmt"
"go/types"
)
func Is[T types.Type](v types.Type) bool {
_, ok := v.(T)
return ok
@mrsimonemms
mrsimonemms / instructions.md
Last active February 19, 2023 11:29
Simon Emms public GPG keys

2. Download and import the desired public key

gpg --import simonemms-public-key.asc

3. List the keys available

gpg --list-key
@mrsimonemms
mrsimonemms / gitpod-installer.sh
Last active January 29, 2022 16:52
Use Gitpod installer from Docker
#!/bin/bash
# Save this script to a `gitpod-installer` file, make it
# executable and save to your $PATH directory. Now you can
# use this as you would the normal Installer binary.
#
# To change the Installer version, apply a `GITPOD_INSTALLER_VERSION`
# environment variable (or change the default value).
set -euo pipefail
@mrsimonemms
mrsimonemms / ingress.yaml
Created December 17, 2021 08:24
Gitpod installer ingress example
# Replace $DOMAIN with your own domain
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: gitpod
annotations:
kubernetes.io/ingress.class: nginx
nginx.ingress.kubernetes.io/ssl-passthrough: "true"
spec:
@mrsimonemms
mrsimonemms / gateway.config.yml
Created June 3, 2021 21:01
Express Gateway Example
http:
port: 9999
admin:
port: 9876
host: 0.0.0.0
apiEndpoints:
# see: http://www.express-gateway.io/docs/configuration/gateway.config.yml/apiEndpoints
api:
paths:
- /api/v1/apiary
@mrsimonemms
mrsimonemms / node.js
Created January 19, 2021 15:40
Getting OpenFaaS secrets
const { promises: fs } = require('fs');
/**
* Get Secret
*
* Get a secret
*
* @link https://docs.openfaas.com/reference/secrets/#use-the-secret-in-your-function
* @param {string} secretName
* @returns {Promise<string>}
2020/07/29 09:34:44 [DEBUG] azurerm_data_factory_dataset_delimited_text.example apply errored, but we're indicating that via the Error pointer rather than returning it: One of `http_server_location`, `blob_storage_location` must be specified to create a DataFactory Delimited Text Dataset
2020/07/29 09:34:44 [ERROR] <root>: eval: *terraform.EvalApplyPost, err: One of `http_server_location`, `blob_storage_location` must be specified to create a DataFactory Delimited Text Dataset
2020/07/29 09:34:44 [ERROR] <root>: eval: *terraform.EvalSequence, err: One of `http_server_location`, `blob_storage_location` must be specified to create a DataFactory Delimited Text Dataset
@mrsimonemms
mrsimonemms / Makefile
Created July 3, 2020 21:38
OpenApiary Makefile
CONTAINER_NAME ?= open-apiary
TAG ?= develop
IMAGE = registry.gitlab.com/mrsimonemms/open-apiary:${TAG}
destroy:
docker stop ${CONTAINER_NAME} || true
docker rm ${CONTAINER_NAME} || true
.PHONY: destroy
deploy:

Keybase proof

I hereby claim:

  • I am mrsimonemms on github.
  • I am mrsimonemms (https://keybase.io/mrsimonemms) on keybase.
  • I have a public key ASDWmVzBQL-wc2XXO0HEwvP2uCHQ2S-kfRgc_irSpRpsawo

To claim this, I am signing this object: