Try New Technology

Archive for March, 2014

Clearing/Removing unwatned Recycle Bin Locations ($.recycle.bin) from Windows 7

by on Mar.18, 2014, under Techie

I had a case where my Documents, My Music, My Pictures, and Video folders had been mapped to a network share. After tuning this off I had odd issues when emptying the Recycling Bin. I found that even though I had thought I remapped them back to my C:\ drive Windows didn’t agree. You will know you have this problem if you right-click the Recycle Bin -> Properties and see more than the Local (C:) (or whatever drive it is) listed. Obviously if you want Bins on these other drives that is up to you, but if you wanted to remove them as I did, see below.

Try the following I found while searching forums:

  • Open the file explorer,
  • navigate to the share in question that has the recycle bin,
  • right click in the empty space,
  • click on “Properties”,
  • If there is a “Locations” tab at the top, go to that tab and click on “Restore Default” and press ok.

You might have to reboot, even though I didn’t.

Comments Off on Clearing/Removing unwatned Recycle Bin Locations ($.recycle.bin) from Windows 7 more...

Using “curl” instead of “php -q” in a cronjob for wp-cron.php

by on Mar.01, 2014, under Techie

I found that a website running WordPress can become loaded down with a lot of page loads because wp-cron.php is called everytime, and on a site that isn’t and “active” blog it is not needed. In those cases it is helpful to the server load and page loads to disabled wp-cron.php from being ran automatically and set it up as a cronjob. See the below options to do this:

  • Edit the wp-config.php file
  • Disable the wp-cron.php from automatically running by going to the bottom of the database settings in wp-config.php (around line 37).
  • Add the code:
    define('DISABLE_WP_CRON', 'true');

    Directly under the define('DB_COLLATE', ''); like:

    /** The Database Collate type. Don't change this if in doubt. */
    define('DB_COLLATE', '');

    define('DISABLE_WP_CRON', 'true');

  • Save the file wp-config.php file.
  • Add a cronjob (via Cron Job in your Control Panel, or crontab via CLI) with something like the following and set it to run every 6 hours or so:
    curl http://www.domain.name/wp-cron.php

You may have found the similar advise to what I wrote above on other web sites they will generally use “php -q” to run the wp-cron.php fil. Now the side-affect this can produce when using “php -q” vs “curl” (or “wget”) to call the wp-cron.php in your Crontab/Cronjob is you might start getting an error_log file with “Cannot send session cookie – headers already sent in” if one of your plugins or a file that is being ran by the cronjob has a session_start() call in the code such as Nivo Slider does.
Example (found around line 19 of nivo-slider.php):
if ( !session_id() ) session_start();

Comments Off on Using “curl” instead of “php -q” in a cronjob for wp-cron.php more...

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!

Visit our friends!

A few highly recommended friends...