Skip to content

Instantly share code, notes, and snippets.

View denji's full-sized avatar
🇺🇦

Denis Denisov denji

🇺🇦
View GitHub Profile
@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))
@denji
denji / colorfilters.txt
Created February 28, 2019 08:29
Wireshark troubleshooting colorfilters
@T-Small Window Sizes (<1320)@tcp.window_size < 1320 && tcp.window_size > 0@[65535,42405,0][0,0,0]
@T-Large Time Delay (>2 seconds)@frame.time_delta_displayed > 2.0@[65535,42405,0][0,0,0]
@T-DNS Error Responses@!dns.flags.rcode == 0 && dns.flags.response == 1@[42662,29041,4112][0,0,0]
@T-HTTP Error Response (>399)@http.response.code > 399@[65535,42405,0][0,0,0]
!@N-Window Update@expert.message == "Window update"@[0,25700,0][65535,65535,65535]
@I-SYN Packet@tcp.flags.syn == 1@[51657,2313,2313][65535,65535,65535]
@N-TCP Header > 20@tcp.hdr_len > 20@[0,25700,0][65535,65535,65535]
@denji
denji / NGINX-HTTP-Request-Stages.md
Last active March 12, 2024 08:31
NGINX HTTP Request Stages

NGINX actual HTTP Request processing flow is divided into 11 stages.

The reason for this division is to perform logical subdivision request to the module as a processing unit, the various stages can contain any number of HTTP modules and pipelined manner request.

The advantage of this is to make the process more flexible, reducing the degree of coupling.

These 11 HTTP stages are as follows:

  1. NGX_HTTP_POST_READ_PHASE ― The phase of the read request;