kubectl -n kube-system create sa tiller
kubectl create clusterrolebinding tiller --clusterrole cluster-admin --serviceaccount=kube-system:tiller
helm init --service-account tiller
# -*- coding: utf-8 -*- | |
# pip install python-jose | |
from jose import jwt | |
token = "<token here>" | |
key = { | |
"alg": "RS256", | |
"e": "AQAB", | |
"kid": "+Sr66GHFIwrVWzl9N02mrm96OCoYbNktaekEhXs9+eM=", # <-- this should match the `kid` in the token's headers |
alias kc='kubectl' | |
alias kclf='kubectl logs --tail=200 -f' | |
alias kcgs='kubectl get service -o wide' | |
alias kcgd='kubectl get deployment -o wide' | |
alias kcgp='kubectl get pod -o wide' | |
alias kcgn='kubectl get node -o wide' | |
alias kcdp='kubectl describe pod' | |
alias kcds='kubectl describe service' | |
alias kcdd='kubectl describe deployment' | |
alias kcdf='kubectl delete -f' |
package main | |
import ( | |
"fmt" | |
"reflect" | |
) | |
// Name of the struct tag used in examples | |
const tagName = "validate" |
file, err := os.Open(path) | |
if err != nil { | |
return err | |
} | |
defer file.Close() | |
// Only the first 512 bytes are used to sniff the content type. | |
buffer := make([]byte, 512) | |
_, err = file.Read(buffer) | |
if err != nil { |
from celery import Task | |
from flask import has_request_context, make_response, request | |
from myapp import app | |
__all__ = ['RequestContextTask'] | |
class RequestContextTask(Task): |
# Add field | |
echo '{"hello": "world"}' | jq --arg foo bar '. + {foo: $foo}' | |
# { | |
# "hello": "world", | |
# "foo": "bar" | |
# } | |
# Override field value | |
echo '{"hello": "world"}' | jq --arg foo bar '. + {hello: $foo}' | |
{ |
There are certain files created by particular editors, IDEs, operating systems, etc., that do not belong in a repository. But adding system-specific files to the repo's .gitignore
is considered a poor practice. This file should only exclude files and directories that are a part of the package that should not be versioned (such as the node_modules
directory) as well as files that are generated (and regenerated) as artifacts of a build process.
All other files should be in your own global gitignore file:
- Create a file called
.gitignore
in your home directory and add any filepath patterns you want to ignore. - Tell git where your global gitignore file is.
Note: The specific name and path you choose aren't important as long as you configure git to find it, as shown below. You could substitute
.config/git/ignore
for.gitignore
in your home directory, if you prefer.
When hosting our web applications, we often have one public IP
address (i.e., an IP address visible to the outside world)
using which we want to host multiple web apps. For example, one
may wants to host three different web apps respectively for
example1.com
, example2.com
, and example1.com/images
on
the same machine using a single IP address.
How can we do that? Well, the good news is Internet browsers
# Compiled source # | |
################### | |
*.com | |
*.class | |
*.dll | |
*.exe | |
*.o | |
*.so | |
# Packages # |