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
# This tells kubecfg to read its config from the local directory | |
export KUBECONFIG=./kubeconfig | |
# Looking at the cluster | |
kubectl get nodes | |
kubectl get pods --namespace=kube-system | |
# Running a single pod | |
kubectl run --generator=run-pod/v1 --image=gcr.io/kuar-demo/kuard-amd64:1 kuard | |
kubectl get pods |
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
... | |
func faviconHandler(w http.ResponseWriter, r *http.Request) { | |
http.ServeFile(w, r, "relative/path/to/favicon.ico") | |
} | |
... | |
func main() { | |
http.HandleFunc("/favicon.ico", faviconHandler) | |
} |
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 ( | |
"fmt" | |
"io" | |
"net/http" | |
"os" | |
) | |
func init() { |
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 "fmt" | |
func factorial(x uint) uint { | |
if x == 0 { | |
return 1 | |
} | |
return x * factorial(x-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
//Build with: go build ./jsonpp.go | |
package main | |
import "encoding/json" | |
import "fmt" | |
import "io/ioutil" | |
import "os" | |
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/sh | |
# Change these settings to match what you are wanting to do | |
FILE=/File/To/Copy | |
SERVER=localhost | |
PATH=/Where/To/Put/File | |
OPTIONS=`vagrant ssh-config | awk -v ORS=' ' '{print "-o " $1 "=" $2}'` | |
scp ${OPTIONS} $FILE vagrant@$SERVER:$PATH |
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 ( | |
"bytes" | |
"fmt" | |
"log" | |
"os/exec" | |
"strings" | |
) |
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 ( | |
"fmt" | |
) | |
type Node struct { | |
Value int | |
} |