Skip to content

Instantly share code, notes, and snippets.

View ilyaevseev's full-sized avatar

Ilya Evseev ilyaevseev

  • Loyaltyplant.com
  • Nazareth, Israel
  • 05:45 (UTC +03:00)
  • LinkedIn in/ilyaevseev
View GitHub Profile
@ilyaevseev
ilyaevseev / teamcheck.sh
Last active June 1, 2018 16:17
Zabbix check for status of aggregated links under Linux
#!/bin/sh
FAILED=""
SLAVES_COUNTER=""
cd /sys/class/net/
Check_iface() {
local master="$1" slave="$2" mask="$3"
#echo "DEBUG: check_iface $master:$slave"
@ilyaevseev
ilyaevseev / Cloudflare-Nginx-RealIP-Update.sh
Created May 30, 2018 13:59
/etc/cron.daily/Cloudflare-Nginx-RealIP-Update -- update Nginx config by list of Cloudflare frontends.
#!/bin/sh -e
# https://support.cloudflare.com/hc/en-us/articles/200170706-How-do-I-restore-original-visitor-IP-with-Nginx-
STATEDIR="${1:-/var/log/${0##*/}}"
mkdir -p "$STATEDIR"
CONFDIR="${2:-/etc/nginx/conf.d}"
test -d "$CONFDIR" || { echo "missing confdir: $CONFDIR" 1>&2; exit 1; }
@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
@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 ####
#!/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 / 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; }
}
@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 ilya.evseev@gmail.com
# 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 / 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 / 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 / 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)"