Thursday, January 24, 2008

IPKG Update Problems

When attempting to run the command to update ipkg on a new unslung box I kept seeing the following issue.

user@machine ~> ipkg update
ipkg_conf_init: Failed to create temporary directory `(null)': No such file or directory


Since I hadn't set up an unslung box in quite awhile I couldn't remember how I'd fixed this before after I switch over to using bash instead of the default sh. Then like a flash it hit me...temporary directory genius.

user@machine ~> mkdir ~/tmp

Now it works like a charm.

Tuesday, January 22, 2008

Synchronize/Update Time on Active Directory DC

Recently while performing some updates on a couple of DC on a Windows only corporate network I noticed the time seemed off by more than 10 minutes. After a little investigation it appears that the time wasn't being updated. Using Google as my dear online search friend I came across this post. The script has been saved to a .bat file that is run on as a schedule task now so the problem is a thing of the past (pun intended).

On the main DC:
NET TIME /SETSNTP:time.windows.com
NET STOP W32TIME
NET START W32TIME
W32TM /config /reliable:YES
W32TM /resync /rediscover


On all other DCs:
W32TM /resync /rediscover

Thanks Chrissy for the good work on that one and make sure to visit Chrissy's blog.

Tuesday, January 1, 2008

Microsoft Word 2000 Unspecified Code Execution Vulnerability

What can you do about it, nothing until Microsoft issues a patch but you should be aware of it. Here is the overview from SecurityFocus:


Microsoft Word 2000 is prone to an unspecified remote code-execution vulnerability.

Microsoft Word 2000 is confirmed vulnerable to an unspecified remote code-execution issue. Exploit attempts against Word 2003/XP will consume all CPU resources and will cause a denial of service for legitimate users.

Note that this issue is distinct from issues described in BID 21589 (Microsoft Word Code Execution Vulnerability), BID 21451 (Microsoft Word Unspecified Remote Code Execution Vulnerability), and BID 21518 (Microsoft Word Unspecified Code Execution Vulnerability).


The only preventative measure being offered currently is this one by Symantec.


To protect yourself against these threats, do not trust unsolicited files or documents about “interesting” topics. Do not open attachments unless they are expected and come from a known and trusted source.

SharePoint 2003 Menus (MSOWebPartPage_OpenMenu)

As we were attempting to add custom menus to SharePoint 2003 we discovered that is was actually pretty easy using a built in JavaScript function provided (and utilitized) by SharePoint. The function name is MSOWebPartPage_OpenMenu and the problem was that the posts we found discussing how to do it with SharePoint seemed to indicate that the function allowed some optional parameters but we couldn't seem to locate an online reference describing the function in detail. Since we're not SharePoint 'gurus' we did a search of our server which indicated that it was getting pulled from the IE55UP.js file.


function MSOWebPartPage_OpenMenu(MenuToOpen,SourceElement,WebPart,InConnectionsMode)
{
if(WebPart)
{
MenuWebPart = WebPart
MenuWebPartID = WebPart.WebPartID;
var minOption = MenuToOpen.all.item('MSOMenu_Minimize');
var restoreOption = MenuToOpen.all.item('MSOMenu_Restore');
var closeOption = MenuToOpen.all.item('MSOMenu_Close');
var deleteOption = MenuToOpen.all.item('MSOMenu_Delete');
var exportOption = MenuToOpen.all.item('MSOMenu_Export');
var resetPersOption = MenuToOpen.all.item('MSOMenu_RestorePartDefaults');
var helpOption = MenuToOpen.all.item('MSOMenu_Help');
var connectionOption = MenuToOpen.all.item('MSOMenu_Connections');
if(minOption)
{
minOption.style.display = (WebPart.allowMinimize == 'false' || WebPart.style.display == 'none') ? 'none' : '';
}
if(restoreOption)
{
restoreOption.style.display = (WebPart.allowMinimize == 'false' || WebPart.style.display != 'none') ? 'none' : '';
}
if(closeOption)
{
closeOption.style.display = (WebPart.allowRemove == 'false') ? 'none' : '';
}
if(deleteOption)
{
deleteOption.style.display = (MSOLayout_inDesignMode && WebPart.allowDelete != 'false') ? '' : 'none';
}
if(exportOption)
{
exportOption.style.display = (WebPart.allowExport == 'false') ? 'none' : '';
}
if(helpOption)
{
helpOption.style.display = (WebPart.helpLink == null) ? 'none' : "";
}
if(resetPersOption)
{
resetPersOption.style.display = (MSOLayout_inDesignMode && WebPart.HasPers == 'true' && WebPart.OnlyForMePart != 'true') ? '' : 'none';
}
if(connectionOption)
{
connectionOption.style.display = (MSOLayout_inDesignMode ? '' : 'none');
}
if(InConnectionsMode != 'False')
{
var connMenu = document.all.item('MSOMenu_Connections'+WebPart.id);
if(connectionOption != null && connMenu != null)
{
connectionOption.outerHTML = connMenu.innerHTML;
}
}
}
try
{
if (!MenuToOpen.isOpen()) MenuToOpen.show(SourceElement, true);
}
catch(e)
{
}
}


In case you're looking for how to build a menu in SharePoint see these links:
SharePoint Menus - roll your own
WSS Navigation

ASP.NET - Store ViewState in Database using VB.NET

We had finally crossed the barrier of ViewState performance and were watching our application performance drop signficantly. I did the usual websearches and arrived at two solutions: 1) start changing major bits of code to not use ViewState and/or 2) store ViewState in the database.

This page made it seem easy however the one issue was that we're using VB.NET and not C#. From some additional searching it appeared that no one had made the change to store it in the database using VB.NET so I decided to go after it. It really didn't take long to recode in VB.NET however I know there are a few issues with the code (i.e. it is ugly and uncommented) however I wanted to get something out there in the event it helps someone out sooner than waiting and not getting it posted for another month or two.

SqlViewState Class
Database Code

To use just change your code to inherit from the class instead of the System.Web.UI.Page. The performance difference in our case was significant. We know we need to move to AJAX however when we started the AJAX stuff was not mature enough for our use so this solution is easy to implement and we saw a 5% to 30% increase in performance. If you look at the source of the page you'll see the following:


<input type="hidden" name="__VIEWSTATEGUID" value="130adb08-0644-470a-9c3b-0cc630defd32" />
<input type="hidden" name="__VIEWSTATE" value="" />

Tuesday, December 18, 2007

Sysinternals [Now Windows Sysinternals]

If you haven't heard of Sysinternals you've been missing out on some of the best diagnostic utilities for Windows on the free market. The site was originally started by Mark Russinovich and Bryce Cogswell back in 1996 and through the years has offered some great utilities that helped make keeping an eye on a Windows box or diagnosing problems much easier. Now that they've been bought by Microsoft they are a part of 'The Collective' so I'm posting the direct link to cut through the TeraBytes of data on the Microsoft Technet Website.

Tuesday, December 11, 2007

Play DVD ISO In VLC

After ripping some DVDs I purchased that appear to have been made using a home computer DVD burner or something simple I couldn't get the ISO files to play in VLC using the usual method. After a few minutes of looking around VLC I found the solution, these DVDs did not have menus so it was cause VLC to not load the ISO, switching to the command that exists for DVDs without menus we were off to the races.

user@machine~> vlc dvdsimple:///videos/Buckshot/10_Homemade_Traps.iso