Skip to content

Instantly share code, notes, and snippets.

View IaroslavR's full-sized avatar

Iaroslav Russkykh IaroslavR

View GitHub Profile
@IaroslavR
IaroslavR / Comparison Espressif ESP MCUs.md
Created December 5, 2022 18:45 — forked from fabianoriccardi/Comparison Espressif ESP MCUs.md
Comparison table for ESP8266/ESP32/ESP32-S2/ESP32-S3/ESP32-C3/ESP32-C6

Comparison table for ESP8266/ESP32/ESP32-S2/ESP32-S3/ESP32-C3/ESP32-C6

A minimal table to compare the Espressif's MCU families.

ESP8266 ESP32 ESP32-S2 ESP32-S3 ESP32-C3 ESP32-C6
Announcement Date 2014, August 2016, September 2019, September 2020, December
@IaroslavR
IaroslavR / snippet.sh
Created October 20, 2022 18:03
Caps Lock off from concole
# https://askubuntu.com/a/607915
sudo apt-get install xdotool
xdotool key Caps_Lock
@IaroslavR
IaroslavR / convert.sh
Created August 18, 2022 11:32
YAML to hcl converter
# src - https://t.me/terraform_ru/52974
echo 'yamldecode(file("filename.yaml"))' | terraform console
@IaroslavR
IaroslavR / pyenv.md
Created August 4, 2022 20:09
No patch version HOW-TO

src - pyenv/pyenv#1946 (comment)

pyenv install 3.7:latest
ln -rs ~/.pyenv/versions/3.7.12 ~/.pyenv/versions/3.7
pyenv local 3.7
python --version
--> Python 3.7.12
@IaroslavR
IaroslavR / timeout.py
Created July 28, 2022 12:43
Ultimate timeout wrapper
from functools import wraps
import errno
import os
import signal
class TimeoutError(Exception):
pass
def timeout(seconds=30, error_message=os.strerror(errno.ETIMEDOUT)):
@IaroslavR
IaroslavR / db.md
Last active July 29, 2022 16:16
Remote PostgreSQL database without public access connection and maintenance

Connect

DBHOST value must be localhost if db server deployed on HOST or RDS instance hostname if you need to use bastion(HOST) to assess db server deployed in the private subnet.

SOCKET_PATH=/tmp/%r@%h-%p
USER=<ssh user>
HOST=<host to connect>
DBHOST=<db host>
export PGPORT=
@IaroslavR
IaroslavR / cherry-pick.sh
Created July 6, 2022 20:10
cherry-pick commit from a different repo
# based on https://stackoverflow.com/q/5120038/4249707
# local source
SRC=../<repo>/.git
COMMIT=<hash>
git --git-dir=${SRC} format-patch -k -1 --stdout ${COMMIT} | git am -3 -k
# remote source
REMOTE=git@github.com:<user>/<repo>.git
NAME=commit-source

Keybase proof

I hereby claim:

  • I am iaroslavr on github.
  • I am iaro (https://keybase.io/iaro) on keybase.
  • I have a public key ASDG8Z6_Nx-n0Fid9qCMmlQ6HAddpOU7OQwwYOVZlld-rwo

To claim this, I am signing this object:

@IaroslavR
IaroslavR / README.md
Created December 21, 2019 13:11 — forked from M0r13n/README.md
Logging with Loguru in Flask

This is a simple example of how to use loguru in your flask application

Just create a new InterceptHandler and add it to your app. Different settings should be configured in your config file, so that it is easy to change settings.

Logging is then as easy as:

from loguru import logger

logger.info("I am logging from loguru!")

@IaroslavR
IaroslavR / compile-ffmpeg-nvenc.sh
Created November 5, 2018 04:17
This bash script will compile a static Ffmpeg build with NVENC and VAAPI hardware-accelerated support on Ubuntu in your home directory. You can modify the script to customize the build options as you see fit.
#!/bin/bash
#This script will compile and install a static ffmpeg build with support for nvenc un ubuntu.
#See the prefix path and compile options if edits are needed to suit your needs.
#install required things from apt
installLibs(){
echo "Installing prerequisites"
sudo apt-get update
sudo apt-get -y --force-yes install autoconf automake build-essential libass-dev libfreetype6-dev libgpac-dev \