Skip to content

Instantly share code, notes, and snippets.

View v-fox's full-sized avatar

Sergey Kondakov v-fox

  • Russian Federation, Permskiy Kray
View GitHub Profile
@v-fox
v-fox / NVMe_tweaks.md
Last active May 4, 2024 15:52
Linux kernel optimizations for NVMe

By default Linux distros are unoptimized in terms of I/O latency. So, here are some tips to improve that.

The performance can be checked by:

  • fio --name=read --readonly --rw={read/randread} --ioengine=libaio --iodepth={jobs_per_each_worker's_command} --bs={4k/2M} --direct={0/1} --numjobs=<number_of_parallel_workers> --runtime={10/30/60} --group_reporting --filename=/dev/nvme<device> - to simulate an optimized app;
  • dd_rescue /dev/nvme<device> /dev/null -b {4k/2M} {-d} - to simulate a stupid app.

Appropriate settings are changed in appropriate places, such as:

  • /etc/tuned/<custom-profile>/tuned.conf:
@v-fox
v-fox / motioninterpolation.vpy
Last active September 19, 2023 00:48 — forked from phiresky/motioninterpolation.vpy
On-CPU motion interpolation for ≤480@144, ~720@120, ≥1080p@60 playback in mpv
#!/usr/bin/python
# vim: set ft=python:
# see the README at https://gist.github.com/v-fox/43c287426c366679afc4c65eece60cbc
# source: https://github.com/mpv-player/mpv/issues/2149
# source: https://github.com/mpv-player/mpv/issues/566
# source: https://github.com/haasn/gentoo-conf/blob/nanodesu/home/nand/.mpv/filters/mvtools.vpy
import vapoursynth as vs
import functools
@v-fox
v-fox / .zshrc
Created December 23, 2016 11:05
fancy prompt for zshrc
export BLACK="%{"$'\033[01;30m'"%}"
export GREEN="%{"$'\033[01;32m'"%}"
export RED="%{"$'\033[01;31m'"%}"
export YELLOW="%{"$'\033[01;33m'"%}"
export BLUE="%{"$'\033[01;34m'"%}"
export BOLD="%{"$'\033[01;39m'"%}"
export NORM="%{"$'\033[00m'"%}"
if [ "`id -u`" = "0" ]; then
PROMPT="@${RED}%M${NORM} (${YELLOW}%D - %*${NORM}) [ ${BLUE}%~${NORM} ] ${RED}##${NORM} ";