Skip to content

Instantly share code, notes, and snippets.

View ecstasy2's full-sized avatar

DIALLO Mamadou Bobo ecstasy2

  • Edyn
  • San Francisco
View GitHub Profile
@ecstasy2
ecstasy2 / DeviceInactive.js
Created September 1, 2016 02:19
Notifiers
var Notifier = require('@ecstasy2/notifier')
//
var DeviceInactive = Notifier.create({
trigger: {
type: 'cron',
scope: 'device',
recurrence: '* */2 * * *',
},
@ecstasy2
ecstasy2 / rancher-nginx-proxy_params
Last active June 23, 2016 05:47
default nginx proxy_params
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
client_max_body_size 100M;
client_body_buffer_size 1m;
proxy_intercept_errors on;
proxy_buffering on;
proxy_buffer_size 128k;
proxy_buffers 256 16k;
@ecstasy2
ecstasy2 / dev-stack-nginx-config
Last active September 7, 2016 17:40
Nginx configuration to proxy all edyn micro services
resolver 169.254.169.250;
server {
listen 80 default_server;
return 200 'Ok!';
add_header Content-Type text/plain;
}
server {
listen 80;
@ecstasy2
ecstasy2 / rancher-nginx-bootstrap
Last active June 23, 2016 07:36
Used to bootstrap nginx proxy for developer stacks
echo "Download and install configuration"
STACK=`curl -s http://rancher-metadata/latest/self/stack/name`
export STACK
echo "Running in stack $STACK"
curl -L -H 'Cache-Control: no-cache' https://gist.githubusercontent.com/ecstasy2/b03381ca42d1df394decb14582cd8726/raw > /tmp/services.conf
cat /tmp/services.conf | envsubst '$STACK' | tee /etc/nginx/conf.d/services.conf
curl -L -H 'Cache-Control: no-cache' https://gist.githubusercontent.com/ecstasy2/74da089e617f6e9211dd00146054cfb1/raw > /etc/nginx/proxy_params
@ecstasy2
ecstasy2 / update-status.sh
Created May 18, 2016 12:25
Bash script to update github commit status
#!/bin/bash
set -e
# Usage: ./update-status.sh --sha=somesha \
# --repo=edyn/service-identity \
# --status=pending \
# --message="Starting tests" \
# --context=edyn/e2e \
# --url=http://something.com
public interface CmdFunction{
public void call(Object param);
}
// This is the function where you need a function passed in as a param
public void tellMeWhatTodo(CmdFunction cmd) {
if (something) {
cmd.call('me');
}