Skip to content

Instantly share code, notes, and snippets.

@micw
micw / LinageOS on Samsgung Galaxy S5e from scratch.md
Last active April 15, 2024 10:12
LinageOS on Samsgung Galaxy S5e WiFi from scratch from Linux with heimdall
@micw
micw / update_config.py
Last active January 23, 2024 16:59
Python script to replace ${PLACEHOLDER} in config files with content from environment variables
#!/usr/bin/env python
#
# Replaces ${placeholder} in a config file by it's corresponding environment variable.
# Fails if a variable is missing.
#
# The latest version of this script can be found at https://gist.github.com/micw/d7c0e34aee751e81c5aa952b29b8631b
#
import argparse,re
from os import environ
@micw
micw / install_jenkins_plugin.sh
Last active August 11, 2023 06:14
Script to install one or more jenkins plugins including dependencies while jenkins is offline
#!/bin/bash
set -e
if [ $# -eq 0 ]; then
echo "USAGE: $0 plugin1 plugin2 ..."
exit 1
fi
plugin_dir=/var/lib/jenkins/plugins
@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
  • 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 / create docker network
Last active July 3, 2019 05:26
Setup macvlan device to use with docker
docker network create --driver=macvlan --subnet=192.168.1.0/24 --gateway 192.168.1.210 -o parent=eno1 -o macvlan_mode=bridge macvlan0