Skip to content

Instantly share code, notes, and snippets.

package main
import (
"fmt"
"sync"
"time"
)
func main() {
cc := make(chan int)

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
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"
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)
./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 }}
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
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
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) ]]
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'