Skip to content

Instantly share code, notes, and snippets.

@jhgaylor
jhgaylor / echoserver.yaml
Created August 25, 2023 10:16
This stands up a service in kubernetes that will echo back everything sent to it via http on port 80
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: echoserver
namespace: default
spec:
replicas: 1
selector:
matchLabels:
MYSQL_PASSWORD=/mysql/root/password
MYSQL_USERNAME=/mysq/root/username
MYSQL_USERNAME=$(aws ssm get-parameter MYSQL_USERNAME) MYSQL_PASSWORD=$(aws ssm get-parameter $MYSQL_PASSWORD) bash -c 'echo $MYSQL_PASSWORD'
@jhgaylor
jhgaylor / Dockerfile
Last active November 3, 2019 22:57
Add arbitrary ssm paramters to an existing docker image as environment variables at run time
FROM binxio/ssm-get-parameter AS SSMGETPARAM
ARG IMAGENAME
FROM $IMAGENAME
ARG ORIGINAL_ENTRYPOINT
ARG ORIGINAL_CMD
# install https://github.com/binxio/ssm-get-parameter
COPY --from SSMGETPARAM /ssm-get-parameter /usr/local/bin/
I1204 04:10:08.140227 1 logs.go:19] FLAG: --alsologtostderr="false"
I1204 04:10:08.140311 1 logs.go:19] FLAG: --audit-log-batch-buffer-size="10000"
I1204 04:10:08.140318 1 logs.go:19] FLAG: --audit-log-batch-max-size="1"
I1204 04:10:08.140339 1 logs.go:19] FLAG: --audit-log-batch-max-wait="0s"
I1204 04:10:08.140537 1 logs.go:19] FLAG: --audit-log-batch-throttle-burst="0"
I1204 04:10:08.140612 1 logs.go:19] FLAG: --audit-log-batch-throttle-enable="false"
I1204 04:10:08.140627 1 logs.go:19] FLAG: --audit-log-batch-throttle-qps="0"
I1204 04:10:08.140636 1 logs.go:19] FLAG: --audit-log-format="json"
I1204 04:10:08.140702 1 logs.go:19] FLAG: --audit-log-maxage="0"
I1204 04:10:08.140714 1 logs.go:19] FLAG: --audit-log-maxbackup="0"
I1204 03:51:24.424627 1 logs.go:19] FLAG: --alsologtostderr="false"
I1204 03:51:24.424697 1 logs.go:19] FLAG: --audit-log-batch-buffer-size="10000"
I1204 03:51:24.424703 1 logs.go:19] FLAG: --audit-log-batch-max-size="1"
I1204 03:51:24.424710 1 logs.go:19] FLAG: --audit-log-batch-max-wait="0s"
I1204 03:51:24.424716 1 logs.go:19] FLAG: --audit-log-batch-throttle-burst="0"
I1204 03:51:24.424723 1 logs.go:19] FLAG: --audit-log-batch-throttle-enable="false"
I1204 03:51:24.424731 1 logs.go:19] FLAG: --audit-log-batch-throttle-qps="0"
I1204 03:51:24.424738 1 logs.go:19] FLAG: --audit-log-format="json"
I1204 03:51:24.424743 1 logs.go:19] FLAG: --audit-log-maxage="0"
I1204 03:51:24.424748 1 logs.go:19] FLAG: --audit-log-maxbackup="0"
[12/03/18 20:50] jakegaylor at Jakes-MacBook-Pro in ~/dev/cloudflinger/infrastructure/terraform on master [!]
$ kubectl create clusterrolebinding "cluster-admin-$(whoami)" \
→ --clusterrole=cluster-admin \
→ --user="$(gcloud config get-value core/account)"
clusterrolebinding.rbac.authorization.k8s.io "cluster-admin-jakegaylor" created
[12/03/18 20:50] jakegaylor at Jakes-MacBook-Pro in ~/dev/cloudflinger/infrastructure/terraform on master [!]
$ curl -fsSL https://raw.githubusercontent.com/kubedb/cli/0.9.0-rc.0/hack/deploy/kubedb.sh | bash
checking kubeconfig context
gke_cloudflinger-com-prod_us-central1_us-central1
#cloud-config
# vim: syntax=yaml
#
# The current version of cloud-init in the Hypriot rpi-64 is 0.7.9
# When dealing with cloud-init, it is SUPER important to know the version
# I have wasted many hours creating servers to find out the module I was trying to use wasn't in the cloud-init version I had
# Documentation: http://cloudinit.readthedocs.io/en/0.7.9/index.html
# Set your hostname here, the manage_etc_hosts will update the hosts file entries as well
@jhgaylor
jhgaylor / lib.go
Last active November 12, 2017 22:41
package ci
import (
"crypto/tls"
rc "github.com/concourse/fly/rc"
"github.com/concourse/go-concourse/concourse"
)
type target struct {
baseTarget rc.Target
func NewCI(
teamName string,
url string,
username string,
password string,
insecure bool,
caCert string,
) (*ConcourseCI, error) {
authTarget, _ := rc.NewBasicAuthTarget("my-target", url, teamName, insecure, username, password, caCert, false)
fmt.Printf("CI: got a basic auth target.\n")
cards_3ed = MTG::Card.where(set: '3ED').all
cards_lea = MTG::Card.where(set: 'LEA').all
all_cards = cards_3ed + cards_lea