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
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 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
# 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
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
// ==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
/*********************** | |
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
/*********************** | |
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
UPDATE wp_pmpro_memberships_users | |
SET enddate = '2018-01-30 23:59:59' | |
WHERE (membership_id = 10 OR membership_id = 11) | |
AND enddate = '0000-00-00 00:00:00' | |
AND status = 'active'; |
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 | |
if( function_exists('acf_add_local_field_group') ): | |
// Main Content Group | |
acf_add_local_field_group(array | |
( | |
'key' => 'content_1', | |
'title' => 'Content', | |
'fields' => array ( |