Skip to content

Instantly share code, notes, and snippets.

View chy168's full-sized avatar
🤠

Hung-Yen chy168

🤠
  • Taiwan
View GitHub Profile
@chy168
chy168 / NOTE
Last active June 6, 2022 01:43
zsh theme for display kube context
## Pre-install package
https://github.com/jonmosco/kube-ps1
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: testing
labels:
component: db
spec:
template:
metadata:
labels:
@chy168
chy168 / docker-compose.yml
Created December 1, 2016 11:18 — forked from cboettig/docker-compose.yml
debugging NGINX configuration for Jupyter
jupyter:
image: jupyter/datascience-notebook
environment:
- PASSWORD=${PASSWORD}
nginx:
image: nginx
links:
- jupyter
@chy168
chy168 / gist:c599a2b2f85697a942e6
Created March 5, 2016 03:24
Spark Mllib K-means example
// k-mean
import org.apache.spark.mllib.clustering.{KMeans, KMeansModel}
import org.apache.spark.mllib.linalg.Vectors
import org.apache.spark.mllib.regression.LabeledPoint
case class Data(userId: String, videoId: String, isKid: String)
val raw_data = sc.textFile("/Users/zzchen/Downloads/locked_video_up5.csv").map { line =>
val f = line.split(",")
Data(f(0),f(1).split("=")(1),f(5))
@chy168
chy168 / README
Last active December 3, 2015 13:32
Spark-redis example
./bin/spark-shell -packages redis.clients:jedis:2.7.2,com.redislabs:spark-redis:0.5.1 --repositories https://raw.github.com/RedisLabs/spark-redis/mvn-repo/
bad option: '-packages'
@chy168
chy168 / main.go
Created June 13, 2015 18:02
test see log trace depth
package main
import (
"fmt"
"io"
"net/http"
log "github.com/cihub/seelog"
)
@chy168
chy168 / main.go
Created June 13, 2015 17:54
test see log trace depth (go-json-rest)
package main
import (
"fmt"
"net/http"
"github.com/ant0ine/go-json-rest/rest"
log "github.com/cihub/seelog"
)
@chy168
chy168 / server.go
Last active August 29, 2015 14:16
Go HTTP Server Cookie Example
package main
import (
"io"
"log"
)
import "net/http"
func indexHandler(w http.ResponseWriter, req *http.Request) {
//expire := time.Now().AddDate(0, 0, 1)
#export GOPATH="$JENKINS_HOME/workspace/project"
ls -alh $WORKSPACE
export GOPATH="$WORKSPACE"
export PATH="$PATH:$GOPATH/bin"
#go get github.com/ant0ine/go-json-rest/rest
# Build Binary
go get github.com/tools/godep
#user nobody;
worker_processes 1;
#error_log logs/error.log;
#error_log logs/error.log notice;
#error_log logs/error.log info;
error_log /tmp/nginx_debug_error.log debug;
#pid logs/nginx.pid;