Skip to content

Instantly share code, notes, and snippets.

View next-marianmoldovan's full-sized avatar

Marian C Moldovan next-marianmoldovan

  • BBVA Next Technologies
  • Madrid
View GitHub Profile
module.exports.address = function(){
var bb8Addres = 'ef:50:05:54:ea:7c';
// Becasue MacOs needs uuid not physical adress
if(process.platform === 'darwin')
bb8Addres = 'a025abc966a04dd98b9f3d465c84d918';
return bb8Addres;
}
@next-marianmoldovan
next-marianmoldovan / index.js
Created April 2, 2018 22:26
AWS Rekognition example
'use strict';
const request = require('request').defaults({ encoding: null });
const aws = require('aws-sdk');
const rekognition = new aws.Rekognition({region: 'eu-west-1'});
exports.handler = function(event, context, callback) {
request(event.url, function (error, response, body) {
if (!error && response.statusCode == 200) {
var params = {
@next-marianmoldovan
next-marianmoldovan / mongoinstall.sh
Created February 16, 2016 17:20
install mongodb on raspberry pi
#Mongodb
sudo apt-get --yes --force-yes install build-essential libboost-filesystem-dev libboost-program-options-dev libboost-system-dev libboost-thread-dev scons libboost-all-dev python-pymongo git
git clone https://github.com/skrabban/mongo-nonx86
cd mongo-nonx86
scons
sudo scons --prefix=/opt/mongo install
sudo adduser --firstuid 100 --ingroup nogroup --shell /etc/false --disabled-password --gecos "" --no-create-home mongodb
mkdir /var/log/mongodb/
chown mongodb:nogroup /var/log/mongodb/
HCI sniffer - Bluetooth packet analyzer ver 5.24
device: hci0 snap_len: 1500 filter: 0xffffffffffffffff
2015-09-28 09:55:38.340312 < HCI Command: Set Event Mask (0x03|0x0001) plen 8
Mask: 0xfffffbff07f8bf3d
2015-09-28 09:55:38.341683 > HCI Event: Command Complete (0x0e) plen 4
Set Event Mask (0x03|0x0001) ncmd 1
status 0x00
2015-09-28 09:55:38.341721 < HCI Command: LE Set Event Mask (0x08|0x0001) plen 8
mask 0x1f00000000000000 (Reserved)
2015-09-28 09:55:38.342685 > HCI Event: Command Complete (0x0e) plen 4
var th = require("telehash");
function startMesh(keys){
th.mesh({id:keys}, function(err, mesh){
if(err) return console.log("mesh failed to initialize",err);
// use mesh.* now
console.log(mesh.uri());
});
}
{ message: 'new_face',
faceId: '64530daa-c3e8-4d71-8fd5-d36f0703d75d' }
{ message: 'new_face_snap',
faceId: '64530daa-c3e8-4d71-8fd5-d36f0703d75d' }
{ message: 'known_face',
confidence: '0.928526043891907',
faceId: '64530daa-c3e8-4d71-8fd5-d36f0703d75d' }
{ message: 'known_face',
confidence: '0.938279509544373',
faceId: '64530daa-c3e8-4d71-8fd5-d36f0703d75d' }
@next-marianmoldovan
next-marianmoldovan / gist:e0e2029a04d4829a6501
Created March 26, 2015 15:15
Clean other files that are not images bash script
file * | grep -v image > noimage
cat noimage | cut -d : -f 1 | noimageids
rm -f $(<noimageids)
rm noimageids
@next-marianmoldovan
next-marianmoldovan / pipelines.py
Last active December 3, 2022 12:42
JSON UTF-8 Pipeline Scrapy
import json, io, codecs, os
from scrapy.xlib.pydispatch import dispatcher
from scrapy import signals
class BeevaPipeline(object):
def __init__(self):
dispatcher.connect(self.spider_opened, signals.spider_opened)
dispatcher.connect(self.spider_closed, signals.spider_closed)
@next-marianmoldovan
next-marianmoldovan / monitor.ino
Created February 4, 2015 11:24
Office monitor
#include <LedControl.h>
#include <AirQuality.h>
#include <Arduino.h>
#include <Firmata.h>
#include <Boards.h>
#include <math.h>
#include <DHT.h>