Skip to content

Instantly share code, notes, and snippets.

@rogeriotaques
rogeriotaques / sec-watcher.php
Last active July 20, 2020 01:43
Security package watcher in PHP
<?php
/**
* This script checks for security updates in the server and
* it's expected to be scheduled for a daily run.
*
* It will notify the $notify address if one or more security
* package updates are found.
*/
@josnidhin
josnidhin / modsec-ratelimit.conf
Created April 25, 2017 06:27
A simple mod security config for IP Rate limiting Apache server behind a load balancer.
# assumes libapache2-modsecurity is installed
# Reference Mannual - https://github.com/SpiderLabs/ModSecurity/wiki
SecRuleEngine On
<LocationMatch "^/.*">
# initialise the state based on X-Forwarded-For ip address
SecRule REQUEST_HEADERS:X-Forwarded-For "@unconditionalMatch" "phase:2,initcol:ip=%{MATCHED_VAR},pass,nolog,id:100"
@ScottPhillips
ScottPhillips / .htaccess
Created February 2, 2012 04:30
Common .htaccess Redirects
#301 Redirects for .htaccess
#Redirect a single page:
Redirect 301 /pagename.php http://www.domain.com/pagename.html
#Redirect an entire site:
Redirect 301 / http://www.domain.com/
#Redirect an entire site to a sub folder
Redirect 301 / http://www.domain.com/subfolder/