Skip to content

Instantly share code, notes, and snippets.

View RBotfield's full-sized avatar

Rhys Botfield RBotfield

View GitHub Profile
@RBotfield
RBotfield / wp-integrity-check.sh
Last active February 13, 2023 21:37
WP verify-checksums bulk runner & saver
#!/bin/bash
# MUST INCLUDE colors.sh
# Script to cycle through the current directory to each direct child directory and generate a report of the WordPress file integrity using wp-cli (/usr/local/bin/wp) with the `wp core verify-checksums` and `wp plugin verify-checksums --all` commands. Reports will be saved in the current directory as a .txt file with the name of the directory the report was generated from and a unix timestamp appended.
# Exit immediately if a command returns a non-zero status
set -e
# Get the current directory
parent_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
scanreport_dir="scan_reports"
@RBotfield
RBotfield / interceptor.php
Last active October 2, 2021 16:52
Intercept requests by their REQUEST_URI w/ passthru
<?php
$interceptUris = [
'rtm/status',
'rtm/Loggedin',
'AppAuthorization/GetAuthorization',
'AppAuthorization/GetLicenseData',
'AppAuthorization/MultitoolData'
];
foreach ($interceptUris as $uri) {
@RBotfield
RBotfield / colors.sh
Last active February 13, 2023 21:37
Bash output effects
#Reset all formatting
RESET="\e[0m"
#Text Decorations
BOLD="\e[1m"
NOBOLD="\e[21m"
UNDERLINE="\e[4m"
NOUNDERLINE="\e[24m"
@RBotfield
RBotfield / Kill stuck Magento cron
Created April 12, 2016 09:22
From Slack (Jimmy)
$ ps ax | grep crond
$ kill -9 {process_id}
$ (Kill all processes apart from the grep search)
$ service crond restart
$ (Log in to magento and kill the running process from scheduler)
# Should take a few minutes to be picked back up with magento
@RBotfield
RBotfield / shellhere.reg
Created March 16, 2016 11:28
Open CMD, Elevated Powershell, Powershell and Git Bash in the current directory by simply SHIFT+R-Clicking the folder/folder background to show it in the R-Click menu.
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Directory\background\shell]
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Directory\background\shell\cmd]
@="@shell32.dll,-8506"
"NoWorkingDirectory"=""
"Extended"=""
"Icon"="cmd.exe"