February 2009

You are browsing the site archives by month.

Slow IIS on Vista with Firefox, Chrome or Safari

Ever noticed that sites are way slower in Firefox / Safari / Chrome and so on when you try to debug a website localhost on Vista.  Apperently there is some kind of DNS bug caused by IPv6. To fix it in Firefox you can type about:config and look up network.dns.disableIPv6 but this doesn’t fix the issues for other browser.

To fix it system-wide for all browsers edit your hosts file. You find it in %SystemRoot%System32driversetc.       localhost
::1             localhost <- Comment this line       .host

Thanks to commenter in this post for this.

Publicerat av den

Some errors settings up PHP on Windows Server 2008

I spent the day trying to setup a fallback server if our production server should burn up or something. I got a error messages when setting up PHP on my Server 2008 machine that i wanted share here.

HTTP Error 404.17 – Not Found – The requested content appears to be script and will not be served by the static file handler.

And this problem was kind of simple to figure out. This post by Scott Hanselman pretty much explains it. If you running a 64bit server you have to create a AppPool that support 32bit because the php5isapi.dll apprently is compiled in 32bits.

Publicerat av den

file_get_contents() in asp.net/C#

The URL shortening service http://bit.ly has a really simple and convient API that lets just get a short url like this.


I’ve used this in a wordpress installation with PHP before and there i could just do.

$twitter_url .= file_get_contents('http://bit.ly/api?url=' . get_permalink());

Simple and clean. But today i wanted to do the same thing with asp.net and found myself kind of lost. At last i came up with this, not as simple solution. But it works.

string shortUrl = new StreamReader(WebRequest.Create("http://bit.ly/api?url=http://fragor.ohsohightech.se" + Url.Action("Question", new { number = question.Number, title = question.Title.ConvertTextToUrl() })).GetResponse().GetResponseStream()).ReadToEnd();
Publicerat av den