Skip to content

Instantly share code, notes, and snippets.

View DmitryMyadzelets's full-sized avatar

Dmitry Myadzelets DmitryMyadzelets

View GitHub Profile
@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

@DmitryMyadzelets
DmitryMyadzelets / index.js
Last active September 23, 2017 23:15
Combination
const factorial = (n) => n ? n * factorial(n - 1) : 1
// Given n, choose k - [Combination](https://en.wikipedia.org/wiki/Combination)
const C = (n, k) => factorial(n) / (factorial(k) * factorial(n-k))
@DmitryMyadzelets
DmitryMyadzelets / speedtests.md
Last active February 15, 2018 19:02
Networking
curl -s https://raw.githubusercontent.com/sivel/speedtest-cli/master/speedtest.py | python -

Example output:

Retrieving speedtest.net configuration...
Testing from WIND (151.48.54.99)...
Retrieving speedtest.net server list...
Selecting best server based on ping...
@DmitryMyadzelets
DmitryMyadzelets / raspi-monitor
Created June 28, 2017 12:18 — forked from simlun/raspi-monitor
Script to enable and disable the HDMI signal of the Raspberry PI
#!/bin/bash -e
# /usr/local/sbin/raspi-monitor
# Script to enable and disable the HDMI signal of the Raspberry PI
# Inspiration: http://www.raspberrypi.org/forums/viewtopic.php?t=16472&p=176258
CMD="$1"
function on {
/opt/vc/bin/tvservice --preferred
@DmitryMyadzelets
DmitryMyadzelets / ready.js
Created May 30, 2017 14:19
When a web page is ready for manipulation. Altrernative for jQuery ready()
// Invokes callback when DOM is ready for manipulation
// Usage: ready(function () {});
function ready(callback) {
// Motivation:
// https://gomakethings.com/a-native-javascript-equivalent-of-jquerys-ready-method/
// Docs:
// https://developer.mozilla.org/en/docs/Web/API/Document/readyState
var loading, done;
{
"capricorn":"Capricorno",
"aquarius":"Acquario",
"pisces":"Pesci",
"aries":"Ariete",
"taurus":"Toro",
"gemini":"Gemelli",
"cancer":"Cancro",
"leo":"Leone",
"virgo":"Vergine",