This file contains 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
################################ | |
# | |
# Parse a Sql export from a Wordpress db | |
# and do a search and replace on URLS in | |
# serialised data while maintaining the | |
# correct string lengths | |
# | |
# e.g. look for stuff like... | |
# s:76:\"http://www.website.com/wp-content/uploads/2012/04/rest_img-150x142.png\"; | |
# |
This file contains 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 your own user to the www-data group | |
sudo adduser yourusername www-data | |
# change ownership to www-data group and your user | |
sudo chown yourusername:www-data -R /var/www/site | |
# change permissions of files and folders | |
cd /var/www/site | |
find . -type d -print0 | xargs -0 chmod 0775 # For directories | |
find . -type f -print0 | xargs -0 chmod 0664 # For files |
This file contains 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
/* | |
* Original one http://snipplr.com/view/50166/, posted here so I don't lose it! | |
*/ | |
a.button { | |
font-family: 'PT Sans', arial, serif; | |
color:#ffffff; | |
text-align:center; | |
font-size:24px; | |
font-weight:bold; |
This file contains 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
/**************************** | |
* | |
* Util function for a recursive filesearch using glob function | |
* | |
****************************/ | |
if ( ! function_exists('glob_recursive')) { | |
// Does not support flag GLOB_BRACE | |
function glob_recursive($pattern, $flags = 0) { |
This file contains 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
// utility for getting a thumbnail image from a different sized thumbnail image | |
// or the original. Assumes the size requested is auto generated | |
// eg. ..../2012/05/TSStAlbans-h1091-1024x750.jpg | |
// to../2012/05/TSStAlbans-h1091-300x200.jpg | |
// | |
// Or. ..../2012/05/TSStAlbans-h1091.jpg (source image) | |
// to../2012/05/TSStAlbans-h1091-300x200.jpg | |
// | |
// Add standard image sizes using add_image_size function and rebuild | |
// thumbnails when needed using AJAX Thumbnail Rebuild plugin. |
This file contains 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
mount -o remount,rw / |