Archive for the Systems Engineering Category

WordPress Formatting Roadmap

miqrogroove
2014-07-08T18:39:25+00:00

I was asked for ideas about how to fix some old problems in the WordPress code base.  Specifically, bugs in the Formatting component, which includes the very heart of blog post processing for millions of websites.  This roadmap lays out recent changes and a plan for where to go next.

3.9

  • Implemented NBSP compatibility for curly quotes to fix common cosmetic flaws.
  • Revised all regex in wptexturize to avoid slow searches.
  • Added a large number of unit tests to cover all known behaviors of wptexturize.

4.0

  • Implemented NBSP compatibility for shortcodes and smilies.
  • Deprecated and replaced function like_escape().
  • Fixed wptexturize parsing for square braces inside of HTML.
  • Sorted the texturize patterns into groups for better performance.
  • Refactored the wptexturize stack function for better performance.
  • Wptexturize now runs up to 5x faster compared to v3.8.

4.1 or Future Releases

Wpautop Phase 1 – Research Problem

Read the rest of this entry »

8 Jul 2014

Category:
Systems Engineering

Tags:

Discuss:
Comments Go Here

like_escape() is Deprecated in WordPress 4.0

miqrogroove
2014-06-18T00:33:31+00:00

Plugin authors and website developers who work with WordPress database queries should notice an important change coming in WordPress 4.0.

The function like_escape() is no longer used in WordPress core code.  It is still available as a deprecated function, so it still works in any existing plugins that rely on it.  However, a new and different function is available that should be used in all new code.

Deprecated means that anyone using code that calls like_escape() with WP_DEBUG enabled will see an error message.  If WP_DEBUG_LOG is also enabled, the error message will appear in the /wp-content/debug.log file.

Let’s look at an example of core code where I removed like_escape() and implemented the new function $wpdb->esc_like().

3.9 Old Style

$search_orderby_s = like_escape( esc_sql( $q['s'] ) );
$search_orderby .= "WHEN $wpdb->posts.post_title LIKE '%{$search_orderby_s}%' THEN 1 ";

What did this do?  It was an old snippet from /wp-includes/query.php that set up a search for post titles.  The input $q[‘s’] was escaped using two functions before it was added to the post_title LIKE expression.  Now let’s see how I replaced that snippet in the next version.

4.0 New Style

$like = '%' . $wpdb->esc_like( $q['s'] ) . '%';
$search_orderby .= $wpdb->prepare( "WHEN $wpdb->posts.post_title LIKE %s THEN 1 ", $like );

Read the rest of this entry »

18 Jun 2014

Category:
Systems Engineering

Tags:
,

Discuss:
Comments Go Here

Folder Redirection Broken After GPO Changes

miqrogroove
2014-03-02T19:19:51+00:00

I am learning quite a bit about the Windows 2012 environment thanks to a recent server migration.  The biggest lesson so far deals with Folder Redirection, and the effects of repeated adjustments to the GPO settings.

Under certain circumstances, folder redirection seems to get “stuck” showing either an old folder path or none at all when the user goes looking for their documents.  The Group Policy Results tool seems to confirm that the Folder Redirection settings are not being applied at all for the user/computer profile that is stuck.  Frustratingly, I couldn’t find any problem with my Group Policy configuration.

No amount of logging off and on, adjusting permissions, or messing with Group Policy seems to have any effect.

In the end, I was able to clear up the problem by running this command:

gpupdate /Target:User /Force /Logoff

The key here is the Force option, which successfully resets the folder redirection policy for that user profile, and perhaps all the profiles on that particular computer.  Problem solved!  Windows 8.1, Windows 2012, and possibly other versions are affected.

2 Mar 2014

Category:
Systems Engineering

Tags:
,

Discuss:
2 Comments

16-bit Color Limitation in RDP

miqrogroove
2014-02-09T16:06:08+00:00
GPO Editor showing the path to the color policy.

This Policy Needs to be Enabled

If you’ve ever been under the mistaken impression that the RDP client controls the color settings for remote connections, then you came to the right place for help.

Windows XP and Windows 2003 servers won’t show more than 16-bit color depth to RDP clients requesting 24-bit or better color.  You can confirm this by looking at the display settings in the control panel of the remote server.  As a result, black text looks like funny shades of purple, photos look slightly posterized, and any color-critical tasks may be impossible to accomplish by remote control.

To fix this problem, you must enable the following policy:

Computer Configuration > Administrative Templates > Windows Components > Terminal Services > Limit maximum color depth

Set the Color Depth field to 24 bit and click OK.

I can’t explain why Windows would be limited in this way by default, but it is.

9 Feb 2014

Category:
Systems Engineering

Tags:
, ,

Discuss:
Comments Go Here

Microsoft Updates Crippling Windows 2003 Servers

miqrogroove
2013-12-11T01:43:24+00:00

The updates bug I described in Windows XP back in October is now also locking up server computers.

I’ve had it with this.  Microsoft has clearly lost control of its security patches.

As of today, I am disabling Automatic Updates across the board; all devices and all versions.  Up-time is more important to me than monthly patches.

11 Dec 2013

Category:
Systems Engineering

Tags:

Discuss:
Comments Go Here

Microsoft Updates Crippling Windows XP

miqrogroove
2013-12-11T13:08:44+00:00
Screen shot of the related Neowin article

Check out the comments on this website.

As reported at Neowin, your Windows XP computer may be locked up due to bad updates being sent by Microsoft.  Two of mine were 🙁

The solution, which I found in the comments section of that article, tested, and confirmed on my own computers:

  1. Disable the Automatic Updates service.
  2. Stop the Automatic Updates service (reboot if necessary but do not kill svchost.exe)
  3. Install the correct update from Microsoft.  That link is for computers with IE8 only.  For older versions, check the article I mentioned above.
  4. Reboot the computer.
  5. Reset the Automatic Updates service to automatic and start it. (If you want more updates.)

This is a truly shameful problem for Microsoft’s reputation.

December 7, December 11, More Problems

The subsequent updates released by Microsoft have caused the same problem to occur again.  I’ve updated the link above with the newer patches.

To find newer patches, you have to do a complicated search at the Microsoft Download Center.

Per my latest article about Windows servers, I am now recommending everyone disable the Automatic Updates service on all Windows-based computers.

31 Oct 2013

Category:
Systems Engineering

Tags:

Discuss:
Comments Go Here

MySQL Password Errors at BlueHost

miqrogroove
2013-08-30T05:54:30+00:00

Since August 12 (about two weeks now), I was getting this error from the MySQL program mysqldump:

Warning: Using unique option prefix pass instead of password is deprecated and will be removed in a future release. Please use the full name instead.

I’m not sure what changed or what got upgraded, but I was able to track down the problem.  It has nothing to do with command syntax.

In the account directory, which is the one with the account name, one level above public_html, or just “~” on the command line, I found a file named “.my.cnf” with the “pass=” option in it.

To fix the problem, find that file and change “pass=” to “password=”.

I have also forwarded this information to the BlueHost help desk.

30 Aug 2013

Category:
Systems Engineering

Tags:

Discuss:
Comments Go Here

Client Certificate Authentication in IIS 6

miqrogroove
2013-06-21T16:43:07+00:00

Client certificates are a cool technology that, once setup, eliminate the need to use your password on your own website from your own devices.

This article wont run through the entire procedure for setting up a web server, Windows domain, file permissions, server certificates, or a certificate authority.  I just want to convey some of the configuration pitfalls that exist in IIS 6.

Step 1: Enable Client Certificate Mapping

The IIS Secure Communciations dialog box

Start with these settings.

Read the rest of this entry »

21 Jun 2013

Category:
Systems Engineering

Tags:
,

Discuss:
Comments Go Here

Windows 8 Network Browsing Problems

miqrogroove
2013-12-11T13:28:17+00:00
Screen shot showing the Advanced Sharing Settings area of the Windows 8 control panel.

Check if these are disabled.

Network browsing in Windows has always been a fragile system plagued with bugs and configuration pitfalls.  If you’ve arrived at this page to find a solution, rest assured you are not alone.

I recently encountered a Windows 8 problem where the “Network” folder only showed the local computer and file shares.  When trying the “net view” command, the response was “A remote API error occurred.”  Not at all helpful, is it?  The Windows 2003 domain controller was not experiencing any problems, and the Windows 8 computer showed up normally on the server.

Symptoms Identified December 8, 2013

After struggling with this dysfunctional operating system for seven months without a solution, I found the pattern that would help identify the main problem.

With only Windows XP and Windows 2003 machines on the network, everything works fine.  Computers can see and browse each other without any problems.

With only Windows 8 and Windows 2003 machines on the network, network browsing may or may not work, depending on the Windows 8 network client configuration.

In a mixed environment of Windows XP, Windows 8, and Windows 2003 machines, the Windows 8 machines are sometimes able to browse the network.  However, once the Windows XP machines are shut down, the Windows 8 machines are never able to browse the network.

Once I had all these variables figured out, I came up with a list of settings that are compatible across all versions.

Read the rest of this entry »

14 May 2013

Category:
Systems Engineering

Tags:

Discuss:
6 Comments

PHP Array Assignment and References

miqrogroove
2017-08-15T08:39:01+00:00

This is a quick explanation of some more referencing quirks in PHP.

Let’s say you need to store an array in a specific variable so that another variable can be freed up and overwritten with different information.  [To clarify, this array may be very large and copying it would be detrimental to performance in this particular application. For small arrays, copying and not referencing may be preferable.]

The operation for referencing the array with a new variable is quite simple:

$array_goes_here =& $need_to_free_up_this_var;

The code above will reference the array to prevent PHP from making an unnecessary copy of the whole thing.

Now here’s what you have to avoid:

$need_to_free_up_this_var = array(); /* wrong! */

Read the rest of this entry »

15 Feb 2013

Category:
Systems Engineering

Tags:

Discuss:
Comments Go Here