Skip to content

Instantly share code, notes, and snippets.

View gbrault's full-sized avatar
🏠
Working from home

Gilbert Brault gbrault

🏠
Working from home
  • Vence
View GitHub Profile
@gbrault
gbrault / httpsnodered.txt
Last active August 23, 2023 09:21
https setting node-red
from http://industrialinternet.co.uk/node-red/adding-https-ssl-to-node-red/
- go to .node-red directory
- create a public directory: mkdir public
- go to public: cd public
- Create a certificate
openssl genrsa -out privatekey.pem 1024
openssl req -new -key privatekey.pem -out private-csr.pem
openssl x509 -req -days 365 -in private-csr.pem -signkey privatekey.pem -out certificate.pem
- cd ..
@gbrault
gbrault / table.html
Created December 4, 2016 12:04
Node-Red dynamic Table template
<table>
<tr>
<th ng-repeat="(key,value) in table[0]">{{key}}</th>
</tr>
<tbody ng-repeat="row in table">
<tr ng-if="$even">
<td ng-repeat="(key,value) in row">{{value}}</td>
</tr>
<tr ng-if="$odd">
<td style="background-color:#f1f1f1" ng-repeat="(key,value) in row">{{value}}</td>
@gbrault
gbrault / callsyncinasync.py
Created May 10, 2019 14:01
Calling synchronous code from asyncio
import asyncio
import time
from urllib.request import urlopen
@asyncio.coroutine
def count_to_10():
for i in range(11):
print("Counter: {}".format(i))
yield from asyncio.sleep(.5)
@gbrault
gbrault / split-four.html
Created February 27, 2018 08:51
split a window into four adjustable divisions
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
<script>
(function () {
/**
* THIS OBJECT WILL ONLY WORK IF your target is positioned relative or absolute,
@gbrault
gbrault / splitter.html
Created February 27, 2018 06:34
html div based splitter
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
<script>
(function () {
/**
* THIS OBJECT WILL ONLY WORK IF your target is positioned relative or absolute,
@gbrault
gbrault / dev tool install.txt
Created February 26, 2018 14:42
node js dev tool install
npm install -g windows-build-tools
@gbrault
gbrault / gist:faaa617380c986d48b143de54e3fb278
Last active October 28, 2017 07:57
Embeded device shops
https://www.netblocks.eu
http://sandboxelectronics.com
http://www.kaayee.com/
http://www.ifroglab.com
http://www.lilygo.cn
http://www.rakwireless.com/en/
https://www.futurashop.it
https://bsfrance.fr
http://www.dorji.com/
https://www.digitalsmarties.net/ (jeelab shop)
@gbrault
gbrault / gist:a42b012d774d2d26c70808859a017140
Created April 15, 2017 13:37
how to ssh a docker container
- create an ubuntu docker container with kitematic
- load ssh-server with apt-get
- edit /etc/ssh/ssh_config and undash PasswordAuthentication yes
- restart ssh (su + service ssh restart)
- add a new user in the admin
example: adduser gbrault
then usermod -aG sudo gbrault
- add an host port 2222 to container 22 in kitematic
open localhost:2222 with winscp or putty
https://github.com/netbeast/docs/wiki/Cross-Compile-Nodejs-for-OpenWrt
@gbrault
gbrault / text2image.html
Created March 20, 2017 17:07
put text into image (to avoid CORS)
<!DOCTYPE html>
<html>
<body>
<canvas id="myCanvas" width="300" height="150" style="border:1px solid #d3d3d3;">
Your browser does not support the HTML5 canvas tag.</canvas>
<script>
var c = document.getElementById("myCanvas");