Skip to content

Instantly share code, notes, and snippets.

View BillyNate's full-sized avatar

Nate BillyNate

  • The Netherlands
View GitHub Profile
@BillyNate
BillyNate / _esphome-pir-mmwave-test.yaml
Last active March 16, 2024 13:31
ESPHome low energy presence detector
# This is a sample config for ESPHome for making a low-energy presense detector on an ESP SoC with a PIR motion sensor (HC-SR501, AM312, etc) and a mmWave sensor (HLK-LD2410)
# The ESP is put into deep-sleep when the mmWave sensor detects no presence. Once the PIR sensor detects motion the ESP gets a signal to wake up.
# The LD2410 is powered on/off over a mosfet by the ESP via a GPIO pin.
# When the ESP is awake an LED will be turned on. If you're using an ESP dev board, there's probably already an LED available, just make sure the correct pin is set in this config.
esphome:
name: esphome-pir-mmwave-sensor
on_boot:
then:
- output.turn_on: ld2410_gpio_output

Setup with TinyCore Linux (RAM only OS) on Raspberry Pi Zero W on Windows

These are the steps taken to setup piCore 14 on a Raspberry Pi with only Wi-Fi (no ethernet)
Newer version might work as well (or maybe even better), but have not been tested.

Set up piCore

  1. Download the piCore image
  2. Unpack the .zip file and write the .img file to the SD-Card (using Raspberry Pi Imager for example)
  3. Move the SD-Card to the Pi, plug in a keyboard and a screen, plug in the power source
  4. Execute backup shell command after the first boot to save generated unique SSH keys which will be used during next boots.
@BillyNate
BillyNate / dirk-api.md
Last active January 18, 2023 20:39
Dirk (van den Broek) app API

This is an overview of discoveries surrounding the Dirk app for Android & iOS.
Calls are made to app-api.dirk.nl over https. It looks like this is version 2 of the API since first segment of the path is /v2.
Funny enough a lot of the assets are loaded from app.dekamarkt.nl.

Two custom headers are send with each request to app-api.dirk.nl: x-api-id and x-api-key. The user-agent header is usually okhttp/4.9.1.

Stores

A list of stores can be requested from /stores, the parameter formulaId filters out stores: 1 is Dekamarkt and 2 is Dirk.
The response will be a json array of objects. Each object represents a store containing:

  • storeId: a unique string of digits
@BillyNate
BillyNate / Pi running Home Assistant in RAM.md
Last active April 8, 2024 22:39
Home Assistant setup on Raspberry Pi with TinyCore Linux (RAM only OS)

Home Assistant setup on Raspberry Pi with TinyCore Linux (RAM only OS)

These are the steps taken to have Home Assistant 2024.2 on piCore 14
Newer version might work as well (or maybe even better), but have not been tested.

Set up piCore

  1. Download the piCore image
  2. Unpack the .zip file and write the .img file to the SD-Card (using USB Image Tool for example)
  3. Move the SD-Card to the Pi, plug the Pi into the network and plug in the power source
  4. SSH into the Pi (using Putty for example)
@BillyNate
BillyNate / Pi running MPD in RAM.md
Last active February 26, 2024 20:02
Multiroom music setup on Raspberry Pi with TinyCore Linux (just RAM)

Multiroom music setup on Raspberry Pi with TinyCore Linux (RAM only OS)

These are the steps taken to have MPD on piCore 14
Newer version might work as well (or maybe even better), but have not been tested.

Set up piCore

  1. Download the piCore image
  2. Unpack the .zip file and write the .img file to the SD-Card (using USB Image Tool for example)
  3. Move the SD-Card to the Pi, plug the Pi into the network and plug in the power source
  4. SSH into the Pi (using Putty for example)
@BillyNate
BillyNate / .travis.yml
Last active June 2, 2021 18:36
Simple Flutter iOS app testing using Travis and Appatize
os: osx
name: iOS
osx_image: xcode12.5
install:
- git clone https://github.com/flutter/flutter.git -b stable
- export PATH=$PWD/flutter/bin:$PWD/flutter/bin/cache/dart-sdk/bin/:$PATH
- flutter doctor
- gem install fastlane
script:
- flutter build ios --build-number $TRAVIS_BUILD_NUMBER --debug --no-codesign
@BillyNate
BillyNate / remove extension from tiny core.md
Created April 14, 2019 14:02
Remove extension from Tiny Core
  1. Build the audit db: tce-audit builddb
  2. Issue delete command: tce-audit delete extensionname
@BillyNate
BillyNate / set hostname in tinycore.md
Last active November 13, 2022 08:11
Set hostname in Tiny Core Linux
  1. In /opt/bootsync.sh replace the line sethostname= with the preferred host name preferred
  2. Save changes: filetool.sh -b
@BillyNate
BillyNate / Pi running Sonarr, Radarr and Lidarr on piCore.md
Last active September 20, 2020 09:26
Pi running Sonarr, Radarr & Lidarr in RAM (on piCore)

Pi running Sonarr, Radarr & Lidarr in RAM (on piCore)

These are the steps taken to have Sonarr, Radarr & Lidarr on piCore 9.0.3 running Mono 4.4.2
Newer version might work as well (or maybe even better), but have not been tested.

Set up piCore

  1. Download the piCore image
  2. Unpack the .zip file and write the .img file to the SD-Card (using USB Image Tool for example)
  3. Move the SD-Card to the Pi, plug the Pi into the network and plug in the power source
  4. SSH into the Pi (using Putty for example)
@BillyNate
BillyNate / git-user-auto-check.md
Last active July 23, 2021 09:19
Per git repository name/email config
  1. Make sure your git-templates directory is correctly set: git config --global init.templatedir "~/.git-templates"
  2. Create a .git-templates directory in your user directory (C:\Users\username on Windows)
  3. Add a subdirectory hooks
  4. Download the pre-commit file to the created directory

On every git init and git commit the hooks will be copied over to the new repository.
Whenever a git commit is issued, the pre-commit hook will check if the user.name and user.email are set, if not, it will ask for input.