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 | |
echo "SPAMSCORE|MAILID|SRCIP|SRCMAIL|DSTDOMAIN" 1>&2 | |
grep -P '(?=.*?spam decisive\))(?=.*?Spamc \()' /var/mailcleaner/log/mailscanner/infolog | sed -E -e 's/^[A-Za-z]*.* Message ([-a-zA-Z0-9]*) from ([.:a-zA-Z0-9]*) \(([-_+=.a-zA-Z0-9]*@[-_+=.a-zA-Z0-9]*\.[-_=.a-zA-Z]*)\) to ([-_a-zA-Z]*\.[-_a-zA-Z.]*) .*, Spamc \(score=([0-9.]*), .*$/\5|\1|\2|\3|\4/' |
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 | |
# Apache HTTPD sends STDOUT produced by this script straight to the browser. OK??? | |
# First we send HTTP Response headers, one header per line, each header line terminates with \n. | |
# A lonly \n character (an empty line) will separate headers from body. | |
# The HTTP Response body stream will then follow. | |
# Send Content-Type HTTP response Header to stdout (straight to the browser) | |
printf 'Content-Type: %s\n' 'text/plain' | |
# Send HTTP/410 |
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 | |
function sendcontentheader() | |
{ | |
printf 'Content-Type: %s\n' "$1" | |
} | |
function sendstatuscode() | |
{ | |
printf 'Status: %s\n' "$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
#include <stdio.h> | |
#include <math.h> | |
// ported in C from http://totologic.blogspot.com/2014/01/accurate-point-in-triangle-test.html?m=1 | |
// really really really thank you! | |
// compile with -lm (math library) | |
#define EPSILON 0.00001 | |
const static float epsilon = EPSILON; |