Skip to content

Instantly share code, notes, and snippets.

Devopsing, Dockerising, Grafanasing, Keycloaking, Clouding, Lambdasing,...

Jan Garaj jangaraj

Devopsing, Dockerising, Grafanasing, Keycloaking, Clouding, Lambdasing,...
View GitHub Profile
jangaraj /
Created Jul 29, 2022
Promtheus python proto files
# -*- 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)
jangaraj / nbf.js
Created Oct 23, 2021
NBF scripted mapper for Keycloak OIDC clients
View nbf.js
# 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
jangaraj /
Last active Nov 10, 2020
Connect to Endomondo API with local credentials
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()))
jangaraj / Dockerfile
Last active Jul 7, 2020
Dockerfile to build pyodbc and unixODBC for MSSQL as a lambda layer for Python 3.8 in the Dockerfile
View Dockerfile
# inspired by
# build from online Dockerfile (use always URL to the latest Dockerfile):
# docker build --rm=true -t local/pyodbc-layer
# build from the local Dockerfile
# docker build --rm=true -t local/pyodbc-layer .
# copy from the image and destroy image
# docker run -d --name delme local/pyodbc-layer sleep 1000 && docker cp delme:/tmp/ . && docker rm -f delme && docker rmi -f local/pyodbc-layer
jangaraj / pyodbc-unixODBC-lambda-layer
Last active Jun 22, 2021 — forked from diriver63/pyodbc-unixODBC-lambda-layer
pyodbc and unixODBC for MSSQL as a lambda layer - Python 3.8
View pyodbc-unixODBC-lambda-layer
# use to simulate a lambda environment
docker run -it --rm \
--entrypoint bash \
-e ODBCINI=/opt/odbc.ini \
-e ODBCSYSINI=/opt/ \
-v $PWD:/export \
# download and install unixODBC
jangaraj / Dockerfile
Created Oct 5, 2018
View Dockerfile
FROM golang:1.11 as build
ARG GOOS=linux
ENV AUTHOR keycloak
ENV NAME keycloak-gatekeeper
RUN go get -v -d$AUTHOR/$NAME 2>/dev/null; \
&& git checkout $VERSION \
&& sed -i 's/keycloak-proxy/keycloak-gatekeeper/g' Makefile \
jangaraj /
Last active Dec 6, 2018
AWS Lambda Function to backup Grafana 5+ dashboards into S3
# 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 = {
'': {
'url': '',
'key': '=grafana-api-key-with-read-permissions-for-all-dashboards=',
View gist:d741a11ef59b6f5abe3ed534c66533c8
org 0x05000000
db 0x7F, "ELF"
dd 1
dd 0
dd $$
dw 2
dw 3
dd 0x0500001B
#!/usr/bin/env python
import json, requests
debug = 0
# time ./ > /tmp/metais.stats
real 16m57.925s
user 6m4.204s
jangaraj / aws-grafana-policy.json
Last active Nov 2, 2016
View aws-grafana-policy.json
"Version": "2012-10-17",
"Statement": [
"Effect": "Allow",
"Action": [