Skip to content

Instantly share code, notes, and snippets.

View janajri's full-sized avatar
🏠
Working from home

Yousef janajri

🏠
Working from home
View GitHub Profile
@janajri
janajri / gist:f3100715d608bfc4f335
Last active November 25, 2015 07:27
Tututm ha proxy example
haproxy:
image: 'tutum/haproxy:latest'
environment:
- DEFAULT_SSL_CERT='***'
links:
-frontend
ports:
- '80:80'
- '443:443'
restart: always
var redis = require('redis')
var cache = redis.createClient()
var subjectQueryParams = {'_id': 0, 'school_state': 1, 'resource_type': 1, 'poverty_level': 1, 'date_posted': 1, 'total_donations': 1, 'funding_status': 1, 'grade_level': 1}
var getSubjects = function(done) {
cache.get('subjects', function(err, data){
if(err) return done(err)
void httpRequest() {
// We dont want to close the tcp socket
// client.stop();
// if there's a successful connection:
if (client.connect(server, 80)) {
Serial.println("connecting...");
// send the HTTP PUT request:
client.println("GET /latest.txt HTTP/1.1");
client.println("Host: www.arduino.cc");
Verifying that +yousef is my openname (Bitcoin username). https://onename.com/yousef
@janajri
janajri / btcmonitor.js
Last active August 29, 2015 14:08
simple btc address monitor
var address = process.env.BTC_ADDR;
if(!address) {
throw err('Provide btc address');
}
var request = require('request');
var f; // set interval ref;
var BTC_URL = 'https://blockchain.info/address/' + address + '?format=json';
var balance;
@janajri
janajri / gist:e45241c984fc7615021c
Created June 16, 2014 23:53
InfluxDB debug logs
[2014/06/16 23:49:08 UTC] [DEBG] (coordinator.(*CoordinatorImpl).AuthenticateDbUser:834) (raft:516efc082a1113f2) User steve authenticated succesfully
[2014/06/16 23:49:08 UTC] [INFO] (coordinator.(*CoordinatorImpl).RunQuery:69) Start Query: db: production, u: steve, q: SELECT count(USERNAME),OP,TYPE,SUB,GRP,USERID,$
[2014/06/16 23:49:08 UTC] [DEBG] (cluster.(*ShardData).QueryResponseBufferSize:404) BUFFER SIZE: 1000
[2014/06/16 23:49:08 UTC] [DEBG] (coordinator.(*CoordinatorImpl).runQuerySpec:430) Querying shards sequentially
[2014/06/16 23:49:08 UTC] [DEBG] (coordinator.(*CoordinatorImpl).runQuerySpec:433) Shard concurrent limit: 1
[2014/06/16 23:49:08 UTC] [DEBG] (cluster.(*ShardData).QueryResponseBufferSize:404) BUFFER SIZE: 1000
[2014/06/16 23:49:08 UTC] [DEBG] (coordinator.(*CoordinatorImpl).queryShards:405) QUERYING: shard: 0 [ID: 3, START: 1401926400000000, END: 1402531200000000, LOCAL: tr$
[2014/06/16 23:49:08 UTC] [DEBG] (cluster.(*ShardData).Query:221) QUERY: shard 3, query 'select count(USERNAME),O