Skip to content

Instantly share code, notes, and snippets.

View mitel's full-sized avatar

mitelone mitel

  • MQ
  • Bucharest, Dubai
View GitHub Profile
@mitel
mitel / generate_keys.sh
Created March 5, 2025 07:28
Script for generating a public/private key pair
#!/bin/bash
# Generate private key in PEM format
openssl genpkey -algorithm RSA -out private.key.pem -pkeyopt rsa_keygen_bits:2048
# Generate public key in PEM format (intermediate step)
openssl rsa -pubout -in private.key.pem -out public.key.pem
# Convert private key to JWK (JSON Web Key) format
private_jwk=$(openssl rsa -in private.key.pem -noout -text | \
@mitel
mitel / okta_authz_token.sh
Created March 5, 2025 07:20
Script for retrieving an authz token from an Okta endpoint
#!/bin/bash
# Your API client id
CLIENT_ID="0o....17"
# The /token endpoint
AUD="https://finqware.okta.com/oauth2/ausfqbxutkZBUKUgQ417/v1/token"
# The key id (kid) of your key
KID="t4cs...j3s"
# Your private key in PEM format
PRIVATE_KEY_PATH="./private.key.pem"
defmodule Errors.InternalError do
@typedoc """
A common structure for internal errors.
"""
@type t :: %__MODULE__{
type: error_type,
code: error_code,
context: error_context
}
@mitel
mitel / api_errors.md
Last active June 30, 2020 05:24
API Errors - design

API Errors

A set of standard error formats to be used on the external public APIs.

Schema

{
  "type": String,
  "http": Integer,
@mitel
mitel / catalog.md
Created March 27, 2020 16:14
Catalog API

Catalog description

  • a service that describes the skills and steps from Finqware skills catalog

Service path

GET /v1/catalog

Response message

@mitel
mitel / payload.json
Last active November 22, 2019 11:43
{
"application_type":"web",
"aud":"https://sandbox-oba.revolut.com",
"exp":1571318745,
"grant_types":[
"authorization_code",
"refresh_token",
"client_credentials"
],
"iat":1571300745,
@mitel
mitel / newRS256.key
Created April 28, 2019 18:23
test private key
-----BEGIN RSA PRIVATE KEY-----
MIIEpAIBAAKCAQEA5i0tS/LQd5A5oBBHVlhurp+zxhoCHRWn6C6nXRV9KZsWNupU
98SSc8TrNuzrGrjys1ri6rg5CtehqB4I5H98Kv3FHNRBFdtGHWx4wArvE0niq1PF
PHgl0QnN0Za7MvIKNeirgEZh2ZI9u7jYcyBUN8P4iDjja9fUde8ezsSeDG8/qdGg
u49m7p0QeybseAbmCxONZF7A+LigUDrx+ZVPyNrcvmKnxqp+9OwtLK+XY+QH/ctj
t837wKcQE8f1KSZCbcDfLsS/aUgQWmrDadc0vrxSfEef7nr3/wYl2BYdFbYH/CjQ
+13ZcrMb4zJnPXNpIZSPEUjn12DS7Id6jJ4e8wIDAQABAoIBADzfbb9MM/2q0tKV
+4fGU18zNSQK9MwkUgeBbxma+ULrlPBpAJeWEPU0+s/H0FV83BK60pAosE1Bwaro
ZomnfXsRKfP53kyddOmLKlP/kEKVo7CTsvHPBJFH+nqXVmKeyDyBj/mYo4AawODI
fdXUkvE8jpnYEa0Po0ydNJSSQwoeUTSZcKkBwkQ8qtMpJJ2b86pketqU9P8oI7v6
@mitel
mitel / jws.js
Last active April 28, 2019 18:44
JWT signing with b64:false in node.js
const jose = require("node-jose");
const fs = require("fs");
const privateKEY = fs.readFileSync("./newRS256.key", "utf8");
// const publicKEY = fs.readFileSync("./newRS256.key.pub", "utf8");
const keystore = jose.JWK.createKeyStore();
const payload = {
foo: "test"
@mitel
mitel / mesos_fw_terraform
Last active March 17, 2016 17:16
mesos firewall rules
resource "aws_security_group" "mesos_master_sg" {
name = "mesos_master_sg"
description = "mesos master SG"
vpc_id = "${aws_vpc.vpc.id}"
}
resource "aws_security_group" "zookeeper_server_sg" {
name = "zookeeper_server_sg"
description = "zookeeper SG"
vpc_id = "${aws_vpc.vpc.id}"
ubuntu@ip-10-1-69-179:~$ sudo mesos-master --work_dir=/var/lib/mesos --quorum=2 --zk=zk://10.1.65.69:2181,10.1.69.179:2181,10.1.0.54:2181/mesos
I0314 05:48:31.114145 2408 main.cpp:230] Build: 2016-03-10 20:30:19 by root
I0314 05:48:31.114260 2408 main.cpp:232] Version: 0.27.2
I0314 05:48:31.114300 2408 main.cpp:235] Git tag: 0.27.2
I0314 05:48:31.114327 2408 main.cpp:239] Git SHA: 3c9ec4a0f34420b7803848af597de00fedefe0e2
I0314 05:48:31.114388 2408 main.cpp:253] Using 'HierarchicalDRF' allocator
I0314 05:48:31.150454 2408 leveldb.cpp:174] Opened db in 35.727378ms
I0314 05:48:31.152971 2408 leveldb.cpp:181] Compacted db in 2.434682ms
I0314 05:48:31.153039 2408 leveldb.cpp:196] Created db iterator in 8703ns
I0314 05:48:31.153080 2408 leveldb.cpp:202] Seeked to beginning of db in 698ns