Skip to content

Instantly share code, notes, and snippets.

View ilyaevseev's full-sized avatar

Ilya Evseev ilyaevseev

  • Loyaltyplant.com
  • Nazareth, Israel
  • 17:51 (UTC +03:00)
  • LinkedIn in/ilyaevseev
View GitHub Profile
@ilyaevseev
ilyaevseev / linkvalidator.pl
Created March 9, 2016 07:14
URLs validator, uses Perl and AnyEvent
#!/usr/bin/perl
use strict;
use warnings;
use AnyEvent::HTTP;
my %urls;
if (@ARGV == 1 and $ARGV[0] eq '-') {
my @lines = grep { not /^\s*#/ and not /^\s*$/ } <>;
@ilyaevseev
ilyaevseev / centos6-atrpms-ffmpeg.sh
Created March 10, 2016 07:40
Install fresh FFMpeg to CentOS 6 from the dead ATrpms repo.
#!/bin/bash
rpm --import https://raw.githubusercontent.com/example42/puppet-yum/master/files/CentOS.6/rpm-gpg/RPM-GPG-KEY.atrpms
rpm -Uvh https://www.mirrorservice.org/sites/dl.atrpms.net/el6.7-x86_64/atrpms/stable/atrpms-repo-6-7.el6.x86_64.rpm
sed -i 's,http://dl,https://www.mirrorservice.org/sites/dl,' /etc/yum.repos.d/atrpms*.repo
yum install ffmpeg
@ilyaevseev
ilyaevseev / enfold-wpcli-warnings.diff
Last active March 23, 2016 22:19
Suppress wp-cli warnings with Enfold theme installed.
diff --git a/wp-content/themes/enfold/css/dynamic-css.php b/wp-content/themes/enfold/css/dynamic-css.php
index 65a291e..c09c24f 100644
--- a/wp-content/themes/enfold/css/dynamic-css.php
+++ b/wp-content/themes/enfold/css/dynamic-css.php
@@ -33,7 +33,7 @@ $output = "";
$body_color = "";
extract($color_set);
-extract($main_color);
+if ($main_color !== NULL) extract($main_color);
@ilyaevseev
ilyaevseev / vrf1.sh
Last active April 28, 2019 23:40
VRF in Linux using namespaces
#!/bin/sh
# 2017-feb-13
NSNAME="vrf1"
LINK1="${NSNAME}_10" # ..my link to VRF
LINK2="${NSNAME}_11" # ..VRF link to me
IP1="10.20.30.10"
IP2="10.20.30.11"
MASK="24"
@ilyaevseev
ilyaevseev / openntpd-ubuntu-fix.sh
Created April 13, 2016 18:18
Fix OpenNTPD install under Ubuntu and AppArmor.
#!/bin/sh
# Openntpd Ubuntu fix
# https://bugs.launchpad.net/ubuntu/+source/openntpd/+bug/458061/comments/24
apt-get install openntpd -y
apt-get purge ntp -y
service apparmor restart
service openntpd restart
@ilyaevseev
ilyaevseev / mkinitramfs.sh
Created August 14, 2016 18:53
initrd for booting TinyCoreLinux from virtio HDD.
#!/bin/sh
: ${ROOTPATH:=/}
SRCDIRS="bin sbin lib etc/udev"
LNDIRS="usr/bin usr/sbin"
Fail() { echo "ERROR: $@"; exit 1; }
echo "Check source dirs..."
mydir="$(dirname $0)"
#!/bin/bash
#
# Copyright (c) 2014, Intel Corporation
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice,
# this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright
@ilyaevseev
ilyaevseev / Rebuild-Unbound-srpm.sh
Last active April 16, 2023 16:11
RPM specfile fixes for Unbound DNS, see https://bugzilla.redhat.com/show_bug.cgi?id=1389061 (support for CentOS 7, rebuild without Python)
#!/bin/sh -e
DIR="$(mktemp -d)"
cd "$DIR"
echo "Working directory = $DIR"
yum install -y flex openssl-devel libevent-devel expat-devel pkgconfig python2-devel swig python34-devel systemd wget rpm-build
RPM="unbound-1.5.10-1.fc24.src.rpm"
wget -qcN "http://mirror.yandex.ru/fedora/linux/updates/24/SRPMS/u/$RPM"
@ilyaevseev
ilyaevseev / exception.sites
Created November 29, 2016 23:27
Files for ~/.icedtea/security/ - launch unsigned JARs from untrusted source, needed for IPMI
https://10.20.30.40:8080
@ilyaevseev
ilyaevseev / ngx_http_slice_filter_module.c.diff
Last active December 4, 2016 20:06
ngx_http_slice_filter_module: print mismatching ETags to error_log
--- nginx-1.11.5/src/http/modules/ngx_http_slice_filter_module.c.orig 2016-10-11 18:03:02.000000000 +0300
+++ nginx-1.11.5/src/http/modules/ngx_http_slice_filter_module.c 2016-12-02 04:22:14.000000000 +0300
@@ -131,8 +131,12 @@
|| ngx_strncmp(h->value.data, ctx->etag.data, ctx->etag.len)
!= 0)
{
- ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,
- "etag mismatch in slice response");
+ char msg[1024];
+ snprintf(msg, sizeof(msg), "etag mismatch in slice response: ctx_len=%u, ctx_etag=%s, r_len=%u, r_etag=%s",