Skip to content

Instantly share code, notes, and snippets.

View DmitryMyadzelets's full-sized avatar

Dmitry Myadzelets DmitryMyadzelets

View GitHub Profile
@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
@DmitryMyadzelets
DmitryMyadzelets / performance.md
Last active June 16, 2020 11:09
Performance Tests

Performance tests

I compare performance of my devices with common tools.

For the storage and overall cpu-memory-storage performance:

hdparm -tT /dev/sd?

For the memory:

@DmitryMyadzelets
DmitryMyadzelets / wlan0.md
Created September 12, 2019 09:27
How to get back wlan0 name in Debian
@DmitryMyadzelets
DmitryMyadzelets / grab-audio.md
Last active May 14, 2019 10:58
Record audio stream in Linux

Record the current audio stream, and convert to mp3.

parec -d 0 | lame -r -V0 - out.mp3

Split the file based on silence in it. Source.

sox -V3 in.mp3 out_.mp3 silence -l 1 0.5 0.1% 1 2.0 0.1% : newfile : restart
<link href='http://fonts.googleapis.com/css?family=Open+Sans:700' rel='stylesheet' type='text/css'>
<a id="view-code" href="http://codepen.io/virgilpana/pen/wBOBYo" target="_blank">VIEW CODE</a>
<div id="window">
<div id="header">
<div class="circle"></div>
<div class="circle"></div>
<div class="circle"></div>
</div>
@DmitryMyadzelets
DmitryMyadzelets / keyboard-layouts-40.md
Last active November 30, 2020 16:33
Keybord layouts collection

Layouts for 40% keyboards