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 -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 | |
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 | |
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 | |
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 -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 | |
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 |
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
$ 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 #### |
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/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 |
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
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; } | |
} |