Skip to content

Instantly share code, notes, and snippets.

View tylertreat's full-sized avatar

Tyler Treat tylertreat

View GitHub Profile
@tylertreat
tylertreat / prompt.json
Created November 5, 2024 23:47
Long context prompt for Gemini 1.5 used by Konfigurate
[
{
"role":"user",
"parts":[
{
"text":"Enable redis and cloud sql on this domain"
},
{
"text":"Replace the placeholders with the following values if they should be present in the output YAML unless the prompt is referring to actual YAMLs from the user's environment, in which case use the YAML as is without replacing values: {\n \"billingAccountId\": \"XXXXXX-XXXXXX-XXXXXX\",\n \"parentFolderId\": \"38822600023\",\n \"parentGroupId\": 88474985\n}."
},
@tylertreat
tylertreat / server-a.yaml
Created December 29, 2021 03:09
Liftbridge configs
port: 9292
logging.level: debug
logging.recovery: true
#logging.raft: true
#logging.nats: true
data.dir: /tmp/liftbridge/server-a
nats.embedded: true
@tylertreat
tylertreat / graph_parser.py
Created June 17, 2021 23:15
Python script for parsing GCP flow log json from BigQuery and outputting DOT format for Graphviz
import json
import os
import sys
def parse(input_file_name, output_file_name):
with open(input_file_name) as f:
data = json.load(f)
vpcs = {}
@tylertreat
tylertreat / query.txt
Created June 17, 2021 23:12
BigQuery query for GCP flow logs graph visualization
SELECT
jsonPayload.CONNECTION.src_ip,
jsonPayload.CONNECTION.dest_ip,
jsonPayload.src_instance.region AS src_region,
jsonPayload.src_instance.zone AS src_zone,
jsonPayload.src_instance.vm_name AS src_vm,
jsonPayload.dest_instance.region AS dest_region,
jsonPayload.dest_instance.zone AS dest_zone,
jsonPayload.dest_instance.vm_name AS dest_vm,
jsonPayload.src_vpc.vpc_name AS src_vpc,
@tylertreat
tylertreat / svc.yaml
Created June 19, 2020 22:07
GKE service with default BackendConfig
apiVersion: v1
kind: Service
metadata:
name: web
namespace: default
annotations:
beta.cloud.google.com/backend-config: '{"default": "config-default"}'
spec:
ports:
- port: 8080
@tylertreat
tylertreat / backend-config.yaml
Created June 19, 2020 21:57
GKE BackendConfig for enabling IAP
apiVersion: cloud.google.com/v1beta1
kind: BackendConfig
metadata:
name: config-default
namespace: default
spec:
iap:
enabled: true
oauthclientCredentials:
secretName: iap-oauth-client-id
@tylertreat
tylertreat / ingress.yaml
Created June 19, 2020 21:32
GKE ingress with static IP and managed certificate
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: basic-ingress
annotations:
kubernetes.io/ingress.global-static-ip-name: "web-static-ip"
networking.gke.io/managed-certificates: "iap-demo"
spec:
backend:
serviceName: web
@tylertreat
tylertreat / cert.yaml
Last active June 19, 2020 21:31
GKE-managed certificate
apiVersion: networking.gke.io/v1beta1
kind: ManagedCertificate
metadata:
name: iap-demo
spec:
domains:
- example.com
@tylertreat
tylertreat / ingress.yaml
Last active June 19, 2020 21:31
GKE ingress with static IP
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: basic-ingress
annotations:
kubernetes.io/ingress.global-static-ip-name: "web-static-ip"
spec:
backend:
serviceName: web
servicePort: 8080
@tylertreat
tylertreat / svc.yaml
Last active June 19, 2020 21:31
Kubernetes service
apiVersion: v1
kind: Service
metadata:
name: web
namespace: default
spec:
ports:
- port: 8080
protocol: TCP
targetPort: 8080