Skip to content

Instantly share code, notes, and snippets.

/************************************************************************
M5StackFire I2C Scanner
The M5StackFire has a connector for I2C devices.
This program scans the addresses 1-127 continuosly and shows
the devices found on the TFT.
The M5Stack fire has two internal I2C devices at address 0x68 and 0x75.
@tzechienchu
tzechienchu / chat_client.py
Created November 19, 2021 02:53 — forked from leimao/chat_client.py
EdgeDB AsyncIO Tutorial ChatBot: https://youtu.be/SyiTd4rLb2s
from __future__ import annotations
from typing import IO
import asyncio
import sys
import contextlib
import aiofiles.threadpool
from chat_streams import split_lines, write, handle_writes
async def handle_reads(reader: asyncio.StreamReader) -> None:
@tzechienchu
tzechienchu / ESP32_HID.ino
Created July 11, 2019 03:00 — forked from sabas1080/ESP32_HID.ino
Example of HID Keyboard BLE with ESP32
include <BLEDevice.h>
#include <BLEUtils.h>
#include <BLEServer.h>
#include "BLE2902.h"
#include "BLEHIDDevice.h"
#include "HIDTypes.h"
#include "HIDKeyboardTypes.h"
#include <driver/adc.h>
BLEHIDDevice* hid;
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@tzechienchu
tzechienchu / list.md
Created March 29, 2019 09:23 — forked from Terminus-IMRC/list.md
List of my/our *active* projects mainly for Raspberry Pi
@tzechienchu
tzechienchu / mongodb-s3-backup.sh
Created October 16, 2018 04:14 — forked from eladnava/mongodb-s3-backup.sh
Automatically backup a MongoDB database to S3 using mongodump, tar, and awscli (Ubuntu 14.04 LTS)
#!/bin/sh
# Make sure to:
# 1) Name this file `backup.sh` and place it in /home/ubuntu
# 2) Run sudo apt-get install awscli to install the AWSCLI
# 3) Run aws configure (enter s3-authorized IAM user and specify region)
# 4) Fill in DB host + name
# 5) Create S3 bucket for the backups and fill it in below (set a lifecycle rule to expire files older than X days in the bucket)
# 6) Run chmod +x backup.sh
# 7) Test it out via ./backup.sh
@tzechienchu
tzechienchu / Markdown教學.md
Created July 18, 2018 03:44 — forked from christech1117/Markdown教學.md
Markdown教學,每個部分的教學分為兩個區塊,上半部為markdown語法,下半部為顯示結果
@tzechienchu
tzechienchu / mbp2011-disable-amd-gpu.md
Created July 17, 2018 07:55 — forked from blackgate/mbp2011-disable-amd-gpu.md
Macbook Pro 2011 - Disable AMD GPU
@tzechienchu
tzechienchu / DisableAllMethods.js
Created October 26, 2017 02:01 — forked from drmikecrowe/DisableAllMethods.js
Loopback mixin to disable or expose methods
// based on https://github.com/strongloop/loopback/issues/651#issuecomment-259540469
'use strict';
const
relationMethodPrefixes = [
'prototype.__findById__',
'prototype.__destroyById__',
'prototype.__updateById__',
'prototype.__exists__',
@tzechienchu
tzechienchu / readme.md
Created December 29, 2016 07:18 — forked from glennschler/readme.md
AWS Docker VPN

Using AWS Linux setup an L2TP/IPSEC Soft Ether VPN

Consider HVM (SSD) EBS-Backed 64-bit m3.medium

  • us-east-1 => ami-1ecae776

  • Updates and dependencies

sudo yum -y update
sudo yum -y upgrade
sudo yum -y install docker git wget