Skip to content

Instantly share code, notes, and snippets.

Avatar
🏆
Platinum Status Level

Dr Nic Williams drnic

🏆
Platinum Status Level
View GitHub Profile
View Gemfile
gem "google-id-token"
@drnic
drnic / AlignmentWidget.vue
Last active Jul 6, 2020
Vue component for some alignment buttons. Demo at https://share.getcloudapp.com/2Nu5bL1B
View AlignmentWidget.vue
<template>
<span class="p-1 inline-flex items-center rounded-lg bg-gray-200">
<button
@click="alignmentSelected = 'left'"
:class="alignmentSelected == 'left' ? 'bg-white shadow' : 'hover:bg-gray-400'"
class="p-1 rounded-lg"
>
<svg class="h-6 w-6 text-gray-200" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 333 333">
<path
stroke="currentColor"
View aaa.md
git clone https://gist.github.com/drnic/a042bd719ed9213c5af7fd1605f8bf93 ~/workspace/pipeline.bk-run-docker-fail
cd ~/workspace/pipeline.bk-run-docker-fail

bk run pipeline.bk-run-docker-fail.yml -E AGENT_ENV=where-is-this-env

The output should include the two lines:

@drnic
drnic / Procfile
Last active Feb 9, 2020
Deploy https://jupyter.org/ Jupyter Lab to Cloud Foundry
View Procfile
web: jupyter lab --ip 0.0.0.0 --port $PORT --no-browser
View staff.json
{
"drnic": {"joined": 2012},
"bob": {"joined": 2020}
}
View README.md
$ kaf generate-secret.yaml
$ k get secret my-internal-secret -n kubecf -ojsonpath='{.data.password}' | base64 --decode
CDVIqCF7LY6dLyEGq10BrzaZfRWGDl8dxSV4vuVz8eDGga8AoP84SEc22Ben25mM

Now rotate secret:

$ kaf rotate-my-internal-secret.yaml
View all-the-pi-at-right-temp.md
stern -n kube-system -l k8s-app=pi-temperature -s 10m

example

View k3sup-gce.sh
#!/bin/bash
set -u
up() {
INSTANCE_TYPE=${INSTANCE_TYPE:-n1-standard-1}
(
set -x
gcloud compute instances create k3s-1 \
@drnic
drnic / .gitignore
Last active Nov 8, 2019
Kubernetes the Hard Way, the Easy Way
View kubecf-deployment.txt
NAME READY STATUS RESTARTS AGE
cf-operator-7db586b9c6-28pxq 1/1 Running 0 79m
kwt-net 1/1 Running 0 37m
scf-adapter-v1-0 5/5 Running 0 65m
scf-api-v1-0 17/17 Running 11 65m
scf-bits-v1-0 7/7 Running 0 65m
scf-bosh-dns-6b95f54976-7kq9z 1/1 Running 0 66m
scf-bosh-dns-6b95f54976-99qq2 1/1 Running 0 66m
scf-cc-worker-v1-0 5/5 Running 6 65m
scf-database-v1-0 5/5 Running 0 66m
You can’t perform that action at this time.