Skip to content

Instantly share code, notes, and snippets.

View ZhiqinYang's full-sized avatar
💭
I may be slow to respond.

ZhiqinYang

💭
I may be slow to respond.
View GitHub Profile
@ZhiqinYang
ZhiqinYang / nginx-ingress-lb.yaml
Created November 6, 2017 07:21 — forked from tillkuhn/ nginx-ingress-lb.yaml
Kubernetes configuration file to create and expose Nginx Ingress Controller Service with sticky sessions, virtual host stats and default backend
---
################################################################################
## K8S Default Backend for Nginx if no endpoint is available e.g. 404 servers
###############################################################################
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: nginx-default-backend
namespace: kube-system
labels:
@ZhiqinYang
ZhiqinYang / elasticsearch.yml
Created October 21, 2017 18:30 — forked from reyjrar/elasticsearch.yml
ElasticSearch config for a write-heavy cluster
##################################################################
# /etc/elasticsearch/elasticsearch.yml
#
# Base configuration for a write heavy cluster
#
# Cluster / Node Basics
cluster.name: logng
# Node can have abritrary attributes we can use for routing
@ZhiqinYang
ZhiqinYang / ssl_smtp_example.go
Created August 29, 2017 07:05 — forked from chrisgillis/ssl_smtp_example.go
Golang SSL SMTP Example
package main
import (
"fmt"
"log"
"net"
"net/mail"
"net/smtp"
"crypto/tls"
)
@ZhiqinYang
ZhiqinYang / golang-tls.md
Created May 19, 2017 06:56 — forked from denji/golang-tls.md
Simple Golang HTTPS/TLS Examples
Generate private key (.key)
# Key considerations for algorithm "RSA" ≥ 2048-bit
openssl genrsa -out server.key 2048

# Key considerations for algorithm "ECDSA" ≥ secp384r1
# List ECDSA the supported curves (openssl ecparam -list_curves)
@ZhiqinYang
ZhiqinYang / clean-docker-for-mac.sh
Created May 19, 2017 06:41 — forked from MrTrustor/clean-docker-for-mac.sh
This script cleans the Docker.qcow2 file that takes a lot of disk space with Docker For Mac. You can specify some Docker images that you would like to keep.
#!/bin/bash
# Copyright 2017 Théo Chamley
# Permission is hereby granted, free of charge, to any person obtaining a copy of
# this software and associated documentation files (the "Software"), to deal in the Software
# without restriction, including without limitation the rights to use, copy, modify, merge,
# publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
# to whom the Software is furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all copies or