Thursday, August 6, 2009

MOSS Timer - Updates not being reflected

Many a times a developer makes changes to a timer solution and on deploying it to the MOSS instance - the changes just don't seem to be reflected.

Make sure to restart the Windows Sharepoint Timer Service after deploying your solution. This works! and your changes will be reflected

MOSS Timer debugging

To debug a Timer Job in MOSS - you should attach the Visual Studio debugger to OWSTIMER.EXE and add a breakpoint to your timerjob execute code.

OWSTIMER can be found in the Win Services

Monday, May 4, 2009

Increse Screen Resolution - KDE

Got a VM with the screen resolution set to 800x600 and no higher resolution available in Control Center> Peripherals> Display> Screen Size?

Solution:
  1. Navigate to \etc\x11\xorg.conf
  2. Make a backup of this file as \etc\x11\xorg.conf.orig
  3. Edit the file in KEdit - or any other editor
  4. Scroll to Section - "Screen"
  5. Edit Subsection "Display" with new resolution
Here I have changed the resolution from 800x600 to 1024x768

Section "Screen"
Identifier "Screen0"
Device "VMware SVGA"
Monitor "vmware"
# Don't specify DefaultColorDepth unless you know what you're
# doing. It will override the driver's preferences which can
# cause the X server not to run if the host doesn't support the
# depth.
Subsection "Display"
# VGA mode: better left untouched
Depth 4
Modes "640x480"
ViewPort 0 0
EndSubsection
Subsection "Display"
Depth 8
Modes "1024x768"
ViewPort 0 0
EndSubsection
Subsection "Display"
Depth 15
Modes "1024x768"
ViewPort 0 0
EndSubsection
Subsection "Display"
Depth 16
Modes "1024x768"
ViewPort 0 0
EndSubsection
Subsection "Display"
Depth 24
Modes "1024x768"
ViewPort 0 0
EndSubsection
EndSection



Restart the box and you should have the new resolution

Thursday, April 23, 2009

Generate Public Key Token of a signed assembly

I had to google a little for this. Finally found some help. Listing it down here. I lost my bookmark. Thanks to the guys who found this out.

  1. In Visual Studio 2005, click Tools -> External Tools...
  2. Click Add and enter...
  • Title: GeneratePublicKeyToken
  • Command: C:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\Bin\sn.exe (or search for sn.exe and add that path)
  • Arguments: -Tp "$(TargetPath)"
  • Uncheck all options, except Use Output window
A new entry is listed in the Tools menu titled GeneratePublicKeyToken



Build the dll once and the select this menu item from the Tools menu. You will have the blob and the Public Key Token in the Output Window



Improve your java code quality

Jivelint is a nice utilty to analyze the code that you have written.
Worth a look.

Its command line and one can switch on/off configuration options

Unzip an archive with Perl

I keep this template around to work with zipped archives. Helps...

use Cwd;
use File::Find;
use File::Basename;
use Archive::Zip;
use File::Copy;

$working = getcwd();
find(\&process,$working);
sub process(){
my(undef, undef, $ftype) = fileparse($_,qr"\..*");
if ( (-f $File::Find::name) & ($ftype eq "\.zip") ){
my $zipname = $File::Find::name;
my $dest = "$working"."/temp";
my $zip = Archive::Zip->new($zipname);
foreach my $member ($zip->members)
{
(my $extractName = $member->fileName) =~ s{.*/}{};
print $extractName;
#do some stuff here
}
unlink ($dest);
}
}

Perl to batch script

Convert a *.pl to a *.bat through the pl2bat feature.

1. Open cmd prompt
2. cd to the dir where the *.pl script lives

>pl2bat myscript.pl myscript.bat

Easier to send out .bat than .pl files

PPM through proxy server

Something that users(I :)) forget to do on a newly formatted box..

If the Perl Package Manager is not accessible through your proxy then you cannot download/install packages through the ppm. To get around this issue one needs to explicitly specify the proxy server address and the port to use.

Heres the How-To

1. Open cmd prompt
2. type in: SET HTTP_proxy=http://proxy_server:port

Now you should be able to access and install all packages from CPAN.