Skip to content

Instantly share code, notes, and snippets.

View ataube's full-sized avatar

Andreas Taube ataube

  • collect.ai
  • Hamburg
View GitHub Profile
@ataube
ataube / authenticate_token.js
Last active May 8, 2017 15:53
Keycloak Learnings
// authenticate
function authenticate() {
const url = [
'http://localhost:8080/',
'auth/realms/collectai/protocol/openid-connect/auth',
'?response_type=code&client_id=portals-api&redirect_uri=http://localhost:3000/merchant',
];
document.location.assign(url.join(''));
}
@ataube
ataube / mapstream.js
Created March 3, 2017 18:41
Example proofing the sequential processing of es map
const es = require('event-stream');
const R = require('ramda');
function getRandomInt(min, max) {
var min = Math.ceil(min);
var max = Math.floor(max);
return Math.floor(Math.random() * (max - min)) + min;
}
const readable = es.readArray(R.map(R.toString, R.range(1, 5000)));
@ataube
ataube / Readme.md
Last active June 3, 2017 10:43
Docker setup to access from a container a postgres instance installed on the host system

The following steps explain a workaround to connect from a container to a postgres server installed on the host system. This pattern can be applied to other (host) services as well.

Setup

  1. Install postgres
  1. Attach a unused IP to the local lo0 interface sudo ifconfig lo0 alias 10.200.10.1/24

Keybase proof

I hereby claim:

  • I am ataube on github.
  • I am andreastaube (https://keybase.io/andreastaube) on keybase.
  • I have a public key ASA_NKvCq7f-n8IwflxKjelaG-iHFrHwVvTJO_pRcKRi0Qo

To claim this, I am signing this object:

@ataube
ataube / hacks.md
Last active April 19, 2020 21:58
IoT Hacking (ESP32)

Mongoose OS

GPIO2 LED Blinking (blue one)

GPIO.set_mode(2, GPIO.MODE_OUTPUT);
GPIO.blink(2, 1000, 1000)