Skip to content

Instantly share code, notes, and snippets.

#! /bin/bash -x
#
# environment variables affecting the build:
#
# keep_toolchain=y -- don't rebuild the toolchain, but rebuild everything else
# keep_rootfs=y -- don't reconfigure or rebuild rootfs from scratch. Would still apply overlay changes
# keep_buildroot=y -- don't redownload the buildroot, only git pull any updates into it
# keep_bootloader=y -- don't redownload the bootloader, only rebuild it
# keep_etc=y -- don't overwrite the /etc partition
@asupawat
asupawat / post_data_2_google_spreadsheet.md
Created July 15, 2023 16:56 — forked from Lukas238/post_data_2_google_spreadsheet.md
Google Spreadsheet Script to handle and save POST data

Google Spreadsheet Script to handle and save POST data

//  1. Enter sheet name where data is to be written below
var SHEET_NAME = "Data";
         
//  2. Run > setup
//
//  3. Publish > Deploy as web app 
//    - enter Project Version name and click 'Save New Version' 
@asupawat
asupawat / Instructions
Created January 19, 2023 03:40 — forked from benscabbia/Instructions
Cloudflare + Dynamic DNS (ddclient) = Super Awesome
# This guide will show you how to configure ddclient to dynamically update your DNS at Cloudflare.
# This cookbook makes use of a number of online guides - all of which I will reference at the end.
# Cloudflare requires ddclient to be version 3.8.2 or you will get a 'cloudflare protocol didn't exist'.
# Unfortunately, the package manager at this time makes use of 3.8.1
# My suggestion is to follow the semi-autonomous process, by downloading the out of date package
# and then manually update a few files. If you prefer, you can go down the fully manual route manual route.
# Installation - Manual (Not Tested: https://www.cloudflare.com/technical-resources/#ddclient)
# Installation - Semi-Autonomous (Recommended, follow below)
@asupawat
asupawat / rtc-i2c
Created July 9, 2022 14:37 — forked from h0tw1r3/rtc-i2c
Initializing I2C RTC (DS3231) on Raspberry PI bootup with Systemd without recompiling the kernel or devicetree support.
# /etc/conf.d/rtc-i2c
#
# My chip is actually a ds3231n, but ds1307 driver works fine (ds3232 does not!)
#
CHIP="ds1307"
ADDRESS="0x68"
BUS="1"
@asupawat
asupawat / app_mqtt_mysql_completed.js
Created October 5, 2021 14:51 — forked from smching/app_mqtt_mysql_completed.js
Node.js application: Store messages from Mosquitto MQTT broker into SQL Database (completed)
var mqtt = require('mqtt'); //https://www.npmjs.com/package/mqtt
var Topic = '#'; //subscribe to all topics
var Broker_URL = 'mqtt://192.168.1.123';
var Database_URL = '192.168.1.123';
var options = {
clientId: 'MyMQTT',
port: 1883,
//username: 'mqtt_user',
//password: 'mqtt_password',
@asupawat
asupawat / B5-demo.js
Created September 14, 2021 05:16 — forked from fanoush/B5-demo.js
Espruino demo code for SMA B5 smart band with GPS
E.kickWatchdog();
function KickWd(){
if( (typeof(BTN1)=='undefined')||(!BTN1.read()) ) E.kickWatchdog();
}
var wdint=setInterval(KickWd,2000);
E.enableWatchdog(15, false);
// MIT License (c) 2020 fanoush https://github.com/fanoush
// see full license text at https://choosealicense.com/licenses/mit/
// SPI display driver below compiled with options LCD_BPP=12
@asupawat
asupawat / access-pi-anywhere.md
Created July 8, 2021 07:30 — forked from jc-torresp/access-pi-anywhere.md
Configuration to access Raspberry Pi from anywhere with UPnP port forwarding

Access Raspberry Pi from anywhere

Dynamic DNS

We need to use so called Dynamic DNS (DDNS) to create and dynamically update a mapping between a chosen domain name and an “external” IP address of our Raspberry Pi (i.e. router IP address).

  • Look for a DDNS provider.
  • Register a new user account.
  • Choose a desire domain name.
  • Configure it on router.
@asupawat
asupawat / install_multithreaded_chiapos.sh
Created May 30, 2021 17:22 — forked from SippieCup/install_multithreaded_chiapos.sh
Safe way to install the multithreaded chiapos libary and rebuild chia-blockchain binaries
#!/bin/bash
# Note:
# I have not actually tested this installing into the
# chia-blockchain `install.sh` venv as I did not use it
# when I installed chia. I have only tested it in a
# test venv. YMMV!
if [ $# -eq 0 ]
then

Keybase proof

I hereby claim:

  • I am asupawat on github.
  • I am xnoom (https://keybase.io/xnoom) on keybase.
  • I have a public key ASACXupGcX1ZOo6NoG3ddzzo0NxCx9aoSVyFXzoXZvOWMQo

To claim this, I am signing this object:

@asupawat
asupawat / a_raspberry-pi4-cmio-ov9281-dual.md
Created April 2, 2021 00:48 — forked from kralo/a_raspberry-pi4-cmio-ov9281-dual.md
Raspberry Pi 4 CMIO with 2 ov9281 camera sensors

Raspberry Pi 4 CMIO with 2 ov9281 camera sensors

Tested with 2 Arducam "UC-599" and 2 Inno-maker "cam-mipiov9281"

Credits to 6by9 on the raspberrypi forums.

Howto:

  1. Connect the jumpers on the J6
  2. Download the *.dtbo file to /boot/overlays/
  3. Add the line to /boot/config.txt: