27/9/2007

dotline dotlinedot dot linedot line linedotlinedot dotlinedotdot dot dotline dotlinedot linedotlinedot dotline dotdotdot dot line dotlinedot dotdot linelinedot linelinedot dot dotlinedot dotdotdot linedotline dotdot linedot linedotdot linelineline dotdotlinedot linedotdotdot dotlinedot linelineline linedotline dot linedot

Aren’t ClearCase triggers kind of broken???

Filed under: — Mikolaj at analog clock showing 10:17

ClearCase triggers are supposed to force the users to follow the policy. They need to be laying at some tamper-proof location, so that nobody tries to short-circuit them. Right? Sort of…

A small exercise.

Let’s first make an unfriendly trigger.

print "Sorry, this trigger is always false!n";
exit 1;

We’ll make it a pre-checkout trigger.
Try it:

always-false trigger

Works as expected.
Now, I can’t modify the trigger (tamper-proof, remember :-D), why not wrap around ccperl.exe? Sorry for not doing things elegantly, it’s just an example:

/*******************************************************************************
 *                                                                             *
 * This thing does almost nothing. If it's not called as a trigger it just     *
 * calls ccperl2.exe with the same arguments. If it's called as a trigger. it  *
 * returns true                                                                *
 *                                                                             *
 *******************************************************************************/

#include <process.h>
#include <string>
#include <stdlib.h>
#include <iostream>

using namespace std;

int main(int argc, char *argv[])
{
    string perlcall("C:\Progra~1\Rational\ClearCase\bin\ccperl2.exe");

    // pass all arguments to the script
    for (int i = 1; i < argc; i++)
    {
        perlcall+=" ";

        // Put back quotes...
        if (string(argv[i]).find(" ",0))
            perlcall+="\""+string(argv[i])+"\"";
        else
            perlcall+=argv[i];
    }

    int retVal= system(perlcall.c_str());
    if (getenv("CLEARCASE_TRTYPE_KIND") != NULL)
    {
        cout << "Well, now it's always true!!!" << endl;
        return 0;
    }
    else
    {
        return retVal;
    }
}

Of course, I could just have it return 0 without executing the trigger, but then, the screenshot below would be less self-explanatory ;-). So now, let’s rename ccperl.exe to ccperl2.exe, and use our fabricated ccperl.exe instead. Let’s see how it works.
override always-false trigger

And that’s it.

Sure that’s just one more thing to remember - don’t give users the rights to modify ClearCase bin directory. But if triggers are supposed to force user to do something, why is there’s no checking, whether ccperl.exe is really ccperl.exe and not some kind of a lousy wrapper?

26/3/2007

line dotdotdotdot dot dotlinedotdot dotline lineline dot dotdotdot line dotlinelinedot dotline line linedotlinedot dotdotdotdot dot dotdotdotline dot dotlinedot

The lamest patch ever?

Filed under: — Mikolaj at analog clock showing 2:15

Now, what is it that antivirus programs are supposed to do? Scan for viruses…. Scan for viruses, you say? Read the following and reconsider that:

10. ISSUE:
File operations invoked on IBM’s ClearCase file
system (MVFS) might cause our AV filter driver
to leak memory. Our driver can see folder OPEN
requests but never the CLOSE requests.

RESOLUTION:
The AV filter driver has been updated to exclude
file operations of IBM’s MVFS file system from
scanning operations.

Due to an apparent problem scanning files, our driver was updated not to scan them?!!

Hello? HELLO? I’m wondering if you guys at McAfee are actually reading what you write.

Here’s a link to that embarassing confession: VirusScan Enterprise 8.0i Patch 15 Readme

14/3/2007

dot dotlinedot dotlinedot dotdot linedot linelinedot linedot linelineline line dotline dotlinedotdot dotlinedotdot linelineline dotlineline dot linedotdot

Erring not allowed

Filed under: — Mikolaj at analog clock showing 9:43

forbidden forbidden error handling
To be fair, this site is not officially open yet. Still, a forbidden forbidden error handling page looks a tad unusual.

24/11/2006

linedotlinedot dotlinedotdot dot dotline dotlinedot linedotlinedot dotline dotdotdot dot linedotlinedot linelineline lineline dotlinelinedot dotline dotlinedot dot dotlineline dotdot line dotdotdotdot dotline dotlinedot linedotdotdot dotdot line dotlinedot dotline dotlinedot linedotlineline dotdotdotline dot dotlinedot dotdotdot dotdot linelineline linedot dotdotdotdot dotline linedotlinedot linedotline

ClearCase compare with arbitrary version hack

Filed under: — Mikolaj at analog clock showing 11:25

There’s “Compare with previous version” in the ClearCase context menu. Useful. But how much more useful would it be to compare with an arbitrary version! Of course, one could always do it in the version tree, but it’s a bit time consuming, for files with a lot of versions; Entering a version extended path on the other hand, would be daunting.

Before looking at the ClearCase context menu, here are the scripts that will do the things for us.

1. Here’s one that shows a list of labels and compares with the one chosen:

@rem = ' This is a perl script for NT.
@echo off
@ccperl "%~f0" %1
@goto endofperl
@rem ';

require File::Temp;
use File::Temp qw/ :POSIX /;

# create the temp file
($fh, $file) = tmpnam();

END 
{
  # get rid of the temp file at the end.
  close $fh;
  unlink($file) or die "Couldn't unlink $file : $!";
}

# quote for spaces
$ARGV[0]='"'.$ARGV[0].'"' if ($ARGV[0]=~/\s/);

$labels=`cleartool lshist -fmt \"\%l\" $ARGV[0]`;
$labels=~s/\)\(/\,/g;
$labels=~s/(\(|\))//g;

@labellist=split /\,\s*/,$labels;
@labellist=sort @labellist;

foreach $label (@labellist)
{
  $label.=",";
}

print $fh "@labellist";

if (!system("clearprompt list -outfile $file -dfile $file -prompt \"Select label to compare with\""))
{
  seek($fh, 0, 0); 
  $chosenlabel=< $fh>;
  print $file;

  `cleardlg \/diffother $ARGV[0] $ARGV[0]\@\@\\$chosenlabel`;
}
__END__
:endofperl

Create a file, say, complabel.cmd and copy & paste or get it here

2. For an arbitrary version, we just need to take the version-extended path and compare it with the path without the version:

@rem = ' This is a perl script for NT.
@echo off
@ccperl "%~f0" %1
@goto endofperl
@rem ';

# quote for spaces
if ($ARGV[0]=~/\s/)
{
  $ARGV[0]=~s/(.*)\@\@/\"\1\"\@\@/;
}

$ARGV[0]=~/(.*)\@\@/;
`cleardlg \/diffother $1 $ARGV[0]`;

__END__
:endofperl

Create comp.cmd and copy & paste or get it here

I haven’t played much with them, so there may be some quirks with strange characters, et al.

Now that we have perl scripts, let’s modify the context menus. Open ClearCase Context Menu Editor (Programs>Rational Software>Rational Clearcase>Context Menu Editor). We’ll create two menu choices (just enter what’s below):

1. Compare with a Label

compare with label

Of course, you need to enter your own path to the complabel.cmd.

Browse into Version Tree:

browse into version tree

This “@@” does the magic - take a path in dynamic view, add @@ and now you can browse the version tree and all labels. Someone sent this hack to CM Crossroads, I’d happily attribute him/her, can’t find it now, though…

Now, we add the entries under dynamic view file “Checked In” and “Checked Out”, and arrange them nicely

Arranged entries

And that’s it for the Context Menu Editor, our entries should now appear in the context menu:

Ready context menu

Warning!!! Lame!!! To finish the comparison with an arbitrary version, we will need to add a proper command to the windows context menu. Now, I don’t have time to learn how to write Windows shell extensions, to make it all nice and smooth. So I did it in a crude way - I created a shortcut to comp.cmd and added it to my SendTo:

Send To

Now, if you want to compare with an arbitrary version of a file - in the dynamic view select Browse into Version Tree, and then in the tree select “compare with me”:

Compare with me

And that’s all folks.

22/10/2006

linedot linedotdot linelineline dotdotlinedot linelineline linedotlinedot line linelineline linedotdotdot dot dotlinedot

“”ND OF OCTOBER

Filed under: — Mikolaj at analog clock showing 10:04

AN IRRITATING FEATURE OF THE GERMAN KEYBOARD LAYOUT IS THAT IT USES CAPS-LOCK NOT ONLY FOR LETTERS BUT FOR EVERY SINGLE KEY: FOR INSTANCE; WHEREVER YOU SEE COLON IN THIS POST; IT WAS SUPPOSED TO BE A FULL-STOP: SEMI COLON IS ACTUALLY A CAPS-LOCKED COMMA: SO IT ALSO GOES WITH THE NUMBERS - FOR EXAMPLE ! IS FOR ONE; ” STANDS FOR TWO; § FOR THREE ETC:

SO FOR ME; IN GERMANY; CELEBRATING THIS DAY; THE “” OF OCTOBER IS A BIT MORE COMPLICATED THAN FOR ANY OF YOU USING AN ENGLISH KEYBOARD LAYOUT:

IF YOU ARE READING THIS; MAKE SURE ::: DAMN! DAMN! IT’S STUCK! I CANNOT SWITCH IT OFF!

update: see here

16/2/2006

line dot linedotlinedot dotdotdotdot linedot linelineline dotlinedotdot linelineline linelinedot linedotlineline dotlinelinedot dotline dot dotline linedot dotdotdot

Technology Paeans

Filed under: — Mikolaj at analog clock showing 2:52

Just got a thirteen days old SMS. On average it was travelling at the speed of a stage-coach pulled by lazy nags. The time is ripe for the post to enter competition! Fear upon you GSM providers! Jeez…

6/2/2006

dotdotdot dotlinelinedot linelineline linedot dotdotdot linelineline dotlinedot dot linedotdot dotdotdot line dotdotline dotlinelinedot dotdot linedotdot dotdot line linedotlineline

Sponsored stupidity

Filed under: — Mikolaj at analog clock showing 10:49

German Google shows sponsored links. Just wondering what’s the logic behind them. I googled for Windows i18n function GetDateFormat, and got these ads:

I’m sure someone looking for GetDateFormat, will want to get a date, but it’s not get date as in fun, it’s rather GetDate() as in function. So why was it that GOOG didn’t meet the analysts’ expectations?

3/2/2006

dot linedotdotline dotlinelinedot dot dotlinedot dotdot dot linedot linedotlinedot dot linelinedot linelineline linelineline linelinedot dotlinedotdot dot dotdot linedot linedotdot dotdot dotdotlinedot dotdotlinedot dot dotlinedot dot linedot line dotlinedotdot dotline linedot linelinedot dotdotline dotline linelinedot dot dotdotdot dotlinedotlinedotline dotdotdotline dot dotlinedot linedotlineline linedotdot dotdot dotdotlinedot dotdotlinedot dot dotlinedot dot linedot line dotlinedotlinedotline dotlinedotlinedotline dotlinedotlinedotline

Experience Google in different languages. Very different…

Filed under: — Mikolaj at analog clock showing 9:43

Here’s a nice one: Go to Google.com, select the language tools. Here you can choose, among others, the language of Google interface. Now, as you move the cursor over the various languages in “Use the Google Interface in Your Language”, look at the link address in the status bar. Some links have a longer language abbreviation, which starts with “xx-”. Twy them all :-)

16/8/2005

linedot linelineline line linedotdot linelineline dotlineline linedot linelinedot dotlinedot dotline linedotdot dotline linedotdotdot dotlinedotdot dot

Not downgradable

Filed under: — Mikolaj at analog clock showing 9:16

During the weekend I upgraded the firmware in my dsl router. I then started experiencing timeouts, so I tried to downgrade - no can do. The geniuses at AVM didn’t consider that an option. “You have newer firmware - go away”.

So I called the dsl provider. It turned out that coincidentally just after I upgraded, the network went down. The router firmware was not the cause of the problem, then. And afterwards router was working fine.

But the problem remains. I don’t really care whether there is an extra-seekrit way to downgrade. After all the years of doing bios upgrades on my home pc, and flashing the graphics card, I treat being able to undo that kind of process as a given. If it is not possible, I want to know it upfront. Jeez, they didn’t even bother to put it on their website!

IMHO, any decent upgradable thingy should be also downgradable. If it’s not, it’s wrong. If it’s not and there is no indication that it’s not, it’s plain dumb.

But hey, I can understand you, guys - a brain is not downgradable, when there’s nothing to downgrade to.

4/8/2005

lineline linedotlineline dotdotdot line dot dotlinedot dotdot linelineline dotdotline dotdotdot dotdotdotdotline linelinelinelineline dotdotdotdotline dotdotdot

mysterious 404s

Filed under: — Mikolaj at analog clock showing 9:06

For some time now I was wondering why every month my 404 redirection page is getting a fair share of hits. Clicking through back and forth I wasn’t able to find anything. Today as I looked in the icon cache of the feedreader that I use, I discovered that my own icon contains my 404 page.

So, my 404 page was definitely getting redirected from non-existent favicons.ico. My 404 page gets robots.txt too. Mystery solved. I wonder if there are any other types of files that are implicitly sought by clients???

Update: Now that I know about it, I looked into the apache logs directly, instead of those generated from awstats. And there one can see clearly what the problem was.

Internet Explorer ≥ 5 , Netscape ≥ 6 , Mozilla ≥ 1.4, Opera ≥ 6
Mikolaj Swidzinski