I hereby claim:
- I am MikeNGarrett on github.
- I am mikengarrett (https://keybase.io/mikengarrett) on keybase.
- I have a public key whose fingerprint is EC65 0153 F732 6C65 E9AD 7362 A8AC 3E70 563A 657D
To claim this, I am signing this object:
# Grabbed for reference from http://www.wpbeginner.com/wp-tutorials/how-to-add-an-admin-user-to-the-wordpress-database-via-mysql/ | |
# Check the table prefix | |
# Check the user_id to make sure it is the next in sequence | |
# Replace my name and email to your own | |
# Username will be demo and the password will be 1234 | |
INSERT INTO `wp_users` (`ID`, `user_login`, `user_pass`, `user_nicename`, `user_email`, `user_url`, `user_registered`, `user_activation_key`, `user_status`, `display_name`) VALUES ('4', 'mgarrett', MD5('1234'), 'Mike Garrett', '[email protected]', '', '2011-06-07 00:00:00', '', '0', 'Mike Garrett'); | |
INSERT INTO `wp_usermeta` (`umeta_id`, `user_id`, `meta_key`, `meta_value`) VALUES (NULL, '4', 'wp_capabilities', 'a:1:{s:13:"administrator";b:1;}'); | |
INSERT INTO `wp_usermeta` (`umeta_id`, `user_id`, `meta_key`, `meta_value`) VALUES (NULL, '4', 'wp_user_level', '10'); | |
# Troubleshooting |
<?php | |
// add do_action('my_do_active_user_message_hook'); where you want the welcome message to display after redirect | |
add_action( 'activate_header', 'check_activation_key_redirect_to_page' ); | |
/** | |
* Check the wp-activate key and redirect the user to the apply page | |
* based on http://www.vanbodevelops.com/tutorials/how-to-skip-the-activation-page-and-send-the-user-straight-to-the-home-page-for-wordpress-multisite | |
*/ | |
function check_activation_key_redirect_to_page() { | |
// We check if the key is not empty |
# This is a bash script meant to be run on the command line. Requires imagemagick (apt-get install imagemagick) | |
## THIS WILL OVERWRITE YOUR FILES, uses sudo and may not require it. | |
for file in /path/to/files/*/*.jpg; do sudo convert $file -resize '800x600>' -density 72 $file; done | |
### another method using resolution (800*600) | |
for file in /path/to/files/*/*.jpg; do sudo convert $file -resize '480000@>' -density 72 $file; done | |
### example of *not* overwriting files | |
for file in /path/to/files/*/*.jpg; do sudo convert $file -resize '800x600>' -density 72 converted-$file; done |
# Working with data like this: | |
# HTTP request sent, awaiting response... .--2014-05-06 16:41:58-- http://xxx.com/xxx.jpg | |
# Resolving xxx.com... 1.1.1.1 | |
# Connecting to xxx.com|1.1.1.1|:80... ...............connected. | |
# HTTP request sent, awaiting response... .. .......... .... ....... .......--2014-05-06 16:41:58-- http://xxx.com/xxx.jpg | |
# Resolving xxx.com... .... .1.1.1.1 | |
# Connecting to xxx.com|1.1.1.1|:80... .........404 Not Found | |
# 2014-05-06 16:41:58 ERROR 404: Not Found. | |
# | |
# .....200 OK |
<?php | |
file_put_contents(__DIR__.'/stack.log', print_r(debug_backtrace(DEBUG_BACKTRACE_PROVIDE_OBJECT), true)); | |
?> |
<?php | |
include(ABSPATH . 'wp-admin/includes/ms.php'); | |
$user = get_userdatabylogin('YOUR_USERNAME'); | |
grant_super_admin($user->ID); | |
?> |
var out = ''; jQuery('.rating').each(function(a){ out += "<b data-rating="+jQuery(this).text().trim().replace('%', '')+">"+jQuery(this).text().trim().replace('%', '')+","+jQuery(this).children().attr('href')+"</b><br>" }); jQuery('body').html(out); |
// Run this from the command line. | |
// h/t: http://superuser.com/questions/91935/how-to-chmod-755-all-directories-but-no-file-recursively#answer-91966 | |
// add read/execute to world, remove write | |
chmod -R u+rwX,g+rwX,o+rX-w path/ | |
// remove read/write/execute from world | |
chmod -R u+rwX,g+rwX,o-rwX path/ |
I hereby claim:
To claim this, I am signing this object:
add_action( 'shutdown', function() { global $_wp_additional_image_sizes; var_dump($_wp_additional_image_sizes); die; }); |