JIRA as ClearQuest Replacement: Customization

Somewhat later than expected, here is a summary of JIRA’s advantages and disadvantages over CQ, customization-wise only. These are only issues I encountered myself, I’m sure there are more…

Before I list them, I’d like to mention a couple of must-have (free) JIRA plug-ins: Behaviours and JIRA Suite Utilities. Another popular one which I have not yet used, but seems promising, is Script Runner.

Continue reading

Advertisements

Redirecting STDOUT and STDERR to file in perl

A small issue, but very common. There are several methods to do it, here is my favorite, which lets you print to the ‘original’ streams:

my $log_file = "/path/to/log/file.log";
redirect_streams();
print "Hello log file!\n";
print OLDOUT "Hello console!\n";
restore_streams();
exit(0);
##############################################################
sub restore_streams
{
  close(STDOUT) || die "Can't close STDOUT: $!";
  close(STDERR) || die "Can't close STDERR: $!";
  open(STDERR, ">&OLDERR") || die "Can't restore stderr: $!";
  open(STDOUT, ">&OLDOUT") || die "Can't restore stdout: $!";
}
##############################################################
sub redirect_streams
{
  open OLDOUT,">&STDOUT" || die "Can't duplicate STDOUT: $!";
  open OLDERR,">&STDERR" || die "Can't duplicate STDERR: $!";
  open(STDOUT,">> $log_file");
  open(STDERR,">&STDOUT");
}

 

Preventing msi package from rebooting the system

When running msiexec to install, update or remove a certain product, you may want to prevent it from rebooting the system, or even prompt the user to reboot the system (e.g. if it’s a part of a larger installation or some other scripted operation).

Before Windows Installer 3.0, the only way to do it was setting the Windows Installer REBOOT property like this:

msiexec /i MyPackage.msi REBOOT=ReallySuppress

In Windows Installer 3.0, Microsoft added several command line switches which makes it more readable. So now the command looks like this:

msiexec /i MyPackage.msi /norestart

Much clearer, isn’t it?