Skip to content

Instantly share code, notes, and snippets.

@deep75
deep75 / mos.yml
Created August 21, 2018 15:24
chatbot-setup-web
author: karim
description: Setup Chatbot FC on ESP32
version: 1.0
libs_version: ${mos.version}
modules_version: ${mos.version}
mongoose_os_version: ${mos.version}
filesystem:
- fs
@deep75
deep75 / micro_eddystone_beacon.c
Created August 21, 2018 15:30
Code for Eddystone URL
/*********************************************************************
* INCLUDES
*/
#include <string.h>
#include <stdlib.h>
#include <ti/sysbios/BIOS.h>
#include <ti/sysbios/knl/Task.h>
#include <ti/sysbios/knl/Clock.h>
#include <ti/sysbios/knl/Event.h>
@deep75
deep75 / defaults.yaml
Created August 21, 2018 15:41
Using HTTPS with reverse-proxy.js
# reverse-proxy --port 80 --target 192.168.0.1:3000 --config ~/defaults.yaml
port: 443
target: 192.168.43.4:80
ssl:
cert: "/path/to/ssl/cert.file"
key: "/path/to/ssl/key.file"
@deep75
deep75 / setup-docker.sh
Created August 21, 2018 15:48
Setup Docker
#!/bin/sh
set -e
# This script is meant for quick & easy install via:
curl -fsSL get.docker.com -o get-docker.sh
sh get-docker.sh
#
# For test builds (ie. release candidates):
# $ curl -fsSL test.docker.com -o test-docker.sh
# $ sh test-docker.sh
@deep75
deep75 / setup-label-docker.sh
Created August 21, 2018 15:52
Add label metadata to a node
#!/bin/sh
# label node with ARMv7 32 bits
docker node update --label-add foo --label-add os=linux-arm <worker-arm>
# label node with ARMv8 64 Bits
docker node update --label-add foo --label-add os=linux-arm64 <worker-arm64>
@deep75
deep75 / ecosystem.config.js
Created August 21, 2018 16:04
PM2 deploy tool’s purpose is to automate this task
module.exports = {
apps: [{
name: "app",
script: "app.js"
}],
deploy: {
// "production" is the environment name
production: {
// SSH key path, default to $HOME/.ssh
key: "/path/to/some.pem",
#!/bin/bash
pip install azure-iot-edge-runtime-ctl
#Default IoT Edge Configuration Host Paths:
#------------------------------------------
# Linux: /etc/azure-iot-edge
#$> iotedgectl setup --help
#$> iotedgectl setup --config-file edge_config.json
#$> iotedgectl --verbose DEBUG setup --config-file edge_config.json
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
'use strict';
var Protocol = require('azure-iot-device-mqtt').Mqtt;
// Uncomment one of these transports and then change it in fromConnectionString to test other transports
// var Protocol = require('azure-iot-device-amqp').AmqpWs;
// var Protocol = require('azure-iot-device-http').Http;
// var Protocol = require('azure-iot-device-amqp').Amqp;
FROM arm64v8/node:10-alpine as build
WORKDIR /app
COPY . ./
RUN npm install
FROM arm64v8/node:10-alpine
COPY --from=build /app /
EXPOSE 8000
#!/bin/sh
curl -sfL https://balena.io/install.sh | sh