Posted by & filed under General, MySQL, PHP.

(Updated October 2012)

WordPress has long had a feature that dynamically replaces standard characters with their more visually appealing (and perhaps more accurate) symbols. In some cases the formatting may not be desirable.

Last year I wrote a few articles on Exchange Server errors. The errors typically follow the form of 0xNumber, ex. 0x8000000F. What wordpress was doing was replacing the “x” in the error with a “times” or multiplication symbol. So 0x0 would show up as 0×0.

Dynamic Replace Active

Dynamic Replace Inactive

My concern was that search engines DO distinguish between “x” and the symbol for multiplication. So when people were searching for 0x8004011D my posts did not show up, but when searching for 0×8004011D or 8004011D they did. If you do a google search with the “times” symbol instead of an “x” for exchange errors, you will find many posts otherwise hidden from the world.

The last string of the regular expression below represents a case for when there is a character followed by an x and by another character without spaces. The x will be replaced with the special character for “times” or &# 215 ;

The characters in the image below are the symbols for replacement. Generally the quotes are not misleading to search engines.

WordPress 3.3.x and Earlier

The following dynamic string variable is found in the \wp-includes\formatting.php file. If you wish to remove all dynamic characters, simply delete both lines and your wordpress posts will render correctly.

$dynamic_characters = array
('/\'(\d\d(?:’|\')?s)/', '/(\s|\A|")\'/', 
'/(\d+)"/', '/(\d+)\'/', '/(\S)\'([^\'\s])/', '/(\s|\A)"(?!\s)/', 
'/"(\s|\S|\Z)/', '/\'([\s.]|\Z)/', '/(\d+)x(\d+)/');

 $dynamic_replacements = array
('’$1','$1‘', '$1″', 
'$1′', '$1’$2', '$1“$2', 
'”$1', '’$1', '$1×$2');

If you only want to remove the “x” replacement symbol ( × ) use the following lines in formatting.php in place of the originals.

$dynamic_characters = array(‘/\’(\d\d(?:’|\’)?s)/’, ‘/(\s|\A|”)\’/’,’/(\d+)”/’, ‘/(\d+)\’/’, ‘/(\S)\’([^\'\s])/’, ‘/(\s|\A)”(?!\s)/’,’/”(\s|\S|\Z)/’, ‘/\’([\s.]|\Z)/’);

$dynamic_replacements = array(‘’$1′,’$1‘’, ‘$1″’, ‘$1′’, ‘$1’$2′, ‘$1“$2′, ‘”$1′, ‘’$1′);

 

WordPress 3.4.x and Later

Delete the following line in \wp-includes\formatting.php to remove the “x” replacement symbol ( × ) (times) between numbers.

$dynamic[ '/\b(\d+)x(\d+)\b/'              ] = ‘$1×$2′; // 9x9 (times)

Posted by & filed under Hardware, MySQL, Windows / Server.

Avg Disk Queue Length is one of the main counters in the perfmon application. Avg Disk Queue Length is an estimate of requests on the physical or logical disk that are either in service or waiting for service. The value is a product of Disk Transfers/sec (response X I/O) and Avg Disk sec/Transfer.

What does it all mean? It’s confusing for many, but there are many instances where a high Avg Disk Queue Length does not mean a bottleneck. To see whether Avg Disk Queue Length is indeed showing a true representation of your disk’s performance, you need to compare Current Disk Queue Length over an interval. Add the Current Disk Queue Length to the counters graph in perfmon.

If the Current Disk Queue Length for the previous interval matches the Current Disk Queue Length for the current interval, then indeed the Avg. Disk Queue Length can be used as a general representation of the condition of your storage system.

Say your Avg. Disk Queue Length shows a value of 4, and the Current Disk Queue Length for the current interval is 3, and the previous interval was 0. This means the number of I/O arrivals is greater than the I/O completions during the interval. This results in an incorrect value for Avg Disk Queue Length – often to the horror of System Administrators.

Suppose you have determined the value of Avg Disk Queue Length is indeed accurate and useful – how much is too much? As a general rule for hard disks, an Avg Disk Queue Length greater than 2 (per hard disk) for extended periods of time is considered undesirable. If you have a RAID system with 8 disks, you do not want an Avg Disk Queue Length greater than 16. Faster hard disks with quicker access times (and therefore I/O) will allow greater flexibility with these numbers. Avg Disk sec/read and Avg Disk sec/write should be under 10ms – over 20ms may indicate a bottleneck. If while Avg. Disk Queue Length is over 2 and % Disk Time is hovering at 60% or above, you may want to look into a possible I/O bottleneck.

Below is a perfmon graph taken on a test machine. Avg Disk Queue Length reaches 36!! on a 2 disk RAID1 configuration.

Using Process Explorer (http://technet.microsoft.com/en-us/sysinternals/bb896653.aspx) we are able to see which applications have the highest I/O reads and writes. The following screenshot shows over 9 million I/O reads and 260 000 I/O writes in a little over 4 hours uptime for a DBServer application.

Using another program called FileMon (http://technet.microsoft.com/en-us/sysinternals/bb896642.aspx) we are able to see each program being accessed on the machine in real-time. The small screenshot shows a section of DBServer operations all within the same second. As it turns out, there were well over 300 instances during a one-second interval, correlating to the spike that sent the Avg Disk Queue Length to 36.

This particular situation was a stress test comprised of 12 users performing typical operations at the same time on a networked database server. Obviously a 2 disk RAID1 system (10K SAS) was not up to the task.

Posted by & filed under Security, Windows / Server.

Although yesterday I mentioned how convenient Trend Micro’s Security for SMB was, I did not examine the effectiveness of Trend Micro’s protection.

I’ve had the luxury of dealing with many corporate computers infected with Malware, Spyware, Grayware, Adware and every other type of ‘ware. Trend Micro does well with most traditional viruses, but falls terribly short on it’s protection against adware and trojans.

By far the best Malware protection I’ve seen is from Malwarebytes’ Anti-Malware. I scanned a real computer with Trend Micro’s Virus and Spyware removal engine first, then with Malwarebytes’ Anti-Malware. Trend Micro found nothing. Below are the results of what was found by Anti-Malware – 192 files and 88 registry keys. All of which were removed successfully.

Trojan.Clicker
Trojan.Agent
Fake.Dropped.Malware
Adware.Starware
Adware.EGDAccess
Trojan.FakeAlert
Trojan.FakeAlert.H
Adware.Seekmo
Rogue.XPantivirus
Hijack.TaskManager
Malware.Trace
Rogue.Installer
Trojan.DNSChanger
Adware.Zango

Registry Keys Infected: 88
Registry Values Infected: 4
Registry Data Items Infected: 1
Folders Infected: 25
Files Infected: 192

Malwarebytes’ Anti-Malware: http://www.malwarebytes.org/
Trend Micro for SMB: http://us.trendmicro.com/us/products/enterprise/officescan-client-server-edition/index.html

Posted by & filed under General, Windows / Server.

Trend Micro’s Client Server Security for SMB is a well designed security solution for small businesses. One of its greatest features is the ability to be deployed, updated, and controlled via the local network. With the push of a button you can scan all networked computers, increase security, send messages or print reports.

I’ve recently taken over the role of administrator for a company and unfortunately the Trend Micro passwords were lost.

Fear not, there is a simple method to resetting the password (too easy?)

  1. Navigate to: \Program Files\Trend Micro\security server(officescan)\private
  2. Open ofcserver.ini in Notepad
  3. Press CTRL-F to search for: master_pwd
  4. Once found, the string should look similar to: master_pwd=!CRYPT!xxxxx
  5. xxxxx is representative of a long string of hex characters making up an encrypted password
  6. In place of !CRYPT!xxxxx put “70″ so it will look like: master_pwd=70
  7. 70 is the hexadecimal value for “1″
  8. Save the file
  9. Press Start -> Run -> Type: services.msc and press enter
  10. Find “Trend Micro Security Server Master Service” and restart the service
  11. Login to the Trend Micro Security Dashboard with the password as “1″ without the quotations
  12. The default URL for the dashboard is: https://IPADDRESS:4343/officescan/default_SMB.htm

Posted by & filed under General.

I got a couple of nasty emails yesterday calling me a Microsoft fanboy, and that I should switch to Linux.

My comments were aimed at WordPress’ extremely slow and inefficient templating system. I was also making a JAB at Microsoft. A few people failed to realize I was making light of the fact that IIS is considered inferior.

I work with both Windows and Linux. Linux works well, but unfortunately in a business environment, most boxes are windows. My website focuses on IIS and Windows because that IS the most frustrating part of my day.

I AM a big fan of Linux, and I do use it where it is necessary. But when someone asks why I don’t run certain servers on Linux, I say “exchange doesn’t run on linux.”  Not to mention all the industry specific software I NEED to run.

I’ve tried Open-Xchange (http://www.open-xchange.com/) and unfortunately it hasn’t matured to the level where it can replace Exchange Server. It too, is not free. It’s a bit cheaper than Exchange Server, but that won’t convince a company to switch from Exchange Server.

Part of management decisions to implement a certain infrastructure over another is: cost, ease of use, and disaster recovery.

When dealing with cost, Linux is usually cheaper in the long run, but not always. Even though you can download and install most distros of Linux for free, knowing how to use them, or getting someone that knows how to use them costs money. Linux admins (in my area) make more than Windows admins.

Ease of use is directly related to the skill of the IT department and workforce in your company. I can bet Windows will be “easier to use” than Linux. Sorry, but for the desktop, it’s just not there.

For disaster recovery, it’s a mixed bag. You’ll obviously find whatever you’re using to be easiest. So what about a different disaster: You’re the only IT person, and you die in a car accident. Your servers are running Slackware, and no one knows how to use them. You go to the local IT companies and most only know Windows, or have only dabbled in a bit of Ubuntu, Redhat, Debian. ?

I started off in computers running Slackware. I’m 25. I couldn’t afford Windows 3.1 back then. I still use Slackware on an old machine to have fun. But it’s 90% Windows and 10% Redhat that gets my paycheck signed. Heck, let’s all use FreeBSD.