Skip to content

Instantly share code, notes, and snippets.

@phillcoxon
phillcoxon / install.php
Last active December 30, 2015 02:39 — forked from Steveorevo/install.php
WordPress install.php dropin example
<?php
echo 'This has been customized!!!';
// Perform post-install customizations
if ( function_exists( 'add_action' ) ){
add_action( 'wp_mail_content_type' , customize_install );
function customize_install(){
// Switch themes
switch_theme('twentytwelve');
@phillcoxon
phillcoxon / .gitignore
Last active May 1, 2016 03:15
Starter `.gitignore` (ignores WordPress core files) - from http://wpengine.com/git/ - Updated 1 May 2016
*~
.DS_Store
.svn
.cvs
*.bak
*.swp
Thumbs.db
# wordpress specific
wp-config.php
@phillcoxon
phillcoxon / .gitignore
Created December 6, 2013 05:23
Starter `.gitignore` (keeps WordPress core files versioned) - from http://wpengine.com/git/ 6 Dec 2013
*~
.DS_Store
.svn
.cvs
*.bak
*.swp
Thumbs.db
# wordpress specific
wp-config.php
Macbook Pro bluetooth connection to my Sony CMT-BX50BT is rubbish - constantly cutting out, changing tone (flat to sharp or vice versa) and dropping connection. Currently sitting 4-5 metres away from the Macbook Pro.
Playing with bitbool settings under Bluetooth Explorer (part of Xtools) the following figures seem to be stable at the moment:
Allow Dynamic Bitpools - yes
Current / initial bitpool - 35
Minimum bitpool - 35 (previously 25)
Maxium bitpool - 40
@phillcoxon
phillcoxon / gist:8026056
Last active December 31, 2015 18:22
Slidesjs.com - stopping the slider.
<!-- SlidesJS Required: Initialize SlidesJS with a jQuery doc ready -->
<script>
jQuery(function() {
jQuery('#slides').slidesjs({
width: 960,
height: 370,
navigation: {
active: false,
effect: "fade"
},
@phillcoxon
phillcoxon / gist:8293846
Last active January 2, 2016 10:59 — forked from stephenhowells/gist:4021772
Apache conf.d code to hid all .git* folders and files
# do not allow .git version control files to be issued
<Directorymatch "^/.*/\.git+/">
Order deny,allow
Deny from all
</Directorymatch>
<Files ~ "^\.git">
Order allow,deny
Deny from all
</Files>
@phillcoxon
phillcoxon / sql_backup.sh
Last active April 1, 2018 13:11
Backup mysql database and push to S3 via cron
#!/bin/bash
BACKUP_DIR="/home/user/backup/"
DB_NAME="database_name"
DB_USER="database_user"
DB_PASS="database_password"
BUCKET_NAME="sqls3.bucketname"
# Back up the mysql database
# Set a symlink to the latest version of the db
# Push the latest version to Amazon S3
<?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
@phillcoxon
phillcoxon / locate_old_wp_versions.sh
Last active August 29, 2015 14:01
Find old WordPress installs
#!/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]"
}
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