Skip to content

Instantly share code, notes, and snippets.

View sergey-dryabzhinsky's full-sized avatar

Sergey Dryabzhinsky sergey-dryabzhinsky

View GitHub Profile
$ cat ../../fse_crash.bin | ./zstd -c > /dev/null
saved rank count: 0
Ranks:
- index: 0, count=9
- index: 1, count=8
- index: 2, count=8
- index: 3, count=8
- index: 4, count=8
- index: 5, count=8
- index: 6, count=8
@sergey-dryabzhinsky
sergey-dryabzhinsky / gist:7f09a390c546288bf75b
Created February 3, 2015 22:51
zstd simple and ugly test case output
$ git diff
diff --git a/lib/fse.c b/lib/fse.c
index a1aeea5..bee6afc 100644
--- a/lib/fse.c
+++ b/lib/fse.c
@@ -84,6 +84,7 @@
#include <stdlib.h> /* malloc, free, qsort */
#include <string.h> /* memcpy, memset */
#include <stdio.h> /* printf (debug) */
+#include <assert.h> /* assert (debug) */
@sergey-dryabzhinsky
sergey-dryabzhinsky / bench.php
Last active August 8, 2023 08:51
PHP Benchmark Performance Script v1.0.6 (old, deprecated)
<?php
/*
##########################################################################
# PHP Benchmark Performance Script #
# © 2010 Code24 BV #
# #
# Author : Alessandro Torrisi #
# Author : Sergey Dryabzhinsky #
# Company : Code24 BV, The Netherlands #
# Date : July 2, 2015 #
@sergey-dryabzhinsky
sergey-dryabzhinsky / Zstd compression tests.txt
Last active January 13, 2016 10:41
Zstd compression tests with other compression tools/methods
Test with:
- Python 3.4
- Zend Framework 1.12.16 tar ungzipped, 104Mb
- Zstd: 0.4.6, 0.3.6, 0.0.1
- System:
- CPU: AMD FX-8350 4GHz
- MEM: 16Gb DDR3-1600
- OS: Ubuntu 14.04 amd64, Linux 3.19
- CpuFreq: performance
@sergey-dryabzhinsky
sergey-dryabzhinsky / nginx-vhost-proxprox.conf
Last active April 18, 2022 20:15
Nginx virtual host config for Proxmox. To hide pveproxy on 8006 port behind. With working VNC passthrough.
###
# Nginx vhost file to hide Proxmox pveproxy
# For 3.4+, 5.x version.
#
# Do not forget to create file
# /etc/default/pveproxy:
# ALLOW_FROM="127.0.0.1"
# DENY_FROM="all"
# POLICY="allow"
#
@sergey-dryabzhinsky
sergey-dryabzhinsky / nginx-1.8_send_minimum_rate.patch
Created May 2, 2016 15:01
Patch for nginx originaly by cloudflare. Read https://habrahabr.ru/post/282465/ , Ported to nginx-1.8.
--- a/src/core/ngx_connection.c
+++ b/src/core/ngx_connection.c
@@ -1167,3 +1167,60 @@
return NGX_ERROR;
}
+
+
+/*
+ * When a socket is idle, determines if the kernel is draining its buffer
@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
@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 / 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 / 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;
}
+
+