Create a template service file at /etc/systemd/system/[email protected]. The template parameter will correspond to the name
of target host:
[Unit]
Description=Setup a secure tunnel to %I
After=network.targetCreate a template service file at /etc/systemd/system/[email protected]. The template parameter will correspond to the name
of target host:
[Unit]
Description=Setup a secure tunnel to %I
After=network.targetThe plan is to create a pair of executables (ngrok and ngrokd) that are connected with a self-signed SSL cert. Since the client and server executables are paired, you won't be able to use any other ngrok to connect to this ngrokd, and vice versa.
Add two DNS records: one for the base domain and one for the wildcard domain. For example, if your base domain is domain.com, you'll need a record for that and for *.domain.com.
| unsigned char* hexstr_to_char(const char* hexstr) | |
| { | |
| size_t len = strlen(hexstr); | |
| IF_ASSERT(len % 2 != 0) | |
| return NULL; | |
| size_t final_len = len / 2; | |
| unsigned char* chrs = (unsigned char*)malloc((final_len+1) * sizeof(*chrs)); | |
| for (size_t i=0, j=0; j<final_len; i+=2, j++) | |
| chrs[j] = (hexstr[i] % 32 + 9) % 25 * 16 + (hexstr[i+1] % 32 + 9) % 25; | |
| chrs[final_len] = '\0'; |
| const {Action, Event, Property, Thing, WebThingServer} = require('./index'); | |
| const uuidv4 = require('uuid/v4'); | |
| var Thingy = require('thingy52'); | |
| var Color = require('color'); | |
| console.log('Reading Thingy environment sensors!'); | |
| class ButtonEvent extends Event { | |
| constructor(thing, state) { |
| const SerialPort = require('serialport') | |
| const port = new SerialPort('/dev/tty.usbmodem0006826707061', { | |
| baudRate: 9600//115200 | |
| }) | |
| const Delimiter = require('@serialport/parser-delimiter') | |
| const parser = port.pipe(new Delimiter({ delimiter: '\n' })) | |
| // console.log(Buffer.from([0xff])) | |
| const delay = require('delay'); |
| If you follow instruction at https://github.com/RAKWireless/RUI_Platform_Firmware_GCC. | |
| And work, that will be fine. For me, that not work well. I feel like i live in space. Yeah! | |
| Install arm-none-eabi | |
| DO NOT USE LASTEST VERSION -> i use version 7.2.1 (GNU Tools for Arm Embedded Processors 7-2017-q4-major) | |
| You can use lower version | |
| - download from here https://developer.arm.com/open-source/gnu-toolchain/gnu-rm/downloads/7-2017-q4-major-1-1 | |
| [Check here for more information https://gist.github.com/joegoggins/7763637] | |
| In winodw if you use cygwin that RAKWireless recommended, you NEED to install "make" too. Because "make" not include. |
| // In a Firestore standard example, we quickly create a 'xmas tree' of nested stuff | |
| // We use Promises directly: get().then(callback) and use snapshot.forEach() to iterate | |
| let campaignsRef = db.collection('campaigns'); | |
| let activeCampaigns = campaignsRef.where('active', '==', true).select().get() | |
| .then(snapshot => { | |
| snapshot.forEach(campaign => { | |
| console.log(campaign.id); | |
| let allTasks = campaignsRef.doc(campaign.id).collection('tasks').get().then( | |
| snapshot => { | |
| snapshot.forEach(task => { |
| import PIL.Image | |
| from cStringIO import StringIO | |
| import IPython.display | |
| import numpy as np | |
| def showarray(a, fmt='png'): | |
| a = np.uint8(a) | |
| f = StringIO() | |
| PIL.Image.fromarray(a).save(f, fmt) | |
| IPython.display.display(IPython.display.Image(data=f.getvalue())) |
| from matplotlib import pyplot as plt | |
| import cv2 | |
| img = cv2.imread('/Users/mustafa/test.jpg') | |
| gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY) | |
| plt.imshow(gray) | |
| plt.title('my picture') | |
| plt.show() |