This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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; } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
FAILED="" | |
SLAVES_COUNTER="" | |
cd /sys/class/net/ | |
Check_iface() { | |
local master="$1" slave="$2" mask="$3" | |
#echo "DEBUG: check_iface $master:$slave" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
CONFIG="/etc/openldap/slapd.d/cn=config/olcDatabase={2}hdb.ldif" | |
Return() { echo $@; exit; } | |
test -s "$CONFIG" || Return "BAD_CONF" | |
URL="$(sed -n 'H; ${ x; s/\n//; s/\n //g; p}' "$CONFIG" | awk 'match($0, "provider=([^ ]+)", m) { print m[1] }')" ; test -z "$URL" && Return "BAD_URL" #' | |
DN="$(sed -n 'H; ${ x; s/\n//; s/\n //g; p}' "$CONFIG" | awk 'match($0, "binddn=\"([^ ]+)\"", m) { print m[1] }')" ; test -z "$DN" && Return "BAD_DN" #' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
FPATH="$(lftp -e 'cls -q -1 -D --sort=date /pub/otrs/RPMS/rhel/7/otrs*.noarch.rpm; exit' http://ftp.otrs.org/ 2>&1 | tail -1)" | |
LATEST="${FPATH##*/}" #" | |
LATEST="${LATEST%.rpm}" | |
CURRENT="$(rpm -q otrs)" | |
case "$1" in | |
install|reinstall ) yum "$1" "http://ftp.otrs.org/$FPATH" ;; | |
geturl ) echo "http://ftp.otrs.org/$FPATH" ;; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
test -z "$dev" && exit 0 | |
DNS="$(printenv | awk '/^foreign_option_.*=dhcp-option DNS / { print $NF; exit; }')" | |
test -z "$DNS" && exit 0 | |
# Error: Reading applied connection from device 'tun0' (/org/freedesktop/NetworkManager/Devices/6) failed: Device is not activated | |
# When called manually after connection esablished: removes all routes! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
test $# = 1 || { echo "Usage: ${0##*/} num-loops"; exit 1; } | |
D="/tmp/${0##*/}" | |
F="$HOME/lord-inquisitor.mp4" | |
rm -rf "$D" || : | |
mkdir -p "$D" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
test $# = 1 || { echo "Usage: ${0##*/} my-ipaddr"; exit 1; } | |
MY_IPADDR="$1" | |
RANCID_USER="rancid" | |
RANCID_HOME="$(su - -c pwd "$RANCID_USER")" | |
PIDFILE="/var/run/${0##*/}.pid" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh -e | |
MAX_DAYS="93" | |
LOG_DAYS="93" | |
LOG_DIR="/var/log/zbx-es-metrics-cleanup" | |
LOGFILE="$LOG_DIR/$(date +%Y-%m-%d-%H%M).log" | |
mkdir -p "$LOG_DIR" | |
D0="$(date -d "$MAX_DAYS days ago" +%s)" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
hg diff -p | |
diff -r e72c8a8a8b10 src/core/ngx_times.c | |
--- a/src/core/ngx_times.c Thu Jan 31 19:36:51 2019 +0300 | |
+++ b/src/core/ngx_times.c Tue Feb 05 10:12:03 2019 +0300 | |
@@ -47,7 +47,7 @@ static ngx_int_t cached_gmtoff; | |
static ngx_time_t cached_time[NGX_TIME_SLOTS]; | |
static u_char cached_err_log_time[NGX_TIME_SLOTS] | |
- [sizeof("1970/09/28 12:00:00")]; | |
+ [sizeof("1970/09/28 12:00:00.000")]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff -r 992bf7540a98 src/core/ngx_log.c | |
--- a/src/core/ngx_log.c Thu Feb 07 19:39:35 2019 +0300 | |
+++ b/src/core/ngx_log.c Sat Feb 09 13:14:06 2019 +0300 | |
@@ -16,6 +16,8 @@ static void ngx_log_insert(ngx_log_t *lo | |
#if (NGX_DEBUG) | |
+static u_char *ngx_log_cputicks(u_char *p, u_char *last); | |
+ | |
static void ngx_log_memory_writer(ngx_log_t *log, ngx_uint_t level, |