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
#!/usr/bin/ruby | |
require 'net/http' | |
require 'json' | |
raise "Invalid arguments: dssh [container-name] [command=/bin/bash]" if ARGV.length < 1 | |
service_name = "#{ARGV[0]}" | |
ARGV[1] ||= "/bin/bash" | |
command = ARGV[1..-1].join(' ') |
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 | |
# bash generate random alphanumeric string | |
# | |
# bash generate random 32 character alphanumeric string (upper and lowercase) and | |
NEW_UUID=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1) | |
# bash generate random 32 character alphanumeric string (lowercase only) | |
cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1 |
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
canonical-kubernetes/ | |
├── addons | |
│ ├── common.sh | |
│ ├── deis | |
│ │ ├── metadata.yaml | |
│ │ └── steps | |
│ │ ├── 01_install-workflow | |
│ │ │ ├── after-deploy | |
│ │ │ └── metadata.yaml | |
│ │ └── 02_register-deis-user |
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
from django.db import connections | |
from django.db.models.query import QuerySet | |
from __future__ import print_function | |
class QuerySetExplainMixin: | |
def explain(self, analyze=True): | |
cursor = connections[self.db].cursor() | |
print(self.query) | |
print() | |
sql, params = self.query.sql_with_params() |
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
$ host a01126c228a1411e7bc240626b5106b1-559824245.us-east-1.elb.amazonaws.com | |
a01126c228a1411e7bc240626b5106b1-559824245.us-east-1.elb.amazonaws.com has address 34.226.179.81 | |
a01126c228a1411e7bc240626b5106b1-559824245.us-east-1.elb.amazonaws.com has address 52.205.228.58 | |
a01126c228a1411e7bc240626b5106b1-559824245.us-east-1.elb.amazonaws.com has address 52.44.209.181 |
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 get svc --namespace default ghosty-ghost -o json|jq -r '.status.loadBalancer.ingress[0]["hostname"]' | |
ae05a6a678a0c11e7bc240626b5106b1-1310603334.us-east-1.elb.amazonaws.com | |
$ export APP_HOST=ae05a6a678a0c11e7bc240626b5106b1-1310603334.us-east-1.elb.amazonaws.com | |
$ export APP_PORT=80 | |
$ helm upgrade ghosty --set ghostHost=$APP_HOST,ghostPort=$APP_PORT,persistence.storageClass=ebs-1,persistence.existingClaim=my-test-claim-ebs stable/ghost |
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
$ cat > sc-aws-ebs.yaml <<EOF | |
kind: StorageClass | |
apiVersion: storage.k8s.io/v1 | |
metadata: | |
name: ebs-1 | |
provisioner: kubernetes.io/aws-ebs | |
parameters: | |
type: gp2 | |
EOF | |
$ kubectl create -f sc-aws-ebs2.yaml |
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
$ cat > pvc-ebs.yaml <<EOF | |
kind: PersistentVolumeClaim | |
apiVersion: v1 | |
metadata: | |
name: my-test-claim-ebs | |
spec: | |
accessModes: | |
- ReadWriteOnce | |
resources: | |
requests: |
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
image: bitnami/ghost:0.11.10-r2 | |
volumePermissions: | |
image: | |
name: busybox | |
tag: 1.27.1 | |
## Ghost host to create application URLs | |
## ref: https://github.com/bitnami/bitnami-docker-ghost#configuration | |
## | |
# ghostHost: |
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
$ helm status ghosty | |
LAST DEPLOYED: Sat Aug 26 00:06:55 2017 | |
NAMESPACE: default | |
STATUS: DEPLOYED | |
RESOURCES: | |
==> v1/ConfigMap | |
NAME DATA AGE | |
ghosty-mariadb 1 5m |