Skip to content

Instantly share code, notes, and snippets.

#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);
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='...',
#include <esp32cam.h>
#include "FS.h"
#include "SD_MMC.h"
#include "WiFi.h"
// Current image number (per folder)
uint32_t image;
// Current folder number
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 January 4, 2020 00:33
Makes it easier to customize the LoRa parameters for RadioHead with RFM95 modules
// 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 August 19, 2019 15:54
Example of using the ipv4scan Scanner from Go code
package main
import (
"fmt"
"log"
"github.com/wybiral/ipv4scan/pkg/scan"
)
func main() {
@wybiral
wybiral / webthings-test.js
Created August 16, 2019 00:21
Testing the WebThings API with Espruino
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 July 29, 2019 19:51
Demonstrate using tshare package for distributing a secret key using (2,3) XOR secret sharing algorithm.
package main
import (
"crypto/rand"
"fmt"
"log"
"github.com/wybiral/tshare"
"golang.org/x/crypto/nacl/secretbox"
)
www.amazon.com
\r\n: 200
\n\r: *
\n: 200
\r: *
www.bing.com
\r\n: 200
\n\r: *
\n: 200
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'))