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
FROM gradle:jdk8 as builder | |
RUN mkdir -p /home/gradle/app | |
WORKDIR /home/gradle/app | |
ADD --chown=gradle:gradle . /home/gradle/app | |
RUN /home/gradle/app/gradlew assemble | |
FROM openjdk:8-jre-alpine | |
COPY --from=builder /home/gradle/app/build/libs/*.war /app.war | |
CMD java -jar /app.war |
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
package de.tdlabs.keycloak.client; | |
import com.fasterxml.jackson.databind.ObjectMapper; | |
import org.keycloak.OAuth2Constants; | |
import org.keycloak.RSATokenVerifier; | |
import org.keycloak.admin.client.Keycloak; | |
import org.keycloak.admin.client.KeycloakBuilder; | |
import org.keycloak.common.VerificationException; | |
import org.keycloak.jose.jws.JWSHeader; | |
import org.keycloak.representations.AccessToken; |
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
package de.tdlabs.keycloak.client; | |
import java.util.Arrays; | |
import java.util.Collections; | |
import javax.ws.rs.core.Response; | |
import org.keycloak.OAuth2Constants; | |
import org.keycloak.admin.client.Keycloak; | |
import org.keycloak.admin.client.KeycloakBuilder; |
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
# Copying kubernetes resources accross namespaces | |
kubectl get rs,secrets -o json --namespace old | jq '.items[].metadata.namespace = "new"' | kubectl create -f - | |
kubectl get cm -o json --namespace old some-config-map | jq '.metadata.namespace = "new"' | kubectl create -f - | |
# kubectl exec in each pods | |
for pod in `kubectl get pods -o go-template --template '{{range .items}}{{.metadata.name}}{{"\n"}}{{end}}'`; do echo $pod date:; kubectl exec -it $pod -- date ; echo "--------------"; done |
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
#!/usr/bin/env bash | |
# Service account created using above manifest file | |
serviceaccount=goglidescustomsa | |
namespace=goglides | |
# Get related Secrets for this Service Account | |
secret=$(kubectl get sa $serviceaccount -n $namespace -o json | jq -r .secrets[].name) | |
# Get ca.crt from secret (using OSX base64 with -D flag for decode) | |
kubectl get secret $secret -n $namespace -o json | jq -r '.data["ca.crt"]' | base64 -D > ca.crt |
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
apiVersion: v1 | |
kind: Namespace | |
metadata: | |
name: goglides | |
--- | |
apiVersion: v1 | |
kind: ServiceAccount | |
metadata: | |
labels: |
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
aws ecr describe-repositories --region=us-east-1 | jq -r '.[] | .[] | .repositoryName' | while read line; do aws ecr list-images --repository-name=$line --region=us-east-1; echo "------------"; done |
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
#!/bin/bash | |
IMAGES=$@ | |
echo "This will remove all your current containers and images except for:" | |
echo ${IMAGES} | |
read -p "Are you sure? [yes/NO] " -n 1 -r | |
echo # (optional) move to a new line | |
if [[ ! $REPLY =~ ^[Yy]$ ]] | |
then |
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
# Requirements: | |
# | |
# aws configure: | |
# AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, REGION | |
import os | |
import boto3 | |
import random | |
import string | |
import sys, getopt |
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
CREATE TABLE IF NOT EXISTS `country` ( | |
`id` int(11) NOT NULL AUTO_INCREMENT, | |
`iso` char(2) NOT NULL, | |
`name` varchar(80) NOT NULL, | |
`nicename` varchar(80) NOT NULL, | |
`iso3` char(3) DEFAULT NULL, | |
`numcode` smallint(6) DEFAULT NULL, | |
`phonecode` int(5) NOT NULL, | |
PRIMARY KEY (`id`) | |
) ENGINE=MyISAM DEFAULT CHARSET=latin1; |