Skip to content

Instantly share code, notes, and snippets.

View sangdongvan's full-sized avatar
🎯
Focusing

Sang Dong sangdongvan

🎯
Focusing
  • AgilityIO
  • Vietnam
View GitHub Profile
kubectl create serviceaccount --namespace kube-system tiller
kubectl create clusterrolebinding tiller-cluster-rule --clusterrole=cluster-admin --serviceaccount=kube-system:tiller
kubectl patch deploy --namespace kube-system tiller-deploy -p '{"spec":{"template":{"spec":{"serviceAccount":"tiller"}}}}'
stale_while_revalidate_seconds = settings.FRONTEND_CACHE_TIMEOUT / 2
three_days_in_seconds = 60 * 60 * 24 * 3
extra_cache_control_headers = {
'stale-while-revalidate=%s' % stale_while_revalidate_seconds,
'stale-if-error=%s' % three_days_in_seconds,
}
patch_cache_control(response, **extra_cache_control_headers)
@sangdongvan
sangdongvan / .hyper.js
Last active February 28, 2020 06:43
My personal .hyper.js config
// Future versions of Hyper may add additional config options,
// which will not automatically be merged into this file.
// See https://hyper.is#cfg for all currently supported options.
module.exports = {
config: {
hypercwd: {
initialWorkingDirectory: '~/code'
},
@sangdongvan
sangdongvan / cloudSettings
Last active January 21, 2020 08:03
Visual Studio Code Settings Sync Gist
{"lastUpload":"2020-01-21T08:02:59.871Z","extensionVersion":"v3.4.3"}

install kubernetes 1.6 on centos 7.3

Install kubelet, kubeadm, docker, kubectl and kubernetes-cni

1. Install Docker

yum remove -y docker docker-common docker-selinux docker-engine
yum install -y yum-utils device-mapper-persistent-data lvm2
yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
yum install -y docker-ce-17.12.0.ce
@sangdongvan
sangdongvan / application.properties
Created January 16, 2018 07:39
Config Postgres Datasource for SpringBoot Application
# ===============================
# = DATA SOURCE
# ===============================
# Set here configurations for the database connection
spring.datasource.url=jdbc:postgresql://localhost:5432/springbootdb
spring.datasource.username=postgres
spring.datasource.password=postgres@123
spring.datasource.driver-class-name=org.postgresql.Driver
# Keep the connection alive if idle for a long time (needed in production)
spring.datasource.testWhileIdle=true
gistup
@sangdongvan
sangdongvan / init.vim
Last active December 4, 2019 06:40
Neovim configuration
" Setup vim-plug -----------------------------------------------------------{{{
" Declare Plugin system Config
call plug#begin('~/.local/share/nvim/plugged')
" UI enhance
Plug 'Yggdroot/indentLine'
Plug 'airblade/vim-gitgutter'
Plug 'itchyny/lightline.vim'
@sangdongvan
sangdongvan / delete_local_branch.sh
Created November 19, 2015 14:47
Delete all local branch start with "feature/" prefix
git branch | grep feature/ | while read feature
do
git branch -D $feature
done
@sangdongvan
sangdongvan / appconfigs.txt
Last active October 14, 2015 09:22
AppConfigs & its models in a wagtail application
[wagtaildemo wagtaildemo]$ python manage.py ref_applications_1
<AuthConfig: auth>
<class 'django.contrib.auth.models.Permission'>
<class 'django.contrib.auth.models.Group'>
<class 'django.contrib.auth.models.User'>
<ContentTypesConfig: contenttypes>
<class 'django.contrib.contenttypes.models.ContentType'>
<SessionsConfig: sessions>
<class 'django.contrib.sessions.models.Session'>
<MessagesConfig: messages>