The popular open-source contract for web professionals by Stuff & Nonsense
- Originally published: 23rd December 2008
- Revised date: March 15th 2016
- Original post
| #!/bin/bash | |
| NOW=$(date +%Y%m%d%H%M%S) | |
| SQL_FILE=${NOW}_database.sql | |
| # Backup database | |
| wp db export ../backups/$SQL_FILE --add-drop-table | |
| # Compress the database file | |
| gzip ../backups/$SQL_FILE |
As configured in my dotfiles.
start new:
tmux
start new with session name:
| define( 'WP_DEBUG', true ); | |
| if ( WP_DEBUG ) { | |
| define ('JETPACK_DEV_DEBUG', true ); | |
| define( 'WP_DEBUG_LOG', true ); | |
| define( 'SCRIPT_DEBUG', true ); | |
| if ( defined( 'DOING_AJAX' ) && DOING_AJAX || defined( 'DOING_CRON' ) && DOING_CRON ) { | |
| define( 'WP_DEBUG_DISPLAY', false ); | |
| @ini_set( 'display_errors', 0 ); | |
| } else { |
| define( 'WP_DEBUG', true ); | |
| if ( WP_DEBUG ) { | |
| define ('JETPACK_DEV_DEBUG', true ); | |
| define( 'WP_DEBUG_LOG', true ); | |
| define( 'SCRIPT_DEBUG', true ); | |
| if ( defined( 'DOING_AJAX' ) && DOING_AJAX || defined( 'DOING_CRON' ) && DOING_CRON ) { | |
| define( 'WP_DEBUG_DISPLAY', false ); | |
| @ini_set( 'display_errors', 0 ); | |
| } else { |
| { | |
| // Jeremy's person key bindings for MailMate | |
| //http://jeremy.cowgar.com/2014/09/22/my-mailmate-keybindings/ | |
| // Email Creation | |
| "c" = "newMessage:"; | |
| "r" = "replyAll:"; | |
| "R" = "replySender:"; | |
| "f" = "forwardMessage:"; |
Without wasting much time, Let us get started!
Follow these simple instructions:
Step 1: Login into your WHM panel and using easyapache enable Memcache
Step 2: SSH into your server and fire this command yum install memcached.x86_64 php-pecl-memcache.x86_64
| To set up MySQL backups we need to: | |
| 1) open up port 3360 in Config Services Firewall but only for the specified remote IP Address | |
| See: http://crybit.com/enable-remote-mysql-csf/ | |
| Step I : Enable the port 3306 only for the specific IP address: | |
| This can be done in the CSF configuration file ‘/etc/csf/csf.allow‘ | |
| # vi /etc/csf/csf.allow |
| #!/bin/bash | |
| # Finds WP installs and displays version numbers in current directory, or directory specified by -d <path> | |
| # Very rough - needs tidy up and improvement | |
| # Would be cool if it could look up latest version and compare any installs found to show only old installs | |
| function usage | |
| { | |
| echo "usage: locate_old_wp_versions.sh [-d | --dir] [-h | --help]" | |
| } |
| <?php | |
| // Warning: this will overwrite every post in your database | |
| // BACKUP FIRST! | |
| clean_post_content(); | |
| function clean_post_content() { | |
| $posts = get_posts(array( | |
| 'post_type' => array('post'), // or page, or cpt | |
| 'post_status' => 'publish', // or any, draft, etc |