This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*********************** | |
ADD USER | |
Useful script to programatically add an admin user to Wordpress if you dont have access to the admin, but do have access to the file system | |
***********************/ | |
function wpb_admin_account() | |
{ | |
$user = 'adminusername'; // Your username | |
$pass = 'adminpassword'; // Your password | |
$email = '[email protected]'; // Your email |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*********************** | |
CHANGE USER PASS | |
Function to programmatically change the users password if you know the ID, and do not have access to the admin interface | |
***********************/ | |
wp_set_password( 'yourpassword', id ); // |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Asana | |
// @namespace http://example.com | |
// @version 0.1 | |
// @description Forced width of Asana is very obnoxius, so this will adjust the min width. | |
// @author You | |
// @match https://app.asana.com/* | |
// @require http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js | |
// @require https://gist.github.com/raw/2625891/waitForKeyElements.js | |
// @grant none |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function addGlobalStyle(css) { | |
var head, style; | |
head = document.getElementsByTagName('head')[0]; | |
if (!head) { return; } | |
style = document.createElement('style'); | |
style.type = 'text/css'; | |
style.innerHTML = css; | |
head.appendChild(style); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# REDIRECT TO WWW and HTTPS | |
#RewriteEngine On | |
#RewriteCond %{HTTP_HOST} !^www.domainname.co.uk$ [OR] | |
#RewriteCond %{SERVER_PORT} 80 | |
#RewriteRule (.*) https://www.domainname.co.uk/$1 [R=301,L] | |
# REDIRECT TO WITHOUT WWW and HTTPS | |
#RewriteEngine On | |
#RewriteCond %{HTTP_HOST} !^domainname.co.uk$ [OR] | |
#RewriteCond %{SERVER_PORT} 80 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
virtualmin list-domains --name-only --no-alias | while read line ; do | |
path=$(virtualmin list-domains --enabled --domain $line --home-only) | |
if [ $(find $path -maxdepth 2 -name 'wp-config.php') ]; then | |
echo $line | |
fi | |
done |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
find -L /home/*/etc/php.ini -xtype l -exec ls -l {} \; | grep 'php5' | |
find -L /home/*/etc/php.ini -xtype l -exec ls -l {} \; | grep 'php7' | |
# Virtualmin update php version from CLI with: | |
virtualmin modify-web --domain domain.com --php-version 7.3 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
virtualmin modify-web --domain example.com --php-version 7.0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Thanks to http://www.smartofthehome.com/2016/05/hive-rest-api-v6/ | |
// Set maxTemp below | |
// Set your username and password | |
// To get the list of all devices to get the thermostat ID, run this script with deviceList as an argument after it | |
/* Set Your Variabes */ | |
$maxTemp = 19.5; // Or 19 or 20 or whatever! | |
$username = 'your-hive-username'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Add in to HTML where you want the box to be | |
<script src='https://www.google.com/recaptcha/api.js' async defer></script> | |
<div class="captcha_wrapper"> | |
<div class="g-recaptcha" data-sitekey="YOUR_PUBLIC_KEY"></div> | |
</div> | |
// Add into PHP validation to check the submitted captcha response is a success or fail | |
/* Google ReCaptcha Verification */ |