Skip to content

Instantly share code, notes, and snippets.

View DmitryMyadzelets's full-sized avatar

Dmitry Myadzelets DmitryMyadzelets

View GitHub Profile

28/10/2024

Buongiorno Vito,

sentito anche Silvio Davolio, aggiungo qualche commento che vorrebbe essere di chiarimento su alcuni punti della tua email. Naturalmente i colleghi dell'ISAC potranno aggiungere o correggere quanto sotto.

I modelli ISAC che citi, MOLOCH in particolare, per l'evento del 19 ottobre sono stati meno "precisi", in termini di quantità di precipitazione prevista,

@DmitryMyadzelets
DmitryMyadzelets / how-to-flash.md
Last active October 11, 2024 06:56
Sonoff Zigbee 3.0 USB Dongle Plus (EFR32MG21) with router firmware

So, I wanted update the Sonoff ZBDongle-E dongle as it's recommended in this post: https://www.zigbee2mqtt.io/devices/ZBDongle-E.html.

The web flasher couldn't connect to the dongle under Windows.

Found how to flash it with a console tool under Linux: https://community.home-assistant.io/t/issue-flashing-sonoff-zbdongle-e/654946/3

> universal-silabs-flasher --device /dev/ttyUSB0 probe
2024-10-10 15:36:45.282 MSI universal_silabs_flasher.flasher INFO Probing ApplicationType.GECKO_BOOTLOADER at 115200 baud
2024-10-10 15:36:47.319 MSI universal_silabs_flasher.flasher INFO Probing ApplicationType.CPC at 460800 baud
@DmitryMyadzelets
DmitryMyadzelets / batch-commands.md
Created September 18, 2024 08:35
Manipulate w lots of files (e.g. images)

Remove every image which name contains 32 symbols after the "-" symbol:

find . -type f | grep -E '*-.{32}.jpg' | xargs rm -f

Convert PNG to JPG:

find . -type f | grep -E '*.png' | xargs -n 1 bash -c 'convert "$0" "${0%.*}.jpg"'
@DmitryMyadzelets
DmitryMyadzelets / strength.md
Last active July 25, 2024 09:33
Strength calculation for PEC

Strength calculation

The calculations are made according to the GOST 34233.2-2017 standard: "Vessels and apparatus. Norms and methods of strength calculation. Calculation of cylindric and conic shells, convex and flat bottoms and covers"

Cylindrical shell

Symbols:

  • $D$ - diameter of the cylinder, mm
  • $s$ - thickness of the cylinder's wall, mm
  • $p$ - overpressure, MPa
  • $\sigma$ - allowable stress in the material, MPa
  • $\psi$ - welding factor (1 if no welding)
@DmitryMyadzelets
DmitryMyadzelets / peltier-stack-configs.md
Created July 19, 2024 09:20
Configurations of the Peltier cooler for PEC
@DmitryMyadzelets
DmitryMyadzelets / udp-reverse-tunnel.md
Last active March 30, 2023 15:13
UDP Reverse Tunnel - HowTo

UDP Reverse Tunnel

How to send UDP packets from a public host to a private host behind NAT, with no port forwarding.

Install UDP reverse tunnel

https://github.com/prof7bit/udp-reverse-tunnel

Multiple UDP ports

  1. Install with a parameter instead of a fixed port
sudo make install-outside listen=%i
@DmitryMyadzelets
DmitryMyadzelets / rock64-boot.log
Last active November 5, 2021 15:53
Rock64 boot log
DDR version 1.13 20180428
[2021-11-05 16:40:18] ID:0x805 Y
[2021-11-05 16:40:18] In
[2021-11-05 16:40:18] LPDDR3
[2021-11-05 16:40:18] 786MHz
[2021-11-05 16:40:18] Bus Width=32 Col=11 Bank=8 Row=15/15 CS=2 Die Bus-Width=32 Size=4096MB
[2021-11-05 16:40:18] ddrconfig:7
[2021-11-05 16:40:18] OUT
[2021-11-05 16:40:22]
[2021-11-05 16:40:22] U-Boot SPL 2017.09-rockchip-ayufan-1065-g95f6152134 (Aug 26 2019 - 12:40:32)
@DmitryMyadzelets
DmitryMyadzelets / fonts.md
Created October 26, 2021 09:11
Fonts in Linux

Fonts are located in directories /usr/share/fonts/ and ~/.fonts/.

List all fonts, pick the ones for the terminal:

fc-list | sort | grep -i mono

See how a font looks in the current console (use the font name, not the file name):

printf '\e]710;%s\007' "Ubuntu Mono:pixelsize=16"
@DmitryMyadzelets
DmitryMyadzelets / ramda.js
Created February 5, 2021 08:59
How to use async/await with map and Promise.all
// Example from https://dev.to/jamesliudotcc/how-to-use-async-await-with-map-and-promise-all-1gb5
// the goodies
const callMethod = (methodName, ...params) => obj => obj[methodName](...params)
const awaitAll = promiseArray => Promise.all(promiseArray)
const prop = propName => obj => obj[propName]
const map = func => arr => arr.map(func)
const pipe = (...functions) => functions.reduce((compound, func) => (input => func(compound(input))))
const download = url => fetch(url).then(callMethod("json"))
@DmitryMyadzelets
DmitryMyadzelets / hera.js
Created November 13, 2020 10:38
Extract data from HERA's web site
// Extract price and data from your bills from HERA at https://servizionline.gruppohera.it
// Run it in the console on a web page with the list of bills.
// Created: 13/11/2020
// Author: Dmitry Myadzelets
//
(function bollette () {
const number = /[-]{0,1}[\d]+/g
const row2object = tr => ({
euro: Number(tr.querySelector('.importo').querySelector('span').innerText.match(number).join('.')),
date: tr.querySelector('.emessa').querySelector('span').innerText