Skip to content

Instantly share code, notes, and snippets.

View mstfldmr's full-sized avatar

Mustafa Aldemir mstfldmr

View GitHub Profile
@matthewberryman
matthewberryman / greengrass.service
Last active November 25, 2019 11:42
greengrass systemd
[Unit]
Description=greengrass daemon
After=network.target
[Service]
ExecStart=/greengrass/ggc/core/greengrassd start
Type=simple
RestartSec=2
Restart=always
User=root
@zcaceres
zcaceres / index.js
Created October 27, 2017 19:36 — forked from groteworld/index.js
Example aws/aws-sdk-js IotData API Lambda usage
// An usage of AWS.IotData in Lambdas
//
// This example assumes some things
// 1. That you have a environment variable AWS_IOT_ENDPOINT. This is the url that you can find in AWS IoT dashboard settings
// 2. The lambda and your aws iot devices are on the same account and region
const AWS = require('aws-sdk');
const iotData = new AWS.IotData({ endpoint: process.env.AWS_IOT_ENDPOINT });
const handler = (event, context) => {
@groteworld
groteworld / index.js
Last active June 5, 2020 14:49
Example aws/aws-sdk-js IotData API Lambda usage
// An usage of AWS.IotData in Lambdas
//
// This example assumes some things
// 1. That you have a environment variable AWS_IOT_ENDPOINT. This is the url that you can find in AWS IoT dashboard settings
// 2. The lambda and your aws iot devices are on the same account and region
const AWS = require('aws-sdk');
const iotData = new AWS.IotData({ endpoint: process.env.AWS_IOT_ENDPOINT });
const handler = (event, context) => {
@kylehounslow
kylehounslow / client.py
Last active April 23, 2024 10:58
Send and receive images using Flask, Numpy and OpenCV
from __future__ import print_function
import requests
import json
import cv2
addr = 'http://localhost:5000'
test_url = addr + '/api/test'
# prepare headers for http request
content_type = 'image/jpeg'
@lashex
lashex / aws-iot-mosquitto
Created May 23, 2016 21:05
Example Mosquitto CLI pub/sub using AWS IoT MQTT endpoint
The Mosquitto Pub CLI
$> mosquitto_pub --cert thing-0.pem --key thing-0.prv --cafile aws-iot-rootCA.crt -h XXXXXXXXYYYYY.iot.us-west-2.amazonaws.com -p 8883 -t 'test/thing' -m "Hello from Mosquitto"
The Mosquitto Sub CLI
$ mosquitto_sub --cert thing-0.pem --key thing-0.prv --cafile aws-iot-rootCA.crt -h XXXXXXXXYYYYY.iot.us-west-2.amazonaws.com -p 8883 -t 'test/+'
@Uberi
Uberi / realtime-plot.py
Created April 25, 2015 02:10
Realtime plotting with Matplotlib.
#!/usr/bin/env python3
import time, random
import math
from collections import deque
start = time.time()
class RealtimePlot:
def __init__(self, axes, max_entries = 100):
@arkival
arkival / intel-edison-cmdline.md
Last active March 21, 2018 00:31
C/C++ cross compilation from the command line for the Intel Edison

C/C++ cross compilation from the command line for the Intel Edison

It is not necessary to use the Eclipse environment in order to compile code for the Intel Edison. Command line compilation is possible on all platforms and is relatively straightforward. For linux and OS/X the simplest method is to download the SDK for the respective platform and setup as described below. Although Intel lists SDKs for both 32 and 64 bit Windows, I find it simpler to setup command line compilation from the integrated IOT platform installation.

All three platforms use the GNU compiler tools (gcc, g++, and friends) and the main differences really come down to differences in the command shell usage. Consequently, the procedures have the following common elements.

  1. Install the cross compilation tool chain and library file-system.
  2. Setup the path so that the operating system can find the compilers and other utilities.
  3. Setup environment variables to simplify the command line and tell the compilers where to find librari
@cranberyxl
cranberyxl / gist:2483417
Created April 24, 2012 20:24
How to download a github private tarball
curl -o {tag}.tgz -Lu "{githubuser}:{githubpassword}" https://github.com/{githubuser}/repo/tarball/{tag}