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
# Kernel sysctl configuration file for Red Hat Linux | |
# | |
# For binary values, 0 is disabled, 1 is enabled. See sysctl(8) and | |
# sysctl.conf(5) for more details. | |
# Controls source route verification | |
net.ipv4.conf.default.rp_filter = 1 | |
# Do not accept source routing | |
net.ipv4.conf.default.accept_source_route = 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
# Purpose : System backup | |
# Modified 14 Feb 2011 | |
echo "Initializing backup process - " `date` | |
logger -t backup "System Backup started" | |
backvol=/bkpv | |
# | |
# Sanity Check | |
# |
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
import os | |
import BaseHTTPServer, SimpleHTTPServer | |
import ssl, socket | |
CERTIFICATE_PATH = os.getcwd() + '/server.crt' | |
KEY_PATH = os.getcwd() + '/server.key' | |
def verify_tls(socket, hostname, context, as_callback=True): | |
print "SNI hostname: ", hostname |
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
<html> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html; charset=windows-utf-8"> | |
<title>utf</title> | |
</head> | |
<body> | |
<?php | |
print "<h1>#p@$c@#</h1>\n"; | |
echo "Your IP: "; | |
echo $_SERVER['REMOTE_ADDR']; |
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
location /rdiffweb { | |
rewrite ^([^\?#]*/)([^\?#\./]+)([\?#].*)?$ $1$2/$3 permanent; | |
# substitute with rdiffweb url | |
proxy_pass http://127.0.0.1:18080/; | |
# for https | |
#proxy_redirect http://example.com https://example.com/rdiffweb; | |
proxy_set_header Host $host; | |
proxy_set_header X-Real-IP $remote_addr; | |
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | |
proxy_set_header X-Forwarded-Proto $scheme; |
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
function with_backoff { | |
# http://stackoverflow.com/questions/8350942/how-to-re-run-the-curl-command-automatically-when-the-error-occurs | |
# by phs | |
# | |
# The retry count is given by ATTEMPTS (default 5), the initial backoff | |
# timeout is given by TIMEOUT in seconds (default 1.) | |
# | |
# Successive backoffs double the timeout. | |
local max_attempts=${ATTEMPTS-5} |
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
def generate(taskname, ext='html'): | |
#jobs=get_results_from_redis() | |
#job = [i for i in jobs if i.name == taskname][0] | |
try: | |
logfile = open('/opt/deploy/var/log/tasks/%s.%s'%(taskname, ext), 'r') | |
except: | |
raise StopIteration | |
yield ''.join(logfile.readlines()) | |
#while job.status != 'SUCCESS' and job.status != 'FAIL' and job.status != 'STOP' and logfile: |
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 | |
# This is a skeleton of a bash daemon. To use for yourself, just set the | |
# daemonName variable and then enter in the commands to run in the doCommands | |
# function. Modify the variables just below to fit your preference. | |
daemonName="DAEMON-NAME" | |
pidDir="." | |
pidFile="$pidDir/$daemonName.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/bash | |
# original https://idyllictux.wordpress.com/2009/06/19/script-find-maximum-mtu/ | |
# adjusted it to detect pmtu hole | |
# read https://blog.cloudflare.com/path-mtu-discovery-in-practice/ | |
# https://habrahabr.ru/post/136871/ | |
PKT_SIZE=${2:-1472} | |
HOSTNAME="$1" | |
z=$( ping -M do -c 1 -w 3 -s $PKT_SIZE $HOSTNAME 2>&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
RewriteEngine On | |
RewriteCond %{REMOTE_HOST} !^192.168 | |
RewriteRule .* 451.php [L] |