Skip to content

Instantly share code, notes, and snippets.

View tuan78's full-sized avatar

Tuan Tran tuan78

View GitHub Profile
@tuan78
tuan78 / README.md
Last active July 20, 2021 02:10 — forked from tmilos/README.md
Modified Preorder Tree Traversal

Modified Preorder Tree Traversal

Hierarchical data metrics that allows fast read operations on tree like structures.

Based on Left and Right fields that are set during tree traversal. When entered into node value is set to it's Left, when exiting node value is set to it's Right.

Sample implementation

@tuan78
tuan78 / nginx.conf
Created October 26, 2019 10:30 — forked from plentz/nginx.conf
Best nginx configuration for improved security(and performance). Complete blog post here http://tautt.com/best-nginx-configuration-for-security/
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048
apiVersion: v1
kind: Pod
metadata:
name: backend-pod-name # POD_NAME
labels:
application: backend # LABEL_KEY: LABEL_VALUE
spec:
containers: # list of containers running in one Pod
- name: main-container # CONTAINER_NAME
image: my-backend # IMAGE_NAME
apiVersion: v1
kind: Service
metadata:
name: backend-service-name # SERVICE_NAME
labels:
# we pass selector, to list specific Services:
# kubectl get svc --selector=KEY_SERVICE_SELECTOR
application: backend # KEY_SERVICE_SELECTOR: VALUE_SERVICE_SELECTOR
spec:
type: ClusterIP # options: ClusterIP, NodePort, LoadBalancer, ExternalName
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: backend-ingress-name # INGRESS_NAME
labels:
# we pass selector, to easy list specific Ingresses:
# kubectl get ing --selector=KEY_INGRESS_SELECTOR
application: backend # KEY_INGRESS_SELECTOR: VALUE_INGRESS_SELECTOR
annotations:
# you can apply additional annotations here, to enable cors for example
apiVersion: apps/v1
kind: Deployment
metadata:
name: backend-deployment-name # DEPLOYMENT_NAME
labels:
# we pass selector, to easy list specific Deployments:
# kubectl get deployment --selector=KEY_DEPLOYMENT_SELECTOR
application: backend # KEY_DEPLOYMENT_SELECTOR: VALUE_DEPLOYMENT_SELECTOR
resource: deployment
spec: