Skip to content

Instantly share code, notes, and snippets.

View congnt24's full-sized avatar
💭
exploring

Cong Nguyen congnt24

💭
exploring
  • Hanoi
View GitHub Profile
@congnt24
congnt24 / kong_postgres.yaml
Created August 19, 2018 08:04
Install Kong with type ClusterIP
apiVersion: v1
kind: Service
metadata:
name: kong-proxy
spec:
ports:
- name: kong-proxy
port: 8000
targetPort: 8000
protocol: TCP
@congnt24
congnt24 / konga.yaml
Created August 19, 2018 08:02
Install Konga on Kubernetes cluster
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: konga
spec:
replicas: 1
template:
metadata:
labels:
name: konga
@congnt24
congnt24 / rancher-cli
Created August 13, 2018 02:47
dockerfile for install rancher cli
# Set base image.
FROM alpine:latest
MAINTAINER Dominik Hahn <[email protected]>
# Define rancher version
ENV RANCHER_CLI_VERSION=v0.6.9
# Install dependencies and rancher
RUN apk add --quiet --no-cache ca-certificates && \
git clone https://github.com/vfarcic/k8s-specs.git
cd k8s-specs
git pull
open "https://console.aws.amazon.com/iam/home#/security_credential"
export AWS_ACCESS_KEY_ID=[...]
@congnt24
congnt24 / app.js
Created May 21, 2018 14:53 — forked from acdlite/app.js
Quick and dirty code splitting with React Router v4
// getComponent is a function that returns a promise for a component
// It will not be called until the first mount
function asyncComponent(getComponent) {
return class AsyncComponent extends React.Component {
static Component = null;
state = { Component: AsyncComponent.Component };
componentWillMount() {
if (!this.state.Component) {
getComponent().then(Component => {
@congnt24
congnt24 / Config-Coreos-Cluster.md
Created February 23, 2018 04:40 — forked from DenisIzmaylov/NOTES.md
Step By Step Guide to Configure a CoreOS Cluster From Scratch

Step By Step Guide to Configure a CoreOS Cluster From Scratch

This guide describes how to bootstrap new Production Core OS Cluster as High Availability Service in a 15 minutes with using etcd2, Fleet, Flannel, Confd, Nginx Balancer and Docker.

Content

#cloud-config
hostname: CongntCoreOS
users:
- name: congnt24
passwd: $1$AgMKJAA5$/18oT4P7kOS3tp9YeElSV0
groups:
- sudo
- docker
@congnt24
congnt24 / gist:2bb4e861154f26659421fb8abee8e96c
Created December 6, 2017 08:30 — forked from mtigas/gist:952344
Mini tutorial for configuring client-side SSL certificates.

Client-side SSL

For excessively paranoid client authentication.

Using self-signed certificate.

Create a Certificate Authority root (which represents this server)

Organization & Common Name: Some human identifier for this server CA.

openssl genrsa -des3 -out ca.key 4096
openssl req -new -x509 -days 365 -key ca.key -out ca.crt
@congnt24
congnt24 / query
Last active November 22, 2017 07:18
SELECT
*,
(SELECT json_build_object('id', ref.user_id, 'email', ref.email)
FROM user_profile_with_referal ref
WHERE customer_id = 84061) AS referal_info
FROM user_profile_full
WHERE user_id = 84061;
@congnt24
congnt24 / docker-compose.yml
Created November 8, 2017 08:19 — forked from elleryq/docker-compose.yml
docker + node-exporter + prometheus + promdash
# Need to do the following steps:
# 1. create /var/prometheus first.
# 2. run: docker-compose run promdash ./bin/rake db:migrate
nodeexporter:
image: prom/node-exporter
ports:
- "9100:9100"
prometheus:
image: prom/prometheus