Skip to content

Instantly share code, notes, and snippets.

View pavelrevak's full-sized avatar

Pavel Revak pavelrevak

  • Slovakia
View GitHub Profile
@pavelrevak
pavelrevak / boot_ram.py
Created February 8, 2026 13:04
Simple dict based Filesystem for micropython
# boot_ram.py - Dict-based RAM filesystem for MicroPython
# No block device, no FAT - files stored directly in nested dicts
# Copy to device as boot.py or run via exec
import gc
import os
_IFDIR = 0x4000
_IFREG = 0x8000
@pavelrevak
pavelrevak / dyndnsupdate.py
Last active June 9, 2023 12:39
Simple dynamic DNS updater, emulate dyndns and noip server API, call nsupdate, without special dependencies, only dnspython
"""Dynamic DNS updater
"""
import sys
import base64 as _base64
import argparse as _argparse
import json as _json
import logging as _logging
import http.server as _httpserver
# dnspython
@pavelrevak
pavelrevak / sht30.py
Last active November 7, 2022 23:35
Micropython SHT30: reading temperature and humidity
"""Simple module for reading temperature and humidity
from SHT30 sensor for micropython
it is a simplest version only for inspiration,
where is no checking availability of sensor
and no checking CRC of data
for waiting to measured data is used clock stretching
"""
def read(i2c, address=68):
@pavelrevak
pavelrevak / .zshenv
Last active October 8, 2019 19:28
zsh@macos configuration: simple prompt in colors: "user@host time path [git branch] $"
# macports path
if [ -d "/opt/local/bin" ] ; then
PATH="/opt/local/bin:$PATH"
fi
if [ -d "/opt/local/sbin" ] ; then
PATH="/opt/local/sbin:$PATH"
fi
# user path