Skip to content

Instantly share code, notes, and snippets.

View ycliuhw's full-sized avatar
🏠
Working from home

Kelvin ycliuhw

🏠
Working from home
  • Sydney
View GitHub Profile
@ycliuhw
ycliuhw / tmux-cheatsheet.markdown
Created April 3, 2018 07:19 — forked from MohamedAlaa/tmux-cheatsheet.markdown
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@ycliuhw
ycliuhw / iterm2-solarized.md
Created March 30, 2018 15:15 — forked from kevin-smets/iterm2-solarized.md
iTerm2 + Oh My Zsh + Solarized color scheme + Meslo powerline font + [Powerlevel9k] - (macOS)

Default

Default

Powerlevel9k

Powerlevel9k

@ycliuhw
ycliuhw / k8s-svc-annotations.md
Created February 7, 2018 06:23 — forked from mgoodness/k8s-svc-annotations.md
AWS ELB-related annotations for Kubernetes Services (v1.5)
  • service.beta.kubernetes.io/aws-load-balancer-access-log-emit-interval (in minutes)
  • service.beta.kubernetes.io/aws-load-balancer-access-log-enabled (true|false)
  • service.beta.kubernetes.io/aws-load-balancer-access-log-s3-bucket-name
  • service.beta.kubernetes.io/aws-load-balancer-access-log-s3-bucket-prefix
  • service.beta.kubernetes.io/aws-load-balancer-backend-protocol (http|https|ssl|tcp)
  • service.beta.kubernetes.io/aws-load-balancer-connection-draining-enabled (true|false)
  • service.beta.kubernetes.io/aws-load-balancer-connection-draining-timeout (in seconds)
@ycliuhw
ycliuhw / helm-rbac.md
Last active January 31, 2018 05:10 — forked from mgoodness/helm-rbac.md
Helm RBAC setup for K8s v1.6+ (tested on minikube)
# helm
kubectl -n kube-system create sa tiller
kubectl create clusterrolebinding tiller --clusterrole cluster-admin --serviceaccount=kube-system:tiller
helm init --service-account tiller


# draftd
kubectl patch -n kube-system deployment draftd -p '{"spec":{"template":{"spec":{"serviceAccount":"tiller"}}}}}'
@ycliuhw
ycliuhw / gist:af3abe825495ea8aa6ea95bd43b2fea8
Created June 21, 2017 05:02 — forked from onlyyoujack/gist:c5796f3fa6591de52d0d
Jenkins REST API Automation via curl
#Get the current configuration and save it locally
curl -X GET http://user:password@hudson.server.org/job/myjobname/config.xml -o mylocalconfig.xml
#Update the configuration via posting a local configuration file
curl -X POST http://user:password@hudson.server.org/job/myjobname/config.xml --data-binary "@mymodifiedlocalconfig.xml"
#Creating a new job via posting a local configuration file
curl -X POST "http://user:password@hudson.server.org/createItem?name=newjobname" --data-binary "@newconfig.xml" -H "Content-Type: text/xml"
@ycliuhw
ycliuhw / caselessDictionary.py
Created July 5, 2016 01:29 — forked from bloomonkey/caselessDictionary.py
A Python dictionary sub-class that is case-insensitive when searching, but also preserves the keys as inserted.
class CaselessDictionary(dict):
"""A dictionary with case-insensitive keys.
A dictionary that is case-insensitive when searching, but also preserves
the keys as inserted.
"""
def __init__(self, initval={}):
if isinstance(initval, dict):
for key, value in initval.iteritems():