Skip to content

Instantly share code, notes, and snippets.

View main.go
package main
import (
"fmt"
"sync"
"time"
)
func main() {
cc := make(chan int)
View apigee.md

Apigee

  • Proxies http
  • Logic similar to cloudflare page rules
  • all this bundles into an api product
  • api key mtls auth
  • Terraform seems to support this
  • Canary and rate limiting
  • Quotas per partner
View iam.tf
module "projects_iam_bindings_additive" {
source = "terraform-google-modules/iam/google//modules/projects_iam"
version = "~> 6.4"
mode = "additive"
projects = ["pse-jeronimo-garcia"]
bindings = {
"roles/storage.admin" = [
"user:racker-jero-cafd3766@gcp.rackspace.com"
View gist:514077937bc8596beda9e7ceed083775
import email
import getpass, imaplib
import os
import sys
imaplib._MAXLINE = 9999999
acc = sys.argv[1]
year = sys.argv[2]
path = "attachments-%s-%s" % ( acc , year)
View 15
./Makefile
.PHONY: default
default: template
template:
helm template gce-ingress/ -f gce-ingress/values.yaml
./gce-ingress/templates/backend.yaml
apiVersion: cloud.google.com/v1
kind: BackendConfig
metadata:
name: {{ .Values.backend.name }}
View nexus.sh
for i in $(curl -s https://registry.hub.docker.com/v1/repositories/sonatype/nexus3/tags | sed -e 's/[][]//g' -e 's/"//g' -e 's/ //g' | tr '}' '\n' | awk -F: '{print $3}')
do
TIMEOUT=60
echo $i ; docker run --net=host -d --rm sonatype/nexus3:${i}
until [[ $(curl -s -o /dev/null localhost:8081 -w "%{response_code}") == 200 ]]
do
echo "waiting on nexus..., sleeping 5"
sleep 5
done
View nexus.sh
for i in $(curl -s https://registry.hub.docker.com/v1/repositories/sonatype/nexus3/tags | sed -e 's/[][]//g' -e 's/"//g' -e 's/ //g' | tr '}' '\n' | awk -F: '{print $3}')
do
TIMEOUT=60
echo $i ; docker run --net=host -d --rm sonatype/nexus3:${i}
until [[ $(curl -s -o /dev/null localhost:8081 -w "%{response_code}") == 200 ]]
do
echo "waiting on nexus..., sleeping 5"
sleep 5
done
View nexus.sh
for i in $(curl -s https://registry.hub.docker.com/v1/repositories/sonatype/nexus3/tags | sed -e 's/[][]//g' -e 's/"//g' -e 's/ //g' | tr '}' '\n' | awk -F: '{print $3}')
do
echo $i ; docker run --net=host -d --rm sonatype/nexus3:${i}
until [[ $(curl -s -o /dev/null localhost:8081 -w "%{response_code}") == 200 ]]
do
echo "waiting on nexus..."
sleep 1
done
until [[ $(sudo cat /proc/$(docker inspect $(docker ps | grep -v CONT | awk '{ print $1 }') -f '{{ .State.Pid }}')/root/nexus-data/admin.password) ]]
View nexus.sh
for i in $(curl -s https://registry.hub.docker.com/v1/repositories/sonatype/nexus3/tags | sed -e 's/[][]//g' -e 's/"//g' -e 's/ //g' | tr '}' '\n' | awk -F: '{print $3}')
do
echo $i ; docker run --net=host -d --rm sonatype/nexus3:${i}
until [[ $(curl -s -o /dev/null localhost:8081 -w "%{response_code}") == 200 ]]
do
echo "waiting on nexus..."
sleep 1
done
curl -s -H"Content-Type: application/json" -u "admin:$(sudo cat /proc/$(docker inspect $(docker ps | grep -v CONT | awk '{ print $1 }') -f '{{ .State.Pid }}')/root/nexus-data/admin.password)" http://localhost:8081/service/rest/swagger.json | jq -r '.paths|keys'