Basically, all users from the database are retrieved and put in an array then a random password is generated on line 6, password is reset on line 7, retrieve the users email on line 9 then finally send the user an email with the new username and password on line 10. You also want to echo back the username and password that was set in case you need that for your records
Replace with the name of the database, also the script assumes you are connecting with a user that has its MySQL password in ~/.my.cnf so no user or password options are specified for MySQL, if you have to specify a user and password, change the lines with mysql to
The passwd utility on Linux by default runs in interactive mode and it makes it difficult to reset shell passwords for a large number of users. I found the one liner below to be very helpful in accomplishing this task
Each user with an active shell will have that as part of the entry in /etc/passwd. So we are basically searching for each user with shell /bin/bash, excluding user root and resetting their passwords. We generate a random password using
If you are experiencing issues uploading files with the Media uploader in WordPress, the upload may be failing due to one of the following:
Uploaded file is too large- By default the upload limit for WordPress is controlled by the upload_max_filesize/post_max_size limits in your php.ini file. If the file you are trying to upload is bigger than those limits, the upload will fail. You can increase those limits to increase the upload limit for WordPress.
Upload path for WordPress is incorrect or unwritable - The default upload directory for WordPress is wp-content/uploads. If the directory is incorrect or it is unwritable you will be an error similar to the one in the screenshot below: To correct the upload path, navigate to Settings >> Media from your WordPress dashboard for the “Store uploads in this folder” field enter wp-content/uploads then click Save Changes.
If that does not correct the issue then wp-content/uploads or the currently upload path is not writable. The permissions for the folder should be set to 755. I do not suggest 777 since that makes the directory writable by group and that could make your WordPress site vulnerable. You can change the permissions using any FTP client or from SSH with the command chmod -Rv 755 wp-content/uploads
It is sometimes useful to know the exact page a visitor was referred from to your site. Google Analytics shows you only the domain by default such as WordPress.org, to find the exact page URL, you can create a custom report.
Click on Custom Reporting
Click New Custom Report
Give the report any name of your choice-I chose to name mine Full Referrer URL
Click on Add Metric Group, then Visitors and choose Visits
Click add dimension, choose Content then Full Referrer
Your report should look something like the image below(click image to view larger version):
Click on Save.
You will then be directed to a page that shows the report as below (click the image to view a larger version):
When it comes to the way browsers render pages, Internet Explorer has a mind of its own and does not obey any web standards with Internet Explorer 8 being the worst offender.
While working on the plugin Contact Tab, I noticed every version of Internet Explorer except 8 displayed the form correctly. To get IE8 to play nice, use the code below to let it render pages like IE7