Skip to content

Instantly share code, notes, and snippets.

View sowbug's full-sized avatar

Mike Tsao sowbug

View GitHub Profile
@sowbug
sowbug / ISO-TKL-Tenkeyless.kbd.json
Last active November 15, 2024 21:55
ISO TKL Tenkeyless
[
{
"name": "ISO TKL Tenkeyless",
"author": "http://www.keyboard-layout-editor.com/#/gists/741ec1a626b0bf0e5df8df2bdc9813d1"
},
[
"Esc",
{
"x": 1
},
@sowbug
sowbug / ISO-105.kbd.json
Last active June 15, 2024 06:32
ISO 105
[
{
"name": "ISO 105",
"author": "http://www.keyboard-layout-editor.com/#/gists/b65198692403cf9752ac7da364cb96c3"
},
[
"Esc",
{
"x": 1
},
@sowbug
sowbug / ANSI-104.kbd.json
Last active March 9, 2020 04:10
ANSI 104
[
{
"name": "ANSI 104",
"author": "http://www.keyboard-layout-editor.com/#/gists/9bf9eea417665d2f24edbab0bb87bb04"
},
[
"Esc",
{
"x": 1
},
@sowbug
sowbug / ANSI-TKL-Tenkeyless.kbd.json
Last active March 9, 2020 04:11
ANSI TKL Tenkeyless
[
{
"name": "ANSI TKL Tenkeyless",
"author": "http://www.keyboard-layout-editor.com/#/gists/3c0d9098a34f1381fb34f21fb115e93a"
},
[
"Esc",
{
"x": 1
},
@sowbug
sowbug / Planck.kbd.json
Last active March 9, 2020 04:11
Planck
[
{
"name": "Planck",
"author": "http://www.keyboard-layout-editor.com/#/gists/0ab43ed5647a133cc5b0415ba9e02665"
},
[
{
"a": 7
},
"Tab",
@sowbug
sowbug / pir_room_light.ino
Created December 25, 2018 06:46
An Arduino sketch to turn an ESP8266 with a PIR sensor into a thing that pings IFTTT when it's time to turn a room light on and off.
// Mostly copied from http://randomnerdtutorials.com
// New stuff is the on/off logic
#include <ESP8266WiFi.h>
const char* ssid = "...";
const char* password = "...";
const char* resource_on = "/trigger/[IFTTT_APPLET_ID_TO_TURN_ON]/with/key/xxxxxxx";
const char* resource_off = "/trigger/[IFTTT_APPLET_ID_TO_TURN_OFF]/with/key/xxxxxxx";
const char* server = "maker.ifttt.com";
#include <BLEAddress.h>
#include <BLEDevice.h>
#include <BLEUtils.h>
#include <BLEScan.h>
#include <BLEAdvertisedDevice.h>
#include <U8x8lib.h>
int scanTime = 15;
// https://thejeshgn.com/2017/06/20/reverse-engineering-itag-bluetooth-low-energy-button/
import binascii
from bluepy import btle
from bluepy.btle import DefaultDelegate
class MyDelegate(btle.DefaultDelegate):
def __init__(self, params):
btle.DefaultDelegate.__init__(self)
def handleNotification(self, cHandle, data):
print "SOMETHING HAPPENED %s" % (binascii.hexlify(data))
# First, go get the stock firmware from the [TP-Link site](https://static.tp-link.com/2018/201803/20180316/Archer%20C9(US)_V3_171215.zip).
# Then unzip it and cd into the resulting directory.
$ ls -l
total 14956
-rw-r--r-- 1 miket miket 14820016 Dec 15 2017 c9v4_eu-us-ca_up_1-3-1-20171215rel35219.bin
-rw-r--r-- 1 miket miket 112046 Sep 14 2015 'GPL License Terms.pdf'
-rw-r--r-- 1 miket miket 373590 Oct 14 2016 'How to upgrade TP-LINK Wireless AC Router.pdf'
$ binwalk c9v4_eu-us-ca_up_1-3-1-20171215rel35219.bin
#include <ESP8266WiFi.h>
#include <WEMOS_SHT3X.h>
#include "Adafruit_MQTT.h"
#include "Adafruit_MQTT_Client.h"
/************************* WiFi Access Point *********************************/
#define WLAN_SSID "my-ssid"
#define WLAN_PASS "my-wifi-password"