To view disk usage via cli.
$ df -h --total
Example Output:
Filesystem Size Used Avail Use% Mounted on
udev 992M 0 992M 0% /dev
tmpfs 201M 23M 178M 12% /run
/dev/vda7 50G 39G 8.6G 82% /
To view disk usage via cli.
$ df -h --total
Example Output:
Filesystem Size Used Avail Use% Mounted on
udev 992M 0 992M 0% /dev
tmpfs 201M 23M 178M 12% /run
/dev/vda7 50G 39G 8.6G 82% /
wp cli is usually installed as just wp, but sometimes you may find it called wp-cli instead.
/path/to/wp-rocket-settings-backup.json is the exported json file from wp-rocket. Replace with the path and file name of the json file on your server or cluster.
$ wp package install --allow-root wp-media/wp-rocket-cli:trunk$ wp rocket import --file=/path/to/wp-rocket-settings-backup.json$ sudo rm -rf package-lock.json node_modules
$ sudo npm cache clean --force
$ npm install
<IfModule mod_headers.c>
Header set X-Frame-Options SAMEORIGIN
Header set X-XSS-Protection "1; mode=block"
Header set X-Content-Type-Options "nosniff"
Header set Referrer-Policy "strict-origin-when-cross-origin"
Header set Strict-Transport-Security "max-age=86400; includeSubDomains;" env=HTTPS
Header set Permission-Policy "accelerometer=Origin(), autoplay=(), camera=(), gyroscope=(), magnetometer=(), microphone=(), payment=(), publickey-credentials-get=(), usb=()"
Header always unset X-Powered-By
Header always unset server
| # Python script to find-replace an exported DB | |
| # For use when the php version timeout's or exceeding memory limits | |
| # export db you want to update, rename it to backup.sql | |
| # place backup in same dir as this script | |
| # run script | |
| # import the out.sql file | |
| import re | |
| from pprint import pprint |
| <?php | |
| // Add to functions.php | |
| // Remove the "[vc_*]" shortcodes usually found during migrations | |
| // Add this shortcode to a debug/test page and visit it | |
| // The page will render and dump all new post/pages to the screen | |
| // This can take a long time if there are a lot of pages/posts | |
| add_shortcode('remove-vc-shortcodes', 'remove_vc_shortcodes'); | |
| function remove_vc_shortcodes() { | |
| $pattern = '/\[\/?vc_.*\]?/i'; |
| <?php | |
| // Allow svg: https://wpengine.com/resources/enable-svg-wordpress/ | |
| add_filter( 'wp_check_filetype_and_ext', function($data, $file, $filename, $mimes) { | |
| global $wp_version; | |
| if ( $wp_version !== '4.7.1' ) { | |
| return $data; | |
| } | |
| $filetype = wp_check_filetype( $filename, $mimes ); | |
| return [ | |
| 'ext' => $filetype['ext'], |