Skip to content

Instantly share code, notes, and snippets.

View hangyan's full-sized avatar
🌴
On vacation

Hang Yan hangyan

🌴
On vacation
View GitHub Profile
@hangyan
hangyan / main.go
Created May 17, 2019 07:24 — forked from ncdc/main.go
Simple Kubernetes client-go example code
package main
import (
"flag"
"fmt"
"os"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/client-go/kubernetes"
"k8s.io/client-go/rest"
"k8s.io/client-go/tools/clientcmd"
@hangyan
hangyan / multiple-host-reverse-proxy.go
Created May 17, 2019 06:21 — forked from ego008/multiple-host-reverse-proxy.go
Multiple host reverse proxy in Go
package main
import (
"log"
"net/http"
"net/http/httputil"
"net/url"
)
var (
@hangyan
hangyan / context.go
Created April 10, 2019 03:31 — forked from iamralch/context.go
An example that illustrates how to work with https://godoc.org/golang.org/x/net/context
package main
import (
"bufio"
"fmt"
"os"
"strings"
"time"
"golang.org/x/net/context"
@hangyan
hangyan / git-tag-delete-local-and-remote.sh
Created February 12, 2019 06:51 — forked from mobilemind/git-tag-delete-local-and-remote.sh
how to delete a git tag locally and remote
# delete local tag '12345'
git tag -d 12345
# delete remote tag '12345' (eg, GitHub version too)
git push origin :refs/tags/12345
# alternative approach
git push --delete origin tagName
git tag -d tagName
kubectl config set-cluster default-cluster --server=https://master_ip --certificate-authority=ssl/ca.pem
kubectl config set-credentials default-admin --certificate-authority=ssl/ca.pem --client-key=ssl/admin-key.pem --client-certificate=ssl/admin.pem
kubectl config set-context default-system --cluster=default-cluster --user=default-admin
kubectl config use-context default-system
# obviously you need the CA used to bootstrap your cluster and all the certificates
@hangyan
hangyan / simpleprocess.cpp
Last active September 9, 2015 09:46 — forked from massenz/simpleprocess.cpp
libprocess simple HTTP server
/*
* simpleprocess.cpp
*
* Created on: Jun 26, 2015
* Author: Marco Massenzio
*/
#include <iostream>
#include <process/dispatch.hpp>