Skip to content

Instantly share code, notes, and snippets.

View addison74's full-sized avatar

Addison addison74

View GitHub Profile
@hdogan
hdogan / curl-smtp.php
Last active September 9, 2024 09:58
Sending SMTP e-mail with curl/php
<?php
function read_cb($ch, $fp, $length) {
return fread($fp, $length);
}
$fp = fopen('php://memory', 'r+');
$string = "From: <[email protected]>\r\n";
$string .= "To: <[email protected]>\r\n";
$string .= "Date: " . date('r') . "\r\n";
$string .= "Subject: Test\r\n";
@dvlop
dvlop / gist:fca36213ad6237891609e1e038a3bbc1
Last active December 18, 2024 11:06 — forked from allthingsdem/gist:63b3223a7d14ac1f2457
My long list of bad bots to block in htaccess, ready to copy and paste!
# Start Bad Bot Prevention
<IfModule mod_setenvif.c>
# SetEnvIfNoCase User-Agent ^$ bad_bot
SetEnvIfNoCase User-Agent "^12soso.*" bad_bot
SetEnvIfNoCase User-Agent "^192.comAgent.*" bad_bot
SetEnvIfNoCase User-Agent "^1Noonbot.*" bad_bot
SetEnvIfNoCase User-Agent "^1on1searchBot.*" bad_bot
SetEnvIfNoCase User-Agent "^3D_SEARCH.*" bad_bot
SetEnvIfNoCase User-Agent "^3DE_SEARCH2.*" bad_bot
SetEnvIfNoCase User-Agent "^3GSE.*" bad_bot
@JPvRiel
JPvRiel / apt_pinning_priorities.md
Last active July 5, 2024 17:46
Apt package pinning and priorities