Techie
Clearing/Removing unwatned Recycle Bin Locations ($.recycle.bin) from Windows 7
by Logan Rogers-Follis 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.
Using “curl” instead of “php -q” in a cronjob for wp-cron.php
by Logan Rogers-Follis 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();
Rebuild FreePBX (CentOS 5) Software RAID after hard drive failure
by Logan Rogers-Follis on Feb.02, 2014, under Techie
I was testing how well FreePBX 5.211.65-5 (Asterisk 11) would deal with loosing a drive. After unplugging the drive and finding that it boots fine, I reconnected the drive an assumed it would re-sync the Software RAID. Sadly that did not happen and when looking at System Admin -> Storage I saw sdb green, then another sdb in red. After some hunting online I found the following solution:
Via Console/SSH:
See the status of the RAID by:
cat /proc/mdstat
I noticed that md0 and md2 were only 2/1 drives and that sda1 and sda3 (respectively) were missing, but md1 had sda2 and sdb2 listed fine.
I then ran the following two commands and waited for the Software RAID to resync/recover:
mdadm /dev/md0 --add /dev/sda1
mdadm /dev/md2 --add /dev/sda3
Now if I run
cat /proc/mdstat
It shows they are waiting to resync and one is currently in recovery state.
NOTE: Remember lsblk
is your friend when you are unsure of what drives are part of which RAID.
Windows XP Autologon (and Vista)
by Logan Rogers-Follis on Jan.18, 2014, under Techie
- Click Start, and then click Run.
- Type “control userpasswords2”, and then click OK.
- Uncheck the “Users must enter a user name and password to use this computer” check box, and then click Apply.
- You will then be prompted to type int he Administrator password. Type it in twice and click OK
- Click OK to close the User Accounts window.
WordPress site loading slow / high server load
by Logan Rogers-Follis on Jan.13, 2014, under Techie
Recently noticed a in-dev WordPress sites I work on calling “POST /wp-cron.php?doing_wp_cron” a lot and in turn the server load jumps up (15.0 at times!). After a lot of digging around I decided it wasn’t something like WP Super Cache glitching since they don’t use that Plug-in.
After a lot of Google searching I found out how to just disable the wp-cron.php from running every time a page is called. As I understand this is NOT something you want to do if the WordPress is updated a lot as a blog site, but since this one isn’t I figured setting it to manually run wp-cron.php every 6 hours might be best.
A quick synapse of what the link above will show:
edit the wp-config.php and add “define(‘DISABLE_WP_CRON’, ‘true’);” under the following line:
/** The Database Collate type. Don't change this if in doubt. */
define('DB_COLLATE', '');
Then setup a cronjob via cPanel (or whatever Control Panel you use; even crontab if need be) to run the following (every 6 hours should be good):
php -q /home/username/public_html/wp-cron.php
NOTE: Of course adjust the path accordingly.
As a side note. I noted that at time the page would load slow for the first time (since the site is in DEV not a lot of traffic – well aside from BOTS which create a lot of HTTP lately) and sometimes would be so slow it would create a “lfd on server.domain.ext: Suspicious process running under user username” e-mail telling me that different .php files (index.php, admin-ajax.php, etc.) were running for too long.