Skip to content

Instantly share code, notes, and snippets.

View rogeriotaques's full-sized avatar

Rogério Taques rogeriotaques

View GitHub Profile
@rogeriotaques
rogeriotaques / .database-heartbeat.env
Last active October 16, 2025 04:06
MySQL Database Heartbeat Checker with Telegram Notification in PHP
# DATABASE CREDENTIALS
DB_HOST=localhost
DB_USER=YOUR-USER
DB_PASS=YOUR-USER-PASSWORD
DB_NAME=YOUR-DATABASE-NAME # Optional
# TELEGRAM CONFIGURATION
# CREATE YOUR BOT AND GET ITS IDS FROM BotFather ON TELEGRAM
TELEGRAM_CHANNEL_ID=-123...9
TELEGRAM_BOT_TOKEN=7089...4g
@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/