Skip to content

Instantly share code, notes, and snippets.

davy wybiral wybiral

Block or report user

Report or block wybiral

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@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'))
View twimages.html
<html>
<head>
<style>
* {
margin: 0;
padding: 0;
}
body {
background: #000;
}
View twelastic.py
from threading import active_count, Thread
from time import sleep, time
try:
from elasticsearch import Elasticsearch
except:
print('Requires elasticsearch: pip install elasticsearch')
exit(1)
try:
View robots.py
from threading import active_count, Thread
from time import sleep, time
try:
from queue import Empty, Queue
except:
print('Requires python3 (stop using python2)')
exit(1)
try:
You can’t perform that action at this time.