Friday, November 19, 2010

Windows Server 2003 Scheduled Task Problem

This problem popped up for the second time today: When scheduling a weekly task on a Windows 2003 server, I got this error message:
0x80090016: keyset does not exist
A simple Google search led me to this Microsoft Knowledge Base article,

But I could not find the registry entry mentioned in that article, at all:
HKEY_USERS\.DEFAULT\Software\Microsoft\Cryptography\UserKeys\Schedule
It seems that Windows 2003 is a beast vastly different from 2000. Some more research later, I found this blog entry by John Daskalakis. However, I could not find the registry key mentioned there either.

Fortunately, I did find this folder:
C:\Documents and Settings\All Users\Application Data\Microsoft\Crypto\RSA\S-1-5-18
So, I simply renamed that folder to something like "S-1-5-18-Not-used" and restarted the server. Problem solved.

Not sure why both articles mention "boot you computer in Safe mode", which seems unnecessary -- I had no problem renaming the folder in a Cygwin bash window.

Friday, November 12, 2010

jQuery 1.4.3 has a problem with apostrophe?

It seems that jQuery 1.4.3 has a problem with the apostrophe (' -- single quote) character in JSON data or any ISO Latin-1 code representation of characters.

In working on the drupal-nm project, I come across a port that has a description of Wei's phone, the port information dialog box would not display. I start up Firebug to see what's going on. Firebug seems to show that the JSON data is received and at least the debugger parsed that data correctly. However, my callback function to the jQuery's $.post() call was not invoked, at all.

Click on a different port without the apostrophe in the description, things work fine.

So I went to the server side of the function, trying to escape the apostrophe. I replaced the (') character with (') -- things stayed the same, no call back with the received JSON data, no sign of any error occurred in Firebug. In fact, any ISO Latin or HTML entity expression would cause the same problem.

This used to work fine with jQuery 1.3.2 -- which has different issues with the jQuery context menu plugin -- that needs a different blog post here.

For now, I am replacing (') with (’) -- copy and pasted the character into my code, not using the ISO Latin expression of (’), hope no one would notice.

[2010-11-13]: Posted a question on the jQuery Forum and received a pointer to jsFiddle.net -- a very nice tool for JavaScript testing, by the way. Created a test there, which seems to prove that the problem is not within jQuery 1.4.3. That means, the problem is likely a bad reaction between my own JavaScript components or other jQuery plugin modules I am using. I'll have to figure that out later.

[2010-11-16]: This is a known Drupal bug. To fix the bug in Drupal 6.20, replace lines 2500 - 2502 in includes/common.inc with the lines below:
      return '"'. str_replace(array("\r", "\n", "\t", "\\", "\/", "\"", "\'"),
array('\r', '\n', '\t', '\\', '\/', '\u0022', '\u0027'),
addslashes($var)) .'"';

[2011-03-29]: This problem still exists in the latest Drupal 6.20 release. Also, the JSON specification allows the apostrophe (') but jQuery's JSON parser does not.

[2011-05-02]: Drupal 6 may have a bigger problem with JSON conversion than this one bug. As it turns out, the above fix would also escape the double quotes surrounding member variable names and string values, which causes the entire JSON data object to be interpreted as a big string when received by a jQuery client end. Not good!

Wednesday, November 10, 2010

PoE Control via SNMP

A simple way to toggle the power on a power-over-Ethernet (PoE) switch port using the IETF POWER-EHTERNET-MIB (RFC 3621) object pethPsePortAdminEnable.

Here is an excerpt from POWER-EHTERNET-MIB:

pethPsePortAdminEnable OBJECT-TYPE
SYNTAX TruthValue
MAX-ACCESS read-write
STATUS current
DESCRIPTION
"true (1) An interface which can provide the PSE functions.
false(2) The interface will act as it would if it had no PSE
function."

Setting the object to false (2) on a port turns off the power; Setting it to true (1) turns the power on.

Simple enough. The next thing is to convert an interface name (e.g., Fa0/10) to the port index (e.g., 12) -- That is different on different switches.

Monday, November 8, 2010

Error Message from Power Adapter


Recently I started to receive an error message from a Dell DA65NS3-00 Auto-Air AC Adapter on my Dell Latitude E4300 notebook PC.

That is something new to me! But I guess it does make sense for these components to become smarter. The thing is, this one seems to have been caused by a rather simple hardware problem: The adapter comes with an extension cord on the DC side. The error only occurs when I use that extension cord, the error message pops up and the laptop lose the capability to charge the battery. Without that extension cord, everything works fine.

Saturday, November 6, 2010

No Short URL on Flickr?

Kiva KoffeehouseI tried to put a Google Maps link to the Kiva Koffeehouse in the description of my photo on Flickr, Flickr keeps saying There was an error.

Posting a comment with the link, Flickr says: Hey! A URL or phrase that you tried to post has been used for abuse on Flickr before. (ex. SPAM) If that's you, stop it! If that's not you, sorry, but you can't post it.

So, Flickr seems to have effectively banned short URLs, or at least Google's short links.

That seems to be an unfair practice. But I guess Flickr has no good way to work around short linked web pages using photos shared on Flickr without linking back.