Skip to content

Instantly share code, notes, and snippets.

@ksahnine
ksahnine / Dockerfile
Last active April 16, 2023 11:14
Dropwizard - Dockerfile
# Build:
# docker build -t ksahnine:trafic-ratp-dropwizard .
#
# Run:
# docker run -t -p 8080:8080 ksahnine:trafic-ratp-dropwizard
#
# DOCKER_VERSION 1.4
FROM dockerfile/java:openjdk-7-jdk
MAINTAINER Kadda SAHNINE <kadda.sahnine@inovia-conseil.fr>
{
"device_id": 562949953534211,
"timestamp": "2016-09-04T15:36:27.637Z",
"data": {
"push": 1
},
"device_properties": {
"appeui": "70b5e59ca0000001",
"decoding_ok": true,
"decryption_ok": true,
@ksahnine
ksahnine / node1.json
Last active August 25, 2016 07:08
Configuration agent Consul - node1
{
"node_name": "node1",
"server": true,
"bootstrap_expect": 1,
"data_dir": "/tmp/consul",
"client_addr": "172.20.20.10",
"advertise_addr": "172.20.20.10",
"ports": {
"dns": 53
},
/*
* Blink
* Turns on an LED on for one second,
* then off for one second, repeatedly.
*/
#include "Arduino.h"
void setup()
{
#
# Project Configuration File
#
# A detailed documentation with the EXAMPLES is located here:
# http://docs.platformio.org/en/latest/projectconf.html
#
# A sign `#` at the beginning of the line indicates a comment
# Comment lines are ignored.
@ksahnine
ksahnine / ble-event.json
Created April 17, 2016 15:55
Evènement absence
{
owner: "Kadda SAHNINE",
isNear: false,
addr: "80:71:7A:A9:17:27"
}
import socket
# Peudo code
def notify(tcpHost, tcpPort, device, logger):
# Create a socket (SOCK_STREAM means a TCP socket)
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
data = json.dumps(device)
try:
import bluetooth
import yaml
# Pseudo code
def main(argv):
configFile = "devices.yml"
# Loads the configuration file
if os.path.isfile(configFile):
# Delay between 2 BLE discoveries (in seconds)
delay: 4
# Checks the proximity of the following devices
devices:
- owner: Kadda SAHNINE
addr: 80:71:7A:A9:17:27
- owner: Bob L'EPONGE
addr: 18:9E:FC:26:03:55
{
"name": "react-widget-ratp",
"version": "0.0.1",
"main": "index.js",
"devDependencies": {
"babel-core": "^6.3.26",
"babel-loader": "^6.2.0",
"babel-preset-es2015": "^6.3.13",
"babel-preset-react": "^6.3.13",
"babel-runtime": "^6.3.19",