This file contains 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 -rupN /home/alex/source/weighttp/src/weighttp.c weighttp/src/weighttp.c | |
--- /home/alex/source/weighttp/src/weighttp.c 2014-04-13 14:05:00.359685093 -0400 | |
+++ weighttp/src/weighttp.c 2014-04-14 20:34:59.470388698 -0400 | |
@@ -234,6 +234,7 @@ int main(int argc, char *argv[]) { | |
uint64_t kbps; | |
char **headers; | |
uint8_t headers_num; | |
+ float full_duration; | |
printf("weighttp - a lightweight and simple webserver benchmarking tool\n\n"); |
This file contains 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 | |
REQUESTS=( 50 100 200 400 800 1600 3200 5000 ) | |
USERS=( 5 10 20 40 80 160 320 500 ) | |
LOG=/tmp/bench.log | |
REQ_LOG=/tmp/req.log | |
TIME_LOG=/tmp/time.log | |
WEBSERVER=[enter webserver IP] # used to remotely restart apache | |
# Argument checking | |
if [[ $# -ne 2 ]]; then |
This file contains 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
<?php | |
$ua = getenv('HTTP_USER_AGENT'); | |
$ip = getenv('REMOTE_ADDR'); | |
if (strpos($ua,'curl') !== false) { | |
echo "$ip \n"; | |
} | |
?> |
This file contains 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 | |
curl -s https://check.torproject.org/exit-addresses | awk '/ExitAddress/ {print $2}' | sort -n |
This file contains 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 | |
if [[ $# -ne 2 ]]; then | |
echo "WARN and CRIT thresholds not defined" | |
exit 3 | |
fi | |
warn="$1" | |
crit="$2" | |
tcp=$(ss -tan | tail -n +3 | egrep -c -v "UNCONN|LISTEN") |
This file contains 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
<?php | |
echo "<h1>REQUEST HEADERS</h1>"; | |
$headers = apache_request_headers(); | |
foreach ($headers as $header => $value) { | |
echo "$header: $value <br />\n"; | |
} | |
echo "<h1>APACHE VARIABLES</h1>"; |
This file contains 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
<VirtualHost *:443> | |
ServerName securesite.com | |
ServerAlias www.securesite.com | |
DocumentRoot /var/www/securesite.com | |
# OCSP Stapling | |
SSLStaplingCache shmcb:/tmp/stapling_cache(128000) # place outside <virtualhost></virtualhost> | |
SSLCACertificateFile /etc/ssl/ca-certs.pem | |
SSLUseStapling on |
This file contains 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
# Generated by iptables-save v1.4.12 on Tue Oct 21 17:32:08 2014 | |
*nat | |
:PREROUTING ACCEPT [9:538] | |
:INPUT ACCEPT [9:538] | |
:OUTPUT ACCEPT [4:271] | |
:POSTROUTING ACCEPT [4:271] | |
COMMIT | |
# Completed on Tue Oct 21 17:32:08 2014 | |
# Generated by iptables-save v1.4.12 on Tue Oct 21 17:32:08 2014 | |
*mangle |
This file contains 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 | |
TODAY=$(date +%Y%m%d) | |
TARGETS=( '/etc' '/home' '/root' '/var/www' ) | |
BACKUP_ROOT='/backups' | |
BACKUP_DIR="${BACKUP_ROOT}/${TODAY}" | |
echo "$(date +%D" "%r): Beginning backup" | |
mkdir -p $BACKUP_DIR | |
for i in ${TARGETS[@]}; do |
This file contains 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
# Configuration for ZPanel control panel. | |
# /etc/zpanel/configs/apache/zpanel-ssl.conf | |
# to use this config append the include directive below to /etc/zpanel/configs/apache/httpd.conf | |
# Include /etc/zpanel/configs/apache/zpanel-ssl.conf | |
<VirtualHost *:443> | |
ServerAdmin zadmin@localhost | |
DocumentRoot "/etc/zpanel/panel/" | |
ServerName www.foo.bar |
OlderNewer