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
update [table_name] set [field_name] = replace([field_name],'[string_to_find]','[string_to_replace]'); |
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
// the query | |
$the_query = new WP_Query( $args ); | |
// the loop | |
if ( $the_query->have_posts() ) : while ( $the_query->have_posts() ) : $the_query->the_post(); | |
// stuff | |
endwhile; endif; |
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
find ./ -type d -exec chmod 755 {} \; | |
find ./ -type f -exec chmod 644 {} \; |
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
update `prefix_posts` set `post_content` = replace(`post_content`, 'oldurl', 'newurl'); | |
update `prefix_postmeta` set `meta_value` = replace(`meta_value`, 'oldurl', 'newurl'); | |
update `prefix_options` set `option_value` = replace(`option_value`, 'oldurl', 'newurl'); |
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
// check to see if the hidden input exists in submission | |
function preprocess_new_comment($commentdata) { | |
if(!isset($_POST['is_legit'])) { | |
die(); | |
} | |
return $commentdata; | |
} | |
add_action('preprocess_comment', 'preprocess_new_comment'); | |
// add hidden field to form |
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
du -h / | sort -h |
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
ab -n 1000 -c 5 http://www.example.com/ |
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
SELECT TABLE_NAME, table_rows, data_length, index_length, round(((data_length + index_length) / 1024 / 1024 ), 2 ) "MB" | |
FROM information_schema.TABLES | |
WHERE table_schema = "schema_name" | |
ORDER BY (data_length + index_length) DESC; |
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 the following to your wp-config.php file | |
# Replace http://example.com/ with your url | |
if (!defined('WP_SITEURL')) { | |
define('WP_SITEURL', 'http://example.com/'); | |
} | |
if (!defined('WP_HOME')) { | |
define('WP_HOME', 'http://example.com/'); | |
} |
OlderNewer