This file contains 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
# inspired by https://gist.github.com/diriver63/b72a954fa0da4851d89e5086aa13c6e8 | |
# build from online Dockerfile (use always URL to the latest Dockerfile): | |
# docker build --rm=true -t local/pyodbc-layer https://gist.githubusercontent.com/jangaraj/bf9a1bbf71bd6d4b9616828b29096d19/raw/a3a5f35dbafd50b9623c9d3886cb3f4b2d800d92/Dockerfile | |
# build from the local Dockerfile | |
# docker build --rm=true -t local/pyodbc-layer . | |
# copy pyodbc-layer.zip from the image and destroy image | |
# docker run -d --name delme local/pyodbc-layer sleep 1000 && docker cp delme:/tmp/pyodbc-layer.zip . && docker rm -f delme && docker rmi -f local/pyodbc-layer |
This file contains 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 python3 | |
"""This is a sample Python 3 app that hosts an OIDC app with Flask to | |
authenticate against Okta and run example calls against the new Okta OAuth-scoped APIs. | |
This example can also be used to host authentication for an OIDC webapp that does not use | |
the OAuth API scopes. | |
This was created with an MVP in mind as an example to demonstrate the ease of interacting | |
with Okta's Authroization Code flow and should not be used in production without | |
additions to error/state-handling and strong scrutiny.""" | |
This file contains 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
# -*- coding: utf-8 -*- | |
# Generated by the protocol buffer compiler. DO NOT EDIT! | |
# source: remote.proto | |
"""Generated protocol buffer code.""" | |
from google.protobuf.internal import builder as _builder | |
from google.protobuf import descriptor as _descriptor | |
from google.protobuf import descriptor_pool as _descriptor_pool | |
from google.protobuf import symbol_database as _symbol_database | |
# @@protoc_insertion_point(imports) |
This file contains 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
# don't use Math.round, because it may round it into the | |
# future and it may be a problem for implementation, where | |
# nbf claim is verified | |
secondsSinceEpoch = Math.floor(new Date().getTime()/1000) | |
exports secondsSinceEpoch |
This file contains 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
# use https://github.com/lambci/docker-lambda to simulate a lambda environment | |
docker run -it --rm \ | |
--entrypoint bash \ | |
-e ODBCINI=/opt/odbc.ini \ | |
-e ODBCSYSINI=/opt/ \ | |
-v $PWD:/export \ | |
lambci/lambda:build-python3.8 | |
# download and install unixODBC | |
# http://www.unixodbc.org/download.html |
This file contains 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
kubectl config set-cluster default-cluster --server=https://master_ip --certificate-authority=ssl/ca.pem | |
kubectl config set-credentials default-admin --certificate-authority=ssl/ca.pem --client-key=ssl/admin-key.pem --client-certificate=ssl/admin.pem | |
kubectl config set-context default-system --cluster=default-cluster --user=default-admin | |
kubectl config use-context default-system | |
# obviously you need the CA used to bootstrap your cluster and all the certificates |
This file contains 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
import requests | |
import uuid, socket | |
class Endomondo: | |
# user your own non OIDC credentials here | |
email = "<EMAIL>" | |
password = "<PASSWORD>" | |
country = 'GB' | |
device_id = str(uuid.uuid5(uuid.NAMESPACE_DNS, socket.gethostname())) |
This file contains 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 | |
# Reporting nonzero RC executions to syslog | |
# * * * * * root /usr/local/bin/errcron.sh <command> | |
# Installation: wget -O /usr/local/bin/errcron.sh https://gist.githubusercontent.com/jangaraj/c4c9262fe04156a40b02/raw/580ab988f9ff28c01cc9ee729ac9f0fe175b3a80/errcron.sh | |
OUT=$("$@" 2>&1) | |
RESULT=$? | |
if [ $RESULT -ne 0 ] | |
then |
This file contains 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
# multiprocess Lambda function to backup all Grafana dashboards to S3 bucket | |
import datetime, boto3 | |
from botocore.vendored import requests | |
from multiprocessing import Process, Pipe | |
config = { | |
'domain.com': { | |
'url': 'https://domain.com', | |
'key': '=grafana-api-key-with-read-permissions-for-all-dashboards=', |
This file contains 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 golang:1.11 as build | |
ARG VERSION=master | |
ARG GOOS=linux | |
ARG GOARCH=amd64 | |
ENV AUTHOR keycloak | |
ENV NAME keycloak-gatekeeper | |
RUN go get -v -d github.com/$AUTHOR/$NAME 2>/dev/null; \ | |
cd $GOPATH/src/github.com/$AUTHOR/$NAME \ | |
&& git checkout $VERSION \ | |
&& sed -i 's/keycloak-proxy/keycloak-gatekeeper/g' Makefile \ |
NewerOlder