Skip to content

Instantly share code, notes, and snippets.

@micw
micw / code.md
Last active September 3, 2024 12:02
C++ Public/Private API separation

api.h

class PubApi {
  public:
    virtual void doSomething() = 0;
    static PubApi* Instance;
}
@micw
micw / LinageOS on Samsgung Galaxy S5e from scratch.md
Last active November 8, 2024 07:08
LinageOS on Samsgung Galaxy S5e WiFi from scratch from Linux with heimdall
  • Ensure that mailu runs on mysql as DB for easier SQL migrations
  • Create temporary tables with the correct structure for mailu (remove where filter like domain_id=4 or email like "%@mydomain.com" to dump all domains)
CREATE TABLE mailu_domain
select
    cast(now() as date) as created_at,
    null as updated_at,
    'ispconfig_import' as comment,
    domain as name,
Setting up pacman
gpg: /etc/pacman.d/gnupg/trustdb.gpg: trustdb created
gpg: no ultimately trusted keys found
gpg: starting migration from earlier GnuPG versions
gpg: porting secret keys from '/etc/pacman.d/gnupg/secring.gpg' to gpg-agent
gpg: migration succeeded
gpg: Generating pacman keyring master key...
gpg: key 23A3588614ECF09B marked as ultimately trusted
gpg: directory '/etc/pacman.d/gnupg/openpgp-revocs.d' created
gpg: revocation certificate stored as '/etc/pacman.d/gnupg/openpgp-revocs.d/EF87C38EA3C6A657AF54A36323A3588614ECF09B.rev'
esphome:
name: badlichttest
platform: ESP8266
board: d1_mini
wifi:
ssid: "wiot"
password: "****"
domain: .wyraz.de
@micw
micw / esphome_get_camera_image.py
Created February 6, 2020 19:24
Getting camera images from esp32cam with esphome and python
#!/usr/bin/env python3
import aioesphomeapi
import asyncio
async def main():
loop = asyncio.get_running_loop()
cli = aioesphomeapi.APIClient(loop, "HOST-OR-IP", 6053, "API-PASSWORD-OR_EMPTY")
await cli.connect(login=True)
@micw
micw / w132.ino
Last active January 4, 2022 16:58
Ventus W132 decoder sketch
/**
* Ein ESP8622 NodeMCU Develompent Board, welches Sensorwerte via MQTT verschickt
* http://frightanic.com/iot/comparison-of-esp8266-nodemcu-development-boards/
*
* Umbau eines W132 Windsensors von ELV
*
* - Abtrennen des 433 MHZ-Senders, welcher mit 3 Leitungen (Schwarz, Rot, Blau) an der Logik-Platine angeschlossen ist
* - Anschließen des ESP-8266
* - Schwarz -> GND
* - Rot -> 3.3V
@micw
micw / README.md
Last active February 28, 2019 11:02
How to build helm from source on docker

How to build helm from sources without installing golang and other stuff to your system?

  1. Checkout helm git clone https://github.com/helm/helm.git

  2. Build golang binaries it on docker

cd helm
docker run -it -v $(pwd):/go/src/k8s.io/helm golang
apt-get update
/**
* LED PWM mit HomeWizard Funkschalter
* D3 - input - 433 MHZ Transmitter
* D7 - output Mosfet (led)
*/
#include <smartio.h>
#include <smartio_homewizard.h>
Bus bus;