Skip to content

Instantly share code, notes, and snippets.

View denji's full-sized avatar
🇺🇦

Denis Denisov denji

🇺🇦
View GitHub Profile
@denji
denji / isolate-cpus.sh
Created July 19, 2022 23:59 — forked from oleduc/isolate-cpus.sh
CPU isolation bash script for KVM QEMU VFIO gpu passthrough for virtual machine performance optimizations using libvirt-hooks and cgroups
#!/bin/bash
# Cores reserved for the host machine
# Must include QEMU IO/Emulation cores if configured
# Ex: 1st Core -> reserved=0
# Ex: 1st & 2nt Cores -> reserved=0,1
# Ex: 1st Physical Core (16 Virtual Cores) -> reserved=0,8
reserved=0,8
# Host core range numbered from 0 to core count - 1
@denji
denji / Windows-qemu-KVM.10.xml
Created July 19, 2022 23:41 — forked from rootfs/Windows-qemu-KVM.10.xml
Windows 10 qemu/kvm optimizations CPU usage #virt-manager
<domain type="kvm">
<!-- https://www.reddit.com/r/VFIO/comments/80p1q7/high_kvmqemu_cpu_utilization_when_windows_10/ -->
<!-- https://github.com/duncanthrax/scream -->
<!-- https://gitlab.com/YuriAlek/vfio -->
<!-- https://github.com/PiMaker/Win10-VFIO -->
<!-- https://gitlab.com/YuriAlek/vfio -->
<!-- https://github.com/sk1080/nvidia-kvm-patcher -->
<!-- https://github.com/T-vK/MobilePassThrough -->
@denji
denji / Arch Secure Laptop Install.md
Created May 2, 2021 00:17 — forked from Th3Whit3Wolf/Arch Secure Laptop Install.md
My install instruction for a secure Arch Linux (sway) laptop workstation

What's Cool

  • Encrypted root partition
    • AES-256 bit cipher
    • Argon2id variant for PBKDF
    • Sha3-512 bit hash
  • rEFInd bootloader
    • With dreary theme
    • Optimal Settings (optimized for aesthetics, and boot time)
  • Boot into backups thanks to refind-btrfs
@denji
denji / windows-keyboard-default-mode.md
Created September 29, 2020 00:21
Keyboard flags and indicators when start Windows 10

HKEY_USERS\.DEFAULT\Control Panel\Keyboard and edit the string value InitialKeyboardIndicators to one of the following values:

InitialKeyboardIndicators bitmask list:

  • 0 — turns off Scroll Lock, Num Lock, Caps Lock (default)
  • 1 — turn on Caps Lock
  • 2 — turn on Num Lock
  • 3 — turn on both Num Lock and Caps Lock
  • 4 — turn on Scroll Lock
  • 5 — turn on both Scroll Lock and Caps Lock
  • 6 — turn on both Scroll Lock and Num Lock
@denji
denji / postgresql90.md
Created August 27, 2020 22:51 — forked from kidpixo/postgresql90.md
PostgreSQL 9.0 cheatsheet from www.postgresonline.com
@denji
denji / TrueColour.md
Created May 3, 2020 23:43 — forked from XVilka/TrueColour.md
True Colour (16 million colours) support in various terminal applications and terminals

Terminal Colors

There exists common confusion about terminal colors. This is what we have right now:

  • Plain ASCII
  • ANSI escape codes: 16 color codes with bold/italic and background
  • 256 color palette: 216 colors + 16 ANSI + 24 gray (colors are 24-bit)
  • 24-bit true color: "888" colors (aka 16 milion)
@denji
denji / TrueColour.md
Created May 3, 2020 23:43 — forked from XVilka/TrueColour.md
True Colour (16 million colours) support in various terminal applications and terminals

Terminal Colors

There exists common confusion about terminal colors. This is what we have right now:

  • Plain ASCII
  • ANSI escape codes: 16 color codes with bold/italic and background
  • 256 color palette: 216 colors + 16 ANSI + 24 gray (colors are 24-bit)
  • 24-bit true color: "888" colors (aka 16 milion)
@denji
denji / http_modules_ngx__http__slice_read_ahead.patch
Created November 4, 2019 07:21
http_modules_ngx__http__slice_read_ahead.c The existing slice module (https://nginx.org/en/docs/http/ngx_http_slice_module.html) only starts fetching a given slice whenever bytes in that range for that slice is requested. The patch allows you to configure a variable (slice_read_ahead X) which will cause nginx to start proactively reading X futur…
Index: Makefile
===================================================================
--- Makefile (revision 507358)
+++ Makefile (revision 507359)
@@ -74,7 +74,7 @@
HTTP_CACHE HTTP_DAV HTTP_FLV HTTP_GUNZIP_FILTER HTTP_GZIP_STATIC \
HTTP_IMAGE_FILTER HTTP_MP4 HTTP_PERL HTTP_RANDOM_INDEX HTTP_REALIP \
HTTP_REWRITE HTTP_SECURE_LINK HTTP_SLICE HTTP_SSL HTTP_STATUS HTTP_SUB \
- HTTP_XSLT HTTPV2 STREAM STREAM_SSL STREAM_SSL_PREREAD
+ HTTP_XSLT HTTPV2 STREAM STREAM_SSL STREAM_SSL_PREREAD HTTP_SLICE_AHEAD
@denji
denji / Shadowsocks_With_V2Ray.md
Created May 9, 2019 14:57
Install Shadowsocks With V2Ray Manually

Installing Packages

sudo apt-get update && sudo apt-get upgrade -y && sudo apt-get dist-upgrade -y && sudo apt-get autoremove -y && sudo apt-get clean && sudo apt-get install build-essential haveged -y
sudo apt-get install linux-headers-$(uname -r)
sudo apt-get install shadowsocks-libev -y
sudo apt-get install cron -y
sudo apt-get install screen -y

Install V2Ray

-- Query the database to calculate a recommended innodb_buffer_pool_size
-- and get the currently configured value
-- The rollup as the bottom row gives the total for all DBs on the server, where each other row is recommendations per DB.
SELECT
TABLE_SCHEMA,
CONCAT(CEILING(RIBPS/POWER(1024,pw)),SUBSTR(' KMGT',pw+1,1))
Recommended_InnoDB_Buffer_Pool_Size,
(
SELECT CONCAT(CEILING(variable_value/POWER(1024,FLOOR(LOG(variable_value)/LOG(1024)))),SUBSTR(' KMGT',FLOOR(LOG(variable_value)/LOG(1024))+1,1))