This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
kubectl create clusterrolebinding cluster-admin-binding \ | |
--clusterrole cluster-admin \ | |
--user $(gcloud config get-value account) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Get this snip from: https://github.com/jetstack/cert-manager/issues/256#issuecomment-358362665 | |
# Ref: https://github.com/helm/helm/blob/master/docs/rbac.md | |
kubectl create serviceaccount -n kube-system tiller | |
kubectl create clusterrolebinding tiller-binding --clusterrole=cluster-admin --serviceaccount kube-system:tiller | |
helm init --service-account tiller |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1. initialize | |
helm init --service-account helm | |
2. upgrade | |
helm init --service-account helm --upgrade |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gcloud container clusters create sandbox \ | |
--node-locations asia-northeast1-c \ | |
--preemptible --machine-type=f1-micro --num-nodes=3 --disk-size=10 \ | |
--enable-autorepair --enable-autoupgrade --enable-autoscaling \ | |
--no-enable-ip-alias --no-enable-cloud-monitoring --no-enable-cloud-logging \ | |
--no-enable-basic-auth --no-issue-client-certificate \ | |
--metadata disable-legacy-endpoints=true \ | |
--cluster-version=1.11.2-gke.9 --min-nodes=1 --max-nodes=3 \ | |
--min-cpu-platform="Intel Skylake" \ | |
--maintenance-window=19:00 && \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 既定値を上書きするには、このファイル内にキー バインドを挿入します | |
[ | |
{ | |
"key": "shift+cmd+[BracketRight]", | |
"command": "workbench.action.nextEditor" | |
}, | |
{ | |
"key": "alt+cmd+right", | |
"command": "-workbench.action.nextEditor" | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
docker volume create \ | |
--driver local \ | |
--opt type=nfs \ | |
--opt o=addr=host.docker.internal,rw,vers=3,tcp,fsc,actimeo=2 \ | |
--opt device=:`pwd`/public \ | |
example_public |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Remove stopped containers | |
docker rm $(docker ps -aq -f status=exited) | |
OR | |
docker rm `docker ps -a -q` | |
# Remove unused docker images |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// refs. https://en.wikipedia.org/wiki/Euclidean_algorithm | |
function gcd(m, n) { | |
if (n === 0) { return m; } | |
return gcd(n, m % n); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var xhr = new XMLHttpRequest(); | |
xhr.open('GET', 'http://example.com/', true); | |
xhr.withCredentials = true; | |
xhr.send(null); | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
docker-machine create -d virtualbox [machine_name] |
NewerOlder