export secret=$(kubectl get serviceaccount $ACCT_NAME -o json|jq -r .secrets[].name) kubectl get secrets $secret -o json | jq -Mr ‘.data[“ca.crt”]’ | base64 -D
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
BRIDGE_IF= "enp4s0f1" #Host interface to use for bridge interface creation in guest | |
MASTER_IP_NW= "192.168.1.0/24" # Subnet for Vagrant boxes | |
MASTER_IP="192.168.1.10" # IP address of Master | |
NFS_IP= "192.168.1.8" # IP address of NFS server | | |
WORKER_IP= "192.168.1.#{i + 10}" # "Worker IP pattern (generates 192.168.1.11, 192.168.1.12...) " | |
WORKER_COUNT=3 #Number of workers |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def snake_case(s): | |
in_upper = False | |
out = [] | |
stack = [] | |
for c in s: | |
if c.isupper(): | |
stack.append(c.lower()) | |
else: | |
if len(stack) == 1: | |
if len(out) > 0: out.append('_') |
export secret=$(kubectl get serviceaccount $ACCT_NAME -o json|jq -r .secrets[].name) kubectl get secret $secret -o yaml|grep token:|awk ‘{print $2}’|base64 -D
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function handleAuthentication() { | |
webAuth.parseHash(function(err, authResult) { | |
if (authResult && authResult.accessToken && authResult.idToken) { | |
window.location.hash = ''; | |
let decodedId = jwtDecode(authResult.idToken); | |
let profile = { accessToken: authResult.accessToken, | |
email: decodedId.email, | |
emailVerified: decodedId.email_verified, | |
exp: decodedId.exp, | |
name: decodedId.name, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mapResult : PortAuthResponse -> Msgs.Msg | |
mapResult result = | |
case ( result.err, result.ok, result.stale ) of | |
( Just msg, _, _ ) -> | |
Msgs.Unauthenticated msg | |
( Nothing, _, True ) -> | |
Msgs.StaleAuth | |
( Nothing, Just user, False ) -> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
subscriptions : Model -> Sub Msg | |
subscriptions model = | |
Ports.authResponse Auth.mapResult | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
initialModel : ( Model, Cmd Msg ) | |
initialModel = | |
( { authenticated = False | |
, profile = Nothing | |
, errorMsg = "" | |
} | |
, Ports.authStatus () | |
) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
update : Msg -> Model -> ( Model, Cmd Msg ) | |
update msg model = | |
case msg of | |
Unauthenticated err -> | |
( { model | authenticated = False }, Cmd.none ) | |
StaleAuth -> | |
( model, Ports.authRequest () ) | |
Authenticated profile -> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Basic Postgres commmands | |
- Install postgres | |
brew install postgres | |
# postgres and another user will be created in this step. | |
- Login as current user | |
psql | |
- Login as postgres user |
NewerOlder