Skip to content

Instantly share code, notes, and snippets.

@edwios
edwios / genMakeFile_nRF52.sh
Last active October 9, 2017 11:35
Script to generate SRC_FILES and INC_FOLDERS in Makefile
#!/bin/bash
# Script to generate SRC_FILES and INC_FOLDERS in Makefile
#
# Require:
# app_config.h
#
# Output:
# SRC_FILES
# INC_FOLDERS
Install MicroPython and running python scripts on ESP32
Tools required
esptool.py: pip install esptool
ampy: pip install adafruit-ampy
Download firmware for ESP32 from MicroPython: http://micropython.org/download#esp32
Installation
Erase flash on ESP32: esptool.py --port /dev/tty.SLAB_USBtoUART erase_flash
@edwios
edwios / MovidiusNCSRPi3.txt
Last active November 1, 2017 02:51
Notes on installing Movidius NCS onto Raspberry Pi 3
# Instructions on how to install Movidius NCS on the Raspberry Pi 3
# To do on Host computer
## Install Toolkit and API on Host computer
Follow the instructions here https://developer.movidius.com/start
## Move files to RPi3
Copy the directory ncapi/ from Host computer to RPi3
# To do on RPi3
@edwios
edwios / Makefile.config
Created September 26, 2017 14:08
Makefile.config to build Caffe on Raspberry Pi RASPBIAN STRETCH LITE (2017-09-07)
## Refer to http://caffe.berkeleyvision.org/installation.html
# Contributions simplifying and improving our build system are welcome!
# Configured for Raspberry Pi 3 running Raspian Stretch Lite 2017-09-07
# cuDNN acceleration switch (uncomment to build with cuDNN).
# USE_CUDNN := 1
# CPU-only switch (uncomment to build without GPU support).
CPU_ONLY := 1
@edwios
edwios / install_opencv_rpi.sh
Last active September 26, 2017 14:01 — forked from soobrosa/install_opencv_rpi.sh
Install OpenCV on a Raspbian Jessie
# thanks to
# https://medium.com/r/?url=https%3A%2F%2Fncsforum.movidius.com%2Fdiscussion%2Fcomment%2F299%2F%23Comment%5C_299
# https://ahmedibrahimvt.wordpress.com/2017/02/19/fatal-error-hdf5-h-no-such-file-or-directory/
# http://www.pyimagesearch.com/2015/07/20/install-opencv-3-0-and-python-3-4-on-ubuntu/
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install build-essential cmake pkg-config
sudo apt-get install libjpeg-dev libtiff5-dev libjasper-dev libpng12-dev
sudo apt-get install libavcodec-dev libavformat-dev libswscale-dev libv4l-dev
@edwios
edwios / install_caffe_rpi.sh
Last active September 26, 2017 14:02 — forked from soobrosa/install_caffe_rpi.sh
Caffe install + benchmark script for Raspbian Jessie
# tested on a Raspbery Pi 3 running a Raspbian Jessie July 2017
# Install OpenCV 3.3
# See: https://gist.github.com/edwios/5410ceabca579bed7ff1d1b62ee395a1
# dependencies
apt-get update
sudo apt-get install libprotobuf-dev libleveldb-dev libsnappy-dev libhdf5-serial-dev protobuf-compiler
sudo apt-get install --no-install-recommends libboost-all-dev
sudo apt-get install libgflags-dev libgoogle-glog-dev liblmdb-dev
@edwios
edwios / install_caffe_osx.sh
Last active September 14, 2017 17:04 — forked from soobrosa/install_caffe_osx.sh
Caffe install + benchmark script for OSX
# tested on Macbook Air 13", early 2015, 1,6 Ghz Intel Core i5, 8Gb RAM running macOS Sierra
# tested on MacBook Pro 13" Touchbar, 2016, 3.3 GHz Intel Core i7, 16GB RAM running macOS Sierra 10.12.6
# if you don't have brew
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
brew update
# dependencies
brew install -vd snappy leveldb gflags glog szip lmdb
brew tap homebrew/science
@edwios
edwios / osx-mongodb-rlimits-fix.md
Created July 1, 2017 06:10 — forked from tamitutor/osx-mongodb-rlimits-fix.md
Fix Mongodb "soft rlimits" Warning On Mac OS X (Yosemite)

If you are seeing Mongo soft rlimits warnings in your logs, or a WARNING: soft rlimits too low. Number of files is 256, should be at least 1000 when you login to mongo shell via mongo from the commandline, or any mysterious/unexplained mongo connection errors... follow this how-to exactly and it will resolve the issue for you.

(Source of this how to found at basho/basho_docs#1402)

First file: sudo vi /Library/LaunchDaemons/limit.maxfiles.plist

...containing:

@edwios
edwios / calculateDays.py
Created February 24, 2016 00:10
Calculate the number of days a battery would last given various operation characteristics
#!/usr/local/bin/python3
#DEEP SLEEP MODE
#System.sleep(SLEEP_MODE_DEEP,60) **~61uA**
#STOP MODE
#System.sleep(long seconds) **~ 2.8mA!**
def findDays(cb, ti, iq, ta, ia):
@edwios
edwios / Particle-Core MQTT template.ino
Last active September 7, 2016 10:49
Maintain MQTT connection even after network disconnects/reconnects
// This #include statement was automatically added by the Particle IDE.
#include "MQTT/MQTT.h"
#define RECONNECT 15*1000
#define CLIENT_NAME "MagicLight-Spark"
byte server[] = { 10,0,1,250 };
MQTT client(server, 1883, callback);
bool init = true;