Skip to content

Instantly share code, notes, and snippets.

View DmitryMyadzelets's full-sized avatar

Dmitry Myadzelets DmitryMyadzelets

View GitHub Profile
@DmitryMyadzelets
DmitryMyadzelets / README.md
Last active November 13, 2023 12:30
Соционика - тест Гуленко

Тест Виктора В. Гуленко на принадлежность к соционическому типу

Задания для теста и ключи к ним найдены в Сети и, возможно, не имеют ничего общего с авторским тестом!

Прилагаемый файл test.json содержит:

  • 72 задания для теста
  • 8 дихотомийных признаков
  • 16 соционических типов
  • 16 названий типов по Аушре А.
  • 16 типов по MBTI
@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 / readme.md
Last active February 3, 2023 19:21
SanDisc Clip Jam MP3 player file ordering for an audiobook

Remove all from the ID3 tag:

for f in *.mp3; do eyeD3 --remove-all "$f"; done

Given file names like name001.mp3, create new ID3 tag, and set the title to the index of the file:

for f in *.mp3; do i=`echo $f | grep -oP '\d\d\d'`; eyeD3 --to-v2.3 -t $i "$f"; done

The above scripts report the error: "No ID3 v1.x/v2.x tag found!". Ignore it.

@DmitryMyadzelets
DmitryMyadzelets / index.html
Created November 20, 2016 14:37
Routing nginx + nodejs\expressjs + socket.io
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Chat</title>
<script src="./socket.io/socket.io.js"></script>
<script type="text/javascript">
@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 / main.c
Last active June 28, 2021 20:18
MSP430 + DHT11/DHT22 sensor
#include <msp430.h>
#include <stdlib.h>
volatile unsigned txdata = 0;
#pragma vector = TIMER0_A0_VECTOR
__interrupt void Timer0_A0(void)
{
if(txdata) {
@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 / keyboard-layouts-40.md
Last active November 30, 2020 16:33
Keybord layouts collection

Layouts for 40% keyboards

@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