Skip to content

Instantly share code, notes, and snippets.

View jsloyer's full-sized avatar

Jeff Sloyer jsloyer

View GitHub Profile
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
name: clusteringresses.networking.internal.knative.dev
spec:
additionalPrinterColumns:
- JSONPath: .status.conditions[?(@.type=="Ready")].status
name: Ready
type: string
- JSONPath: .status.conditions[?(@.type=="Ready")].reason
@jsloyer
jsloyer / blue-green-deployment-cf-autopilot
Last active October 23, 2018 12:52
A/B deployments on Cloud Foundry using autopilot plugin
go get github.com/concourse/autopilot
cf install-plugin $GOPATH/bin/autopilot
cf login -a ${CF_API} -u ${CF_USERNAME} -p ${CF_PASSWORD} -o ${CF_ORG} -s ${CF_SPACE}
cf zero-downtime-push myapp -f manifest.yml
app.use(cookieParser());
var sessionStore = memoryStore;
//in future PR switch to redis or cloudant as a session store
app.use(expressSession({ secret: process.env.SECRET || "blah",
store: sessionStore,
resave: false,
saveUninitialized: false
}));
# Copyright 2015 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
#!/bin/bash
mkdir oidc-update
cd oidc-update
if [[ "$(hostname)" == "prod"* ]]; then
url=https://iam.ng.bluemix.net/kubernetes
else
url=https://iam.stage1.ng.bluemix.net/kubernetes
fi
apiVersion: v1
kind: Pod
metadata:
name: kube-addon-manager
namespace: kube-system
labels:
component: kube-addon-manager
spec:
hostNetwork: true
containers:
@jsloyer
jsloyer / client.py
Last active February 1, 2016 15:25
import RPi.GPIO as GPIO
import time
import os, json
import ibmiotf.application
import uuid
GPIO.setmode(GPIO.BCM)
GPIO.setup(18, GPIO.IN, pull_up_down=GPIO.PUD_UP)
GPIO.setup(17, GPIO.OUT)
import RPi.GPIO as GPIO
GPIO.setmode(GPIO.BCM)
GPIO.setup(18, GPIO.IN, pull_up_down=GPIO.PUD_UP)
GPIO.setup(17, GPIO.OUT)
GPIO.output(17, True)
<html>
<h1>
{{ .title }}
</h1>
</html>
func main() {
router := gin.Default()
router.LoadHTMLGlob("templates/*")
router.GET("/", func(c *gin.Context) {
c.HTML(http.StatusOK, "index.tmpl", gin.H{
"title": "Main website",
})
})