Skip to content

Instantly share code, notes, and snippets.

View erijpkema's full-sized avatar

Egon Rijpkema erijpkema

  • Rijksuniversiteit Groningen
View GitHub Profile

Keybase proof

I hereby claim:

  • I am erijpkema on github.
  • I am erijpkema (https://keybase.io/erijpkema) on keybase.
  • I have a public key whose fingerprint is CCFE 7867 C637 93AD 89BB C5FC 32B7 C425 B271 45AC

To claim this, I am signing this object:

// ==UserScript==
// @name NRCq toch lezen
// @namespace http://nrcq.nl/
// @version 0.1
// @description haalt overlay weg en voegt scrollbalk toe.
// @author You
// @match http://www.nrcq.nl/*
// @grant none
// ==/UserScript==
@erijpkema
erijpkema / Post.ino
Last active September 4, 2016 18:59
/*
* Sketch for esp8266
* see https://github.com/esp8266/Arduino
* used on a wemos D1
* When button 13 is pressed a post request is made.
* (Button 13 has variable 14)
*/
#include <Arduino.h>
@erijpkema
erijpkema / Lorawan_Temp.ino
Last active February 2, 2017 10:05
Post temperature from a OneWire and voltage from light sensor to the things network
#include "TheThingsUno.h"
#include <OneWire.h>
// Set your AppEUI and AppKey
const byte appEui[8] = //for example: {0x70, 0xB3, 0xD5, 0x7E, 0xE0, 0xE0, 0x01, 0x4A1};
const byte appKey[16] = //for example: {0x73, 0x6D, 0x24, 0xD2, 0x69, 0xBE, 0xE3, 0xAE, 0x0E, 0xCE, 0xF0, 0xBB, 0x6C, 0xA4, 0xBA, 0xFE};
#define debugSerial Serial
#define loraSerial Serial1
@erijpkema
erijpkema / banana2csv.js
Created February 2, 2017 10:19
Crude script to extract ttn data
//Crude script to extract ttn data.
// Run like this:
// docker run -it --rm --name banana2csv -v "$PWD":/usr/src/app -w /usr/src/app node:4-wheezy npm install ttn
// docker run -it --rm --name banana2csv -v "$PWD":/usr/src/app -w /usr/src/app node:4-wheezy node banana2csv.js
var ttn = require('ttn');
var appEUI = '';
var accessKey = '';
var client = new ttn.Client('staging.thethingsnetwork.org', appEUI, accessKey);
var fs = require('fs');
@erijpkema
erijpkema / lifx-flash.ino
Last active September 13, 2021 14:36
ESP8266 flash lifx lights
/* This is made for a ESP8266 (i use a wemos d1). It uses the udp lan protocol to flash the lights.
* This program will let your lifx lamps flash purple seven times when a switch is pressed.
* When it has a wifi connection, a led will go on.
* I started from code by daniel_hall at https://community.lifx.com/t/sending-lan-packet-using-arduino/1460/3
*/
#include <ESP8266WiFi.h>
#include <WiFiUdp.h>
#include <ESP8266WiFiMulti.h>
#include <SPI.h>
// ==UserScript==
// @name accept cookies from nrc.
// @namespace https://www.nrc.nl/
// @version 0.1
// @description Accept cookies
// @author You
// @match https://www.nrc.nl/*
// @grant none
// ==/UserScript==
/*
I use this sketch on an esp8266 with a DHT humidity sensor.
*/
#include "DHT.h"
#include <ESP8266WiFi.h>
#include <PubSubClient.h>
@erijpkema
erijpkema / washingmashine.ino
Last active October 27, 2021 02:24
Washing machine shake sensor MPU-6050 + DHT mqtt home assistant.
#include <DHT.h>
#include <EEPROM.h>
#include <ESP8266WiFi.h>
#include <PubSubClient.h>
#include <Wire.h>
#define DHTPIN 2 // D4 what digital pin we're connected to
#define DHTTYPE DHT11 // DHT 11
#!/usr/bin/env python3
"""
Script to regulate a 5v fan.
For wiring, see https://hackernoon.com/how-to-control-a-fan-to-cool-the-cpu-of-your-raspberrypi-3313b6e7f92c
#Author: Edoardo Paolo Scalafiotti <edoardo849@gmail.com>
# Modified by Egon Rijpkema
"""
import os
from time import sleep