Skip to content

Instantly share code, notes, and snippets.

Working from home

GB gbot

Working from home
Block or report user

Report or block gbot

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
gbot / hash_password.php
Created Oct 16, 2018
Hash a string with PHP's password_hash() function.
View hash_password.php
// Hash a password
// by Gavin Botica
// requires PHP 5.5+
define("RQD_PHP_VER", "5.5");
// check php version
if (version_compare(PHP_VERSION, RQD_PHP_VER) == -1 ) {
echo "<p><b>ERROR:</b> PHP <i>" . RQD_PHP_VER . "</i> required. Version <i>" . PHP_VERSION . "</i> installed.</p>";
gbot / wp_offload_media_db_migrate.json
Last active Apr 16, 2020
Migrate a WordPress database so that existing media items are served from Amazon S3 or CloudFront. Requires the WP Offload S3 Lite plugin.
View wp_offload_media_db_migrate.json
"use_https": "",
"purge_amazonS3_info": ""
gbot / wp-xmlrpc-jail.local
Last active May 5, 2020
Fail2Ban WordPress XMLRPC Jail and Filter. Notes: log path is set for Plesk v12.x. Change this to appropriate path for your set up. Only works if WordPress is installed in webroot, edit the Filter failregex if installed in sub-directory.
View wp-xmlrpc-jail.local
enabled = true
filter = wp-xmlrpc
action = iptables-multiport[name=wp-xmlrpc, port="http,https"]
logpath = /var/www/vhosts/system/*/logs/*access*log
bantime = 86400
maxretry = 0
gbot / woocommerce-login-logout-redirects.php
Last active Mar 6, 2020
WP: Redirect to home page for WooCommerce login and logout. #ST3
View woocommerce-login-logout-redirects.php
// redirects for login / logout
add_filter('woocommerce_login_redirect', 'login_redirect');
function login_redirect($redirect_to) {
return home_url();
gbot / wp-login-jail.local
Last active Oct 10, 2015
Fail2Ban WordPress login failure Jail and Filter. Notes:The log path uses 'access*_log' to monitor http and https logins. This will only work if WordPress is installed the webroot. Tweaking the failregex would be required to work with installs in sub-directories.
View wp-login-jail.local
enabled = true
filter = wp-login
action = iptables-multiport[name=wp-login, port="http,https"]
sendmail[dest="", sendername="Fail2Ban", sender="fail2ban", name="wp-login"]
logpath = /var/www/vhosts/system/*/logs/access*_log
maxretry = 5
findtime = 60
bantime = 1200
You can’t perform that action at this time.