View kubectl-riffs.cheat
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 all pods in cluster and show what node they are deployed on | |
kubectl get pods -o=jsonpath='{range .items[*]}{.metadata.name}{"\t"}{.spec.nodeName}{"\n"}' --all-namespaces | |
# get all pods on a node and show what namespace they are in | |
kubectl get pods -o=jsonpath='{range .items[?(@.spec.nodeName=="<Node ID>")]}{.metadata.name}{"\t"}{.metadata.namespace}{"\n"}' --all-namespaces | |
# get all machines and show their associated node | |
kubectl get machines -o=jsonpath='{range .items[*]}{.metadata.name}{"\t"}{.status.nodeRef.name}{"\n"}' |
View oshinko-python36-spark-build-dc.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
apiVersion: v1 | |
kind: Template | |
labels: | |
application: oshinko-python-spark | |
createdBy: template-oshinko-python36-spark-build-dc | |
metadata: | |
annotations: | |
description: Create a buildconfig, imagestream and deploymentconfig using source-to-image and Python Spark source files hosted in git | |
openshift.io/display-name: Apache Spark Python | |
name: oshinko-python36-spark-build-dc |
View https.go
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
package main | |
import ( | |
"crypto/tls" | |
"golang.org/x/crypto/acme/autocert" | |
"log" | |
"net" | |
"net/http" | |
) |
View main.go
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
package main | |
import ( | |
"context" | |
"flag" | |
"fmt" | |
"log" | |
"net/http" | |
"os" | |
"os/signal" |
View gist:0d11d4170a734bf6a70053fd2c0a14b2
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
git clone https://github.com/torch/tutorials.git | |
docker run -it -p 8888:8888 -p 6006:6006 -v tutorials:/root/sharedfolder floydhub/dl-docker:cpu jupyter notebook |
View gist:0086b3f59634a2993d6e95988d6b97ed
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
[pweil@localhost codebase]$ ./restore.sh | |
+ export GOPATH=/home/pweil/codebase/rebase | |
+ GOPATH=/home/pweil/codebase/rebase | |
+ rm -rf /home/pweil/codebase/rebase | |
+ mkdir -p /home/pweil/codebase/rebase | |
+ cd /home/pweil/codebase/rebase | |
+ go get github.com/kubernetes/kubernetes | |
package github.com/kubernetes/kubernetes | |
imports github.com/kubernetes/kubernetes | |
imports github.com/kubernetes/kubernetes: no buildable Go source files in /home/pweil/codebase/rebase/src/github.com/kubernetes/kubernetes |
View mdcodestrip.py
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/env python | |
import argparse | |
import markdown | |
import os.path | |
from bs4 import BeautifulSoup | |
def read_code_from_file(mdfile): | |
"""returns a string of the code sections in the Markdown file""" | |
origfilepos = mdfile.tell() |