Skip to content

Instantly share code, notes, and snippets.

View ilyaevseev's full-sized avatar

Ilya Evseev ilyaevseev

  • Loyaltyplant.com
  • Nazareth, Israel
  • 22:35 (UTC +03:00)
  • LinkedIn in/ilyaevseev
View GitHub Profile
@ilyaevseev
ilyaevseev / atop-proclist-size.patch
Created December 20, 2016 19:23
Increase performance of atop utility on the systems with many threads.
--- atop-2.1.1/atop.c.orig 2014-09-06 17:12:52.000000000 +0400
+++ atop-2.1.1/atop.c 2016-12-20 18:57:25.733100314 +0300
@@ -299,7 +299,6 @@
#include "parseable.h"
#define allflags "ab:cde:fghijklmnopqrstuvwxyz1ABCDEFGHIJKL:MNOP:QRSTUVWXYZ"
-#define PROCCHUNK 100 /* process-entries for future expansion */
#define MAXFL 64 /* maximum number of command-line flags */
/*
@ilyaevseev
ilyaevseev / unbound-unknown2fake.py
Last active March 19, 2024 15:07
Unbound Python module for replacing "Unknown Host/Domain" responses by fake addresses
'''
/etc/unbound/unbound-unknown2fake.py
Required packages: unbound, python-unbound
unbound.conf should contain:
server:
module-config: "validator python iterator"
python:
@ilyaevseev
ilyaevseev / genmkfile-make-helper.bsh.patch
Last active June 26, 2017 09:17
sdwdate-gui package building notes
diff --git a/usr/share/genmkfile/make-helper.bsh b/usr/share/genmkfile/make-helper.bsh
index 46596fc..8621814 100755
--- a/usr/share/genmkfile/make-helper.bsh
+++ b/usr/share/genmkfile/make-helper.bsh
@@ -10,6 +10,18 @@
## master location:
## https://github.com/Whonix/genmkfile/blob/master/usr/share/genmkfile/make-helper.bsh
+# Workaround "No such file or directory" bug..
+realpath_binary="$(which realpath 2>/dev/null)"
@ilyaevseev
ilyaevseev / http2check.js
Created August 31, 2017 15:39
Measure webpage load timings.
"use strict";
var page = require('webpage').create(),
system = require('system'),
imgname;
if (system.args.length === 1) {
console.log('Usage: http2check.js <imagename>');
phantom.exit(1);
}
@ilyaevseev
ilyaevseev / ngx_http_file_cache_verbose.patch
Created September 7, 2017 09:58
Nginx: print more info about wrong files in cache.
--- nginx-1.13.5/src/http/ngx_http_file_cache.c.orig 2017-09-05 17:59:32.000000000 +0300
+++ nginx-1.13.5/src/http/ngx_http_file_cache.c 2017-09-07 12:07:01.129832120 +0300
@@ -542,7 +542,8 @@
if ((size_t) n < c->header_start) {
ngx_log_error(NGX_LOG_CRIT, r->connection->log, 0,
- "cache file \"%s\" is too small", c->file.name.data);
+ "cache file \"%s\" is too small (actual = %z, required = %uz)",
+ c->file.name.data, n, (size_t)c->header_start);
return NGX_DECLINED;
@ilyaevseev
ilyaevseev / 00-autoinstall-i40e-driver.sh
Last active November 5, 2019 09:45
Autoinstall latest driver for Intel 10/40 GbE network cards from official site under CentOS 7.
#!/bin/sh -e
# Autoinstall latest driver for Intel 10/40 GbE network cards from official site under CentOS 7
# Written by [email protected]
# Distributed as public domain
# Last updated on 09-March-2019
INSTALL_ME_SO='
yum install -y wget make gcc "$(rpm -qf --qf '%{NAME}' /boot/vmlinuz-$(uname -r))-devel" &&
cd /etc/kernel/postinst.d/ &&
@ilyaevseev
ilyaevseev / Kerio-connect-nginx.conf
Last active October 20, 2021 17:02
Copy Kerio Connect backups to Hetzner backup server.
server {
listen 80;
listen [::]:80;
server_name mail.remotesrv.ru;
location /.well-known { alias /var/www/letsencrypt/.well-known; }
location / { return 308 https://mail.remotesrv.ru$request_uri; }
}
#!/bin/bash -ue
#
# Sets up mq+$shed combo for given interface.
#
# NB! To not degrade upload speeds, fq should only be used on kernels >= 3.19:
# https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=9878196578286c5ed494778ada01da094377a686
#
if [ $# -ne 2 ] || [ -z "$1" ] || [ -z "$2" ]; then
echo "usage: $0 interface scheduler" >&2
@ilyaevseev
ilyaevseev / chelsio-make-nic-fedora27-errors.log
Created March 7, 2018 13:28
Try to build Chelsio drivers under Fedora27
$ LANG=C make nic
Building for kernel 4.15.6-300.fc27.x86_64
Building for kernel 4.15.6-300.fc27.x86_64
##################################################
# Building Network Drivers #
##################################################
Preparing for build ...
#### Preparing cxgb4 ####
@ilyaevseev
ilyaevseev / squidcheck.sh
Created April 14, 2018 07:34
Check that Squid is crashed and restart it.
#!/bin/sh
Logger() { level="$1"; shift; logger -t "${0##*/}" -p "user.$level" -- "$@"; return 0; }
test -f "/var/run/squid/squid.pid" || exit 0
pgrep -F "/var/run/squid/squid.pid" | grep -q '' &&
Logger info "Squid OK" &&
exit 0