How to Retrieve Task Info

This is how to retrieve a task info in you have the task MOR:

ObjectContent[] objs =
connection.Service.RetrieveProperties(
   connection.ServiceContent.propertyCollector, new PropertyFilterSpec[]
   {
      new PropertyFilterSpec()
      {
          objectSet = new ObjectSpec[]
             { new ObjectSpec() { obj = taskMOR } },
          propSet = new PropertySpec[]
          {
             new PropertySpec()
             {
                all = false, allSpecified = true,
                type = "Task", pathSet = new String[] { "info" }
             }
          }
      }
   });
TaskInfo result = (TaskInfo)objs[0].propSet[0].val;

Simple .NET Profiler

Every developed needs a profiler. When I worked for Cognos our internal standard was Rational Quantify; I think it was alright.

Now when I deal with .NET and want to see a physical proof of my internal vision of how my application works I use a profiler from Eqatec: simple and effective if the only thing you need is a list of your routines, a number of times they have been called and their average.

Work with in three steps: build (instrument), run and view (analyze).

Good SSH client under Vista

I have been looking for a PuTTY replacement for awhile now not just because it is so old and ugly looking but also because it would drop connections from time to time.

Last week I installed a free-for-personal -use version of Tunnelier from Bitvise on my corporate laptop’s stripped down (meaning kindа usable) Vista Home Premium Edition and it seems to be functioning well.

It comes with a nice basic FTP client and easy on eye.

VMware APIs

Currently there are a few APIs and this post is a short summary of them.

– vSphere Web Services SDK a.k.a. VMware VI API, last version is 4.0, released May 21st, 2009.

This is a SOAP over HTTP/S protocol that exposes everything you can do on a virtual data center: configure resources, manipulate with virtual machines, retrieve events and performance metrics etc. Complex. I work with it every day.

– vCloud API, still in preview version.

RESTful web service that is kind of meta of super API for allocating an collapsing resources of VMware-software based cloud computing implementations.

– VIX API, version 1.8.1

One of the first VMware APIs I got to know. Allows simple manipulation with virtual machines. As I understand was designed for partners making agents for VMware servers console.

– vSphere Guest SDK, now in version 4. Strange, but I have always been thinking it is a brand new API.

If you code an application that for sure will be running on a virtual machine, use this API to make your product aware of it by consuming the hypervisor resource management information.

– CIM SDK (SMASH, SMI-S) latest version is here.

If you don’t know what CIM is, this SDK won’t help you, if you do, then you don’t need anybody to tell you what you use it for.

– Also there are Chargeback, vNetwork, SNMP MIB, VDDK and little more that is of a special interest of a very special kind of people who I doubt ever read this blog.

Good summary document at VMware web site.

How to run Java samples from VMware SDK

VMware SDK a.k.a. vSphere Web Services SDK 4.0 comes with Java and C# samples. This is what it took me to get them running on Ubuntu 8.10.

1. Download the SDK from vmware.com into a separate directory:

> mkdir vi-sdk-4.0.0-161137

2. Install Java and Axis:

> apt-get install sun-java5-bin sun-java5-demo sun-java5-doc \
sun-java5-fonts sun-java5-jdk sun-java5-jre sun-java5-plugin \
tofrodos
> wget http://apache.raffsoftware.com/ws/axis/1_4/axis-bin-1_4.tar.gz
> tar xzf axis-bin-1_4.tar.gz
> ln -s /home/dmitri/projects/vi-sdk-4.0.0-161137/SDK/ visdk

3. Setup environment variables:

export AXISHOME=~/apps/apache/axis/
export JAVAHOME=~/apps/java/jdk1.5.0_19/
export SDKHOME=~/apps/visdk/
export WBEMHOME=${SDKHOME}samples/Axis/java/lib/wbem.jar
PATH=${PATH}:${AXISHOME}/bin:${JAVAHOME}\bin
export PATH
CLASSPATH=${CLASSPATH}:${AXISHOME}lib/axis.jar:\
${AXISHOME}lib/axis-ant.jar:\
${AXISHOME}lib/commons-discovery-0.2.jar:\
${AXISHOME}lib/commons-logging-1.0.4.jar:\
${AXISHOME}lib/jaxrpc.jar:${AXISHOME}lib/log4j-1.2.8.jar:\
${AXISHOME}lib/saaj.jar:${AXISHOME}lib/wsdl4j-1.5.1.jar:\
${JAVAHOME}lib/tools.jar:${SDKHOME}samples/Axis/java/vim.jar:\
${SDKHOME}samples/Axis/java/vim25.jar:\
${SDKHOME}samples/Axis/java/apputils.jar:\
${SDKHOME}samples/Axis/java/samples.jar:\
${SDKHOME}samples/Axis/java/lib/activation.jar:\
${SDKHOME}samples/Axis/java/lib/mailapi.jar:\
${SDKHOME}samples/Axis/java/lib/wbem.jar
export CLASSPATH

4. Build the samples following the Setup Guide

> cd %SDKHOME%\samples\Axis\java
> ./build.sh

5. Run the samples:

>./run.sh com.vmware.samples.general.SimpleClient --url https://123.45.67.89/sdk \
--username admin --password password

6. Pat yourself on the back.

Anti-aliased Fonts in Emacs

How to build Emacs with anti-aliased fonts

Anti-aliased fonts in the X11 UI enabled from Gnu Emacs version 23.1 (with XFT support).

Unfortunately it not a part of most distros yet, but you can build it yourself from a snapshot:
$ cvs -z3 -d:pserver:anonymous@cvs.savannah.gnu.org:/sources/emacs \
 co -r emacs-unicode-2 emacs
$ cd emacs
$ sudo install texinfo libgtk2.0-dev libxpm-dev libungif4-dev
$ ./configure --with-gtk --enable-font-backend --with-xft
$ make bootstrap
$ sudo make install
$ cat > ~./Xresources
Emacs.background: light gray
Emacs.foreground: black
Emacs.pointerColor: dark green
Emacs.cursorColor: dark green
Emacs.bitmapIcon: on
Emacs.font: Bitstream Vera Sans Mono-12
Emacs.geometry: 80x45
Emacs.internalBorder: 0
Emacs.toolBar: 0
Emacs.verticalScrollBars: off
<Ctrl-C>
$ sudo apt-get install ttf-bitstream-vera
$ xrdb -merge .Xresources

See more at:   http://www.emacswiki.org/cgi-bin/wiki/XftGnuEmacs

My Firefox Plugins

My list of favorite Firefox plugins.

I have been using Firefox for a while and even though I switch constantly between at least three browsers (Firefox, Google Chrome and Opera), it is still my favorite thanks to an unmatched set of features and plugins that make browsing much less annoying.

This is my list of favorite Firefox plugins.

First set is the absolute necessity, as without these I cannot surf for more than a few minutes:

    Adblock Plus
    Flashblock
    NoScript
    PDF Download

Second is rather optional, but still makes a difference

    BetterPrivacy
    FireFTP
    Answers
    PetnameTool
    Forecastfox Weather
    Flagfox
    IE Tab Plus