Thursday, December 20, 2007

WQL Queries Fail Against Valid Performance Counters

I was trying to run WQL queries against remote Windows systems to read things such as the current IIS connections. The query looks like the following:

SELECT CurrentConnections FROM Win32_PerfFormattedData_W3SVC_WebService

I kept getting an 0x80041010 ("Invalid Class") error from the remote DCOM objects even though the performance objects clearly were visible and monitorable in perfmon. This error code means that either:

- You are trying to query a non-existant performance object;
- The performance object exists and has not been registered; or
- The performance object is not registered properly.

I went through a number of troubleshooting steps, including jacking around with dcomcnfg (launch/activation permissions, default authentication levels), re-registering performance counter DLLs, etc. and nothing helped. Finally, executing the following command on the target servers proved to be the key:

winmgmt /clearadap (thanks to this site for advising about this clear command)
winmgmt /resyncperf

This tool fixes invalid registry entries around the performance DLLs and fixed all of my WQL problems.

Some other steps that may help:

If the performance objects haven't been registered, install the Windows Server Support Tools, and run exctrlst. This tool allows you to uncheck and re-check the registered performance objects and may help with the above. If you use this tool on any classes, follow the execution with a call to winmgmt as above.

To rebuild all Performance counters including extensible and third party counters in Windows Server 2003, type the following commands at a command prompt. Press ENTER after each command.

cd \%windir%\system32
lodctr /R

Additional WMI Troubleshooting Resources

WMI Troubleshooting (MSDN)

WMI Isn't Working! (TechNet--good troubleshooting tips)

Scriptomatic 2.0: This tool shows you a list of all registered WMI classes on the machine with the WQL format class names.

WMI Explorer: Another good tool for exploring registered WMI classes.

Friday, October 19, 2007

GnuCash 2.2 on Ubuntu Gutsy - with OFX Direct Connect!

When I started running Ubuntu Gutsy (7.10) about a month and a half ahead of its release this week, its GnuCash package was still in the 2.0 series, and I wanted to run 2.2. While 2.2 is now in the official repositories, I understand that a licensing issue prevents the Ubuntu GnuCash package from shipping with OFX Direct Connect enabled (it will import qfx/ofx files but not connect directly to financial institutions to retrieve transactions, as one of mine requires). So, with both of these goals in mind, I set out to build my own GnuCash 2.2 with OFX Direct Connect. Unfortunately, this process is not for the average user...

Building GnuCash

First, get a terminal open and install all the dependencies for this process:

sudo aptitude install libktoblzcheck1-dev libqt3-mt-dev libofx-dev libxml2-dev libgconf2-dev guile-1.6-slib guile-1.6-dev libglib2.0-dev libgtk2.0-dev libgnomeui-dev libgoffice-0-dev libgtkhtml3.8-dev libgwenhywfar38-dev slib gettext devscripts build-essential

Whew! Now we need to build libchipcard3-3.0.3, a dependency of the aqbanking library we will build later. This has no dependencies. For the uninitiated, this process consists of unpacking the archive and then executing the following in a terminal:

cd [folder in which you unpacked libchipcard]
./configure
make
sudo make install

That done, we build aqbanking 2.3.2. This is similar to building libchipcard above, but you have to pass some arguments when running the configure step:

./configure --with-frontends="cbanking g2banking qbanking"

Now download and unpack the latest GnuCash 2.2 source. You are looking for the latest archive starting with just "gnucash." Go through the same process again, except do the following for the configure step:

./configure --enable-ofx --enable-hbci

Configuring OFX Direct Connect

That's it--once you are done, you should have a shiny installed GnuCash 2.2 with OFX Direct Connect support (you will have an Actions > Online Actions menu). Next comes the frustrating process of figuring out how to connect to your bank! This is where applications like Quicken and Microsoft Money have done the hard work for you and baked in all these details. Unfortunately, it is somewhat difficult to find out the parameters you need to pass from the Direct Connect interface to get a successful download. The GnuCash wiki has a nice article that details some of the settings and contains instructions for downloading a script that will pull down the raw information about thousands of financial institutions. Follow these instructions to get the configuration information about your bank.

Add a User

Once you have this done and have located the details for your financial institution, in GnuCash, go to Tools > Online Banking Setup. The Online Banking Setup Wizard will launch. Click the Forward button until you see the button labeled Start Aqbanking Wizard, and click it. In the AqBanking Wizard, go to the Users tab and click New.

Here's where the guesswork begins. Many fields exist in the wizard that may or may not be used by your particular institution. For example, for Charles Schwab, I put my online login (user) name in all three of the User name, User Id, and Customer Id fields. If you are downloading transactions from a bank account, put your bank's ABA routing number (the number at the bottom left of your checks) in the Bank Id field, and specify the country of your bank. For my credit card, I did specify the country, but put arbitrary text in the Bank Id field (I probably could have left it blank).

Now let's move on to the OFX tab. Using the information downloaded about your financial institution, enter any of the FID, ORG, and Broker Id values that the institution is using (there will be values for those nodes in the downloaded XML file). Put the OFX server URL in the Server URL field in its complete https:// format. It doesn't seem to matter if you specify HTTP 1.0 or 1.1, and in fact with the version of the code I compiled, it always saves it as 1.0 regardless of what I do.

For the checkboxes at the bottom, typically just check the following and then click the Get Accounts button:
  • Supports Account List Download
  • Supports Statement Download
  • (and, if a credit card) Send Empty Bank Id


You will be prompted for your password, and then it should pull down all the settings for the account(s) you have at that institution under the Accounts tab. You may wish to review what it downloaded and poke around in these settings, but I can't give any specific advice.

Downloading Transactions

Once you have set up your institutions and accounts, you are ready to download. NOTE: some institutions (like Chase) have a setting in your online (not GnuCash) account configuration to enable OFX download before any of this will work. To get your transactions, open the account in GnuCash and click Actions > Online Actions > Get Transactions. When downloading for the first time, you may be prompted to accept the SSL certificate of the site, and you WILL be prompted to associate the GnuCash account with the OFX account you set up. Once you have done this, for subsequent downloads, just open the GnuCash account, go to the Get Transactions as above, and key in your password (the application does not store passwords).

I hope this helps someone. While not for the faint of heart, it IS possible to have GnuCash downloading transactions directly from your bank/credit card company without any intervening file downloads.

Wednesday, October 03, 2007

Ubuntu 7.10 Keyboard Shortcuts in compiz (Appearance > Visual Effects)

I love the eye candy compiz provides in Ubuntu 7.10. (To enable this, go to System > Preferences > Appearance, and on the Visual Effects tab, turn on Normal or Extra effects.) However, as a keyboard shortcut nut, I lamented the fact that enabling these horked all my non-standard application launch shortcuts I had entered into gconf-editor. I dug around and figured out how to fix them. (Gripe: KDE handles this configuration waaaay better.)
  1. Run gconf-editor (Alt+F2, and type gconf-editor in the dialog box).
  2. Drill down to apps | compiz | general | allscreens | options.
  3. There are a series of commandx keys (command0 through command11). Pick any empty one(s) and type the command to start the application(s) you desire, e.g. for command0: speedcrunch
  4. For any commandx you entered, find the corresponding run_commandx_key node further down the screen. Type the keystroke you desire to trigger running the command. Special keys are:
    1. Control: <Control>
    2. Alt: <Alt>
    3. Windows key: <Super>
    4. Shift: <Shift>
So, to set the key sequence Windows+Alt+s to launch SpeedCrunch in the example above, I would type (not press) the following in run_command0_key: <Super><Alt>s

Does anyone know how to represent the escape key? It used to be "Escape", but that doesn't seem to work with any of the combinations I tried.

** UPDATE 15 Oct: I learned that you can more naturally set the shortcut commands and keystrokes by installing the compizconfig-settings-manager package. Once installed, this is accessed via the System > Preferences > Advanced Desktop Effects Settings menu entry.

Under its Command options, you can enter the commands that get stored in the commandx keys above. Then on the Actions tab under the Commands section, you can click in the Key column and type in the keystroke you wish to set for each command. I still had problems getting the Ctrl+Shift+Escape keystroke mapped, but for many keystrokes this is much easier.

Thursday, September 20, 2007

Microsoft Hotfix Request Form

http://support.microsoft.com/gp/CUHotFix_LandingPage_Request

I learned today that there is a web page you can use to request Microsoft hotfixes that are not available for public download. You supply your email address and the KB article number and a representative will contact you within eight hours.

Thursday, February 08, 2007

Associating FreeMind mind map files with FreeMind in KDE

FreeMind is a fantastic cross-platform mind map application. If you haven't used it, I highly recommend it as it is a revolutionary way of taking notes, organizing thoughts, and planning.

On Windows, the FreeMind installer offers to associate its .mm files with the application in Windows Explorer. On KDE however, you have to do this yourself. I happened to put the missing pieces together on how to do this when looking over Beagle index logs that revealed the FreeMind MIME type to me. The steps are:

  1. Run kcontrol (KDE Control Center).
  2. Under KDE Components, choose File Associations.
  3. Click Add. Change the group to text, and enter x-troff-mm for the type name.
  4. Under Filename Patterns, enter *.mm. Fill in the description as FreeMind Mind Map.
  5. Under Application Preference Order, click Add, and browse to the FreeMind application (on mine, it installed under Office; you can probably just enter /usr/bin/freemind).
  6. Click Apply and you're all done.
If you want to associate the FreeMind icon while you are here, you'll have to download it from the source tree. In the 0.8.0 source zip file, it's at freemind/images/FreeMindWindowIcon.png. I copied this to /usr/share/icons and then made the association in kcontrol.

Friday, February 02, 2007

Visual Studio Extensions for WF conflict with Office Live Meeting 2005

Not sure if this is related to me trying to develop on Vista, but when I run the installer for Visual Studio 2005 Extensions for Windows Workflow Foundation (EN), it tries to repair or reinstall Office Live Meeting 2005 and never actually installs the WF extensions. I had to let it remove Live Meeting (repair didn't work) before it would actually install the extensions.

Wednesday, January 31, 2007

Good CSS reference guide for MOSS

http://www.heathersolomon.com/content/sp07cssreference.htm

This site has a good guide to the MOSS CSS classes, useful for when you are trying to override certain styles to customize the portal.

Missing telnet client in Vista

I needed to check if an SMTP server would respond on the correct port and DNS name. I fired up telnet from a command prompt... and discovered that there was no telnet client. This post indicates it's disabled by default and contains instructions for enabling it again.

Friday, January 12, 2007

Vista RTM and its networking "tuning"

I was having some maddening issues with Vista Business RTM:
  • MSN Messenger was constantly getting disconnected, but Google Talk stayed rock solid.
  • LiveMeeting (the Windows version) would not stay connected.
  • Firefox would halfway load a web page and then freeze.
It seems that Vista was automatically tuning my networking settings. Since declining this assistance, the above programs started running normally. The fix for me was to disable network auto tuning:
  1. Click Start and type cmd.
  2. When cmd.exe appears, right click and select Run as Administrator.
  3. Enter the following command: netsh int tcp set global autotuninglevel=disabled
  4. Reboot after getting the OK message.