Skip to content

Instantly share code, notes, and snippets.

View sergey-dryabzhinsky's full-sized avatar
🤖
Serious illness

Sergey Dryabzhinsky sergey-dryabzhinsky

🤖
Serious illness
View GitHub Profile
@sergey-dryabzhinsky
sergey-dryabzhinsky / Redis-8.4.0-Disable-avx512.patch
Last active November 30, 2025 11:39
Completely disable use of avx512 to not confuse older binutils << 2.28
--- redis84-8.4.0.orig/src/config.h
+++ redis84-8.4.0/src/config.h
@@ -357,7 +357,7 @@ void setcpuaffinity(const char *cpulist)
/* Check if we can compile AVX512 code */
#if defined (__x86_64__) && ((defined(__GNUC__) && __GNUC__ >= 5) || (defined(__clang__) && __clang_major__ >= 4))
#if defined(__has_attribute) && __has_attribute(target)
-#define HAVE_AVX512
+#define HAVE_AVX512_
#define ATTRIBUTE_TARGET_AVX512_POPCOUNT __attribute__((target("avx512f,avx512vpopcntdq")))
#endif
@sergey-dryabzhinsky
sergey-dryabzhinsky / Redis-8.4.0-do-not-use-avx512.patch
Created November 30, 2025 11:32
Disable use of avx512 instructions that may confuse older binutils << 2.28
--- redis84-8.4.0.orig/src/bitops.c
+++ redis84-8.4.0/src/bitops.c
@@ -36,11 +36,17 @@
#endif
/* AArch64 NEON support is determined at compile time via HAVE_AARCH64_NEON */
+#ifdef USE_AVX512
+#pragma message("Use of AVX512 enabled.")
#ifdef HAVE_AVX512
#define BITOP_USE_AVX512 (__builtin_cpu_supports("avx512f") && __builtin_cpu_supports("avx512vpopcntdq"))
@sergey-dryabzhinsky
sergey-dryabzhinsky / pve-5.1-add-ubuntu-bionic.patch
Last active November 17, 2017 12:14
Fix restore / create LXC container with Ubuntu Bionic 18.04 - for Proxmox 5.1
--- /usr/share/perl5/PVE/LXC/Setup/Ubuntu.pm.orig 2017-11-01 03:04:00.000000000 +0300
+++ /usr/share/perl5/PVE/LXC/Setup/Ubuntu.pm 2017-11-09 21:30:14.710183003 +0300
@@ -12,6 +12,7 @@
use base qw(PVE::LXC::Setup::Debian);
my $known_versions = {
+ '18.04' => 1, # bionic LTS
'17.10' => 1, # artful
'17.04' => 1, # zesty
'16.10' => 1, # yakkety
@sergey-dryabzhinsky
sergey-dryabzhinsky / pve-5.0-return-ubuntu-lucid.patch
Created September 17, 2017 07:24
Fix restore / create LXC container with Ubuntu Lucid 10.04 - for Proxmox 5.0
--- /usr/share/perl5/PVE/LXC/Setup/Ubuntu.pm.orig 2017-09-12 14:48:50.000000000 +0300
+++ /usr/share/perl5/PVE/LXC/Setup/Ubuntu.pm 2017-09-17 10:14:06.284276148 +0300
@@ -20,6 +20,7 @@
'15.04' => 1, # vivid
'14.04' => 1, # trusty LTS
'12.04' => 1, # precise LTS
+ '10.04' => 1, # lucid LTS
};
sub new {
@sergey-dryabzhinsky
sergey-dryabzhinsky / phpmyadmin-4.0.10.20-fix-export-fatal-error.patch
Created May 21, 2017 10:18
Fix php fatal error then export SQL into file via phpMyAdmin 4.0.10.20
Index: php-mysql-admin-4.0-4.0.10.20/src/export.php
===================================================================
--- php-mysql-admin-4.0-4.0.10.20.orig/src/export.php 2017-05-19 14:09:51.805261707 +0300
+++ php-mysql-admin-4.0-4.0.10.20/src/export.php 2017-05-19 14:10:42.437676490 +0300
@@ -861,7 +861,7 @@
'triggers', $export_type,
$do_relation, $do_comments, $do_mime, $do_dates
)) {
- break 2;
+ break;
@sergey-dryabzhinsky
sergey-dryabzhinsky / sysctl-proxmox-tune.conf
Last active October 18, 2025 09:03
Most popular speedup sysctl options for Proxmox. Put in /etc/sysctl.d/
###
# Proxmox or other server kernel params cheap tune and secure.
# Try it if you have heavy load on server - network or memory / disk.
# No harm assumed but keep your eyes open.
#
# @updated: 2020-02-06 - more params used, adjust some params values, more comments on params
#
### NETWORK ###
@sergey-dryabzhinsky
sergey-dryabzhinsky / nginx-1.12_send_minimum_rate.patch
Created April 15, 2017 01:44
Patch for nginx originaly by cloudflare. Read https://habrahabr.ru/post/282465/ , Ported to nginx-1.12.
Index: nginx-1.12.0/src/core/ngx_connection.c
===================================================================
--- nginx-1.12.0.orig/src/core/ngx_connection.c 2017-04-15 04:39:30.043542084 +0300
+++ nginx-1.12.0/src/core/ngx_connection.c 2017-04-15 04:39:29.885545744 +0300
@@ -1402,3 +1402,60 @@
return NGX_ERROR;
}
+
+
@sergey-dryabzhinsky
sergey-dryabzhinsky / QemuServer.pm.diff
Last active August 1, 2016 01:39
Fixed ayufan proxmox differential backup for QemuServer part of pve-manager-3.4-14
diff --git a/QemuServer.pm b/QemuServer.pm
index 970edb5..9e7b281 100644
--- a/QemuServer.pm
+++ b/QemuServer.pm
@@ -4749,10 +4749,20 @@ sub tar_archive_read_firstfile {
die "ERROR: file '$archive' does not exist\n" if ! -f $archive;
+ my $cmd = undef;
+
@sergey-dryabzhinsky
sergey-dryabzhinsky / VEID.umount
Last active May 27, 2016 07:29
OpenVZ container umount script with space quoting
#!/bin/bash
###
# More advanced on-umount script for OpenVZ container
# Based on https://openvz.org/Bind_mounts
#
# 1. Set quotas off
#
[ -f /etc/vz/vz.conf ] || exit 1
[ -f $VE_CONFFILE ] || exit 1
@sergey-dryabzhinsky
sergey-dryabzhinsky / VEID.mount
Last active May 19, 2016 00:10
OpenVZ container mount script with space quoting
#!/bin/bash
###
# More advanced on-mount script for OpenVZ container
# Based on https://openvz.org/Bind_mounts
#
# 1. Mount some directory inside container
# 2. Set quotas on that directory inside container
#
[ -f /etc/vz/vz.conf ] || exit 1