Skip to content

Instantly share code, notes, and snippets.

View marcusdb's full-sized avatar

Marcus David Bronstein marcusdb

  • porto, Portugal
View GitHub Profile
@marcusdb
marcusdb / alert.sh
Created December 17, 2017 18:19 — forked from cherti/alert.sh
send a dummy alert to prometheus-alertmanager
#!/bin/bash
name=$RANDOM
url='http://localhost:9093/api/v1/alerts'
echo "firing up alert $name"
# change url o
curl -XPOST $url -d "[{
\"status\": \"firing\",
@marcusdb
marcusdb / observable-recursive.js
Created June 5, 2018 09:39 — forked from Stuff90/observable-recursive.js
Example of a recursive call to an API using Observables
// Example for article : https://medium.com/@simonb90/appels-api-itératifs-avec-rxjs-a1c2593c558b
/*
* Definition of API method:
* getEntitiesByPage(page: number): Observable<Entity[]>
*/
let iterator = new BehaviorSubject<number>(1);
iterator.mergeMap((i) => {
@marcusdb
marcusdb / create_certificate.sh
Created January 14, 2019 14:02
create self signed certificate
openssl req -new -x509 -keyout snakeoil-ca-1.key -out snakeoil-ca-1.crt -days 365 -subj '/CN=ca1.test.dev.io/OU=Dev/O=Developer/L=Porto/ST=Porto/C=PT' -passin pass:password -passout pass:password
@marcusdb
marcusdb / app.js
Created April 3, 2019 15:38 — forked from johnhunter/app.js
Nodejs chat with socket.io
/*
Websockets using http://socket.io/
Also with express web mvc framework http://expressjs.com/
*/
var app = require('express').createServer(),
io = require('socket.io').listen(app),
port = 88;
@marcusdb
marcusdb / macbook-pro-2011-defective-gpu-fix.md
Created December 9, 2019 20:59 — forked from cdleon/macbook-pro-2011-defective-gpu-fix.md
Macbook Pro 2011 GPU Defect fix macOS Sierra and High Sierra
tmux key Description iTerm2 key
C-a Default prefix, used instead of "C-b". Same prefix is used in screen program, and it's easy to type. The only drawback of "C-a" is that underlying shell does not receive the keystroke to move to the beginning of the line.