Skip to content

Instantly share code, notes, and snippets.

Avatar

davy wybiral wybiral

View GitHub Profile
View LoRaEcho.ino
#include <RH_RF95.h>
#define RF95_CS 10
#define RF95_INT 2
#define RF95_RST 9
#define RF95_FREQ 915.0
RH_RF95 rf95(RF95_CS, RF95_INT);
View bern_relief.py
from time import sleep
try:
from twitter import Api
except:
print('Requires python-twitter: pip install python-twitter')
exit(1)
api = Api(
consumer_key='...',
consumer_secret='...',
View CamSD.ino
#include <esp32cam.h>
#include "FS.h"
#include "SD_MMC.h"
#include "WiFi.h"
// Current image number (per folder)
uint32_t image;
// Current folder number
View BernRelief.py
try:
from twitter import Api
except:
print('Requires python-twitter: pip install python-twitter')
exit(1)
api = Api(
consumer_key='...',
consumer_secret='...',
access_token_key='...',
@wybiral
wybiral / custom_rf95.c
Last active Jan 4, 2020
Makes it easier to customize the LoRa parameters for RadioHead with RFM95 modules
View custom_rf95.c
// After calling these methods you can write them
// to the LoRa module using: [RH_RF95 instance].setModemRegisters(&modem)
// Defaults:
// Bw = 125 kHz
// Cr = 4/5
// Sf = 128chips/symbol
// CRC on
RH_RF95::ModemConfig modem = {0x72, 0x74, 0x00};
@wybiral
wybiral / scanner-example.go
Created Aug 19, 2019
Example of using the ipv4scan Scanner from Go code
View scanner-example.go
package main
import (
"fmt"
"log"
"github.com/wybiral/ipv4scan/pkg/scan"
)
func main() {
@wybiral
wybiral / webthings-test.js
Created Aug 16, 2019
Testing the WebThings API with Espruino
View webthings-test.js
const i2c = new I2C();
i2c.setup({sda:B9,scl:B8});
const bme = require("BME680").connectI2C(i2c);
const wifi = require("Wifi");
const thing = {
temperature: 0,
humidity: 0,
gas: 0,
pressure: 0,
description: {
@wybiral
wybiral / tshare_secretbox.go
Created Jul 29, 2019
Demonstrate using tshare package for distributing a secret key using (2,3) XOR secret sharing algorithm.
View tshare_secretbox.go
package main
import (
"crypto/rand"
"fmt"
"log"
"github.com/wybiral/tshare"
"golang.org/x/crypto/nacl/secretbox"
)
View http-newline-scan.txt
www.amazon.com
\r\n: 200
\n\r: *
\n: 200
\r: *
www.bing.com
\r\n: 200
\n\r: *
\n: 200
View httptest.py
from socket import create_connection
from ssl import create_default_context
def run_test(addr, httpversion):
host, port = addr
ctx = create_default_context()
with create_connection(addr) as s:
with ctx.wrap_socket(s, server_hostname=host) as ss:
ss.send(b'GET /robots.txt %s\r\n' % httpversion.encode('utf8'))
ss.send(b'Host: %s\r\n' % host.encode('utf8'))
You can’t perform that action at this time.