Tag Archives: tip - Page 3

IlSpy

Until fairly recently you could use a free tool called Reflector to view/disassemble .Net libraries to see what is going on inside them. The company making this tool got greedy and is now charging for it – not nice of them. Fortunately another team of developers started creating another open source tool with similar functionality – IlSpy.

It also support plug-ins so it is also extendable. Nice!

Tweaking your SSD

Toms hardware has an article about ways to optimize both performance and capacity of your SSD drive. I have one at home and will definitely run through their check list to try and optimize the drive – for speed, capacity and lifespan.

http://www.tomshardware.com/reviews/ssd-performance-tweak,2911-16.html

Some optimizations work differently on different SSD drives – depending on how the manufacturer implemented their hardware. Some ‘optimizations actually can make things worse so be sure to compare things before and after the change before you just accept it. Some optimizations might even be a bit controversial like the disabling of the paging file. It really depends on what you’re willing to sacrifice to reach a level of performance you can live with.

Force IIS to use NTLM

Today I’ve learned something new/old again. I’ve been having problems with an application that is running on IIS (6) where it kept on giving the error “HTTP Error 401.1 – Unauthorized: Access” when you try to access it by the machine name e.g. http://machineName/AppName. If you use the IP address then it works fine e.g. http://ipadress/AppName.

The application must use Integrated security because it only allows certain people to access it or only some people have full read and write functionality. In the code I must identify which user is logged on so it also make use of impersonation. To make sure the application itself has access to some databases it runs under an application pool that is configured under a domain account.

After some searching I came across the following kb article:

http://support.microsoft.com/kb/871179

The second workaround turns out to solve the problem. It turns out IIS6 does not authenticate the user correctly if only Integrated security is selected (anonymous is turned of) plus the application runs under an application pool that is configured with a different account (other than local system or network).

Update: Just to simplify searching for a workaround here is a copy of the text of the KB:

Workaround

To work around this behavior if you have multiple application pools that run under different domain user accounts, you must force IIS to use NTLM as your authentication mechanism if you want to use Integrated Windows authentication only. To do this, follow these steps on the server that is running IIS:

  1. Start a command prompt.
  2. Locate and then change to the directory that contains the Adsutil.vbs file. By default, this directory is C:\Inetpub\Adminscripts.
  3. Type the following command, and then press ENTER:
    cscript adsutil.vbs set w3svc/NTAuthenticationProviders “NTLM”
  4. To verify that the NtAuthenticationProviders metabase property is set to NTLM, type the following command, and then press ENTER:
    cscript adsutil.vbs get w3svc/NTAuthenticationProviders

    The following text should be returned:

    NTAuthenticationProviders       : (STRING) "NTLM"

Of course, doing this you do at your own risk 🙂

Center an html table

Quick tip.

Since css is the more ‘accepted’ way to apply formatting to html I discovered that the normal styles like align:center or text-align:center does not work anymore to center an html table horizontally.

Instead to be able to do it you need to add the following css definition:

table
{

margin-left:auto; margin-right:auto;

}

That will make it work in Firefox but not IE (9 as tested). To get IE to display it properly you need to enclose the whole table inside another tag – like a div:

<div class=”centerme”>

<table>

…

</table>

</div>

plus add css for the div:

div.centerme
{

margin-left:auto; margin-right:auto;text-align:center;

}

Not pretty but it works.