mBerube.net
A journey to .Net

A wonderful tool named Process Explorer

Thursday, 29 April 2010 21:34 by mBerube
(Also available in: français)

This week, I had to fight a problem on my girl friend's PC. CPU was always running at 100% and the faulty process was svchost. Not really helpful when we know that it's a really generic program hosting many things in Windows. In that kind of situation, I use  Process Explorer, a free tool originally created by Sysinternals, that Microsoft have acquired. This tool give a lot more informations than task manager (like programme name, dll loaded, etc.) which help finding what's going wrong and fixing it. In my case, it was a buggy HP printer driver (is someone suprised ...)

There's some screenshot from TechNet website

In the Sysinternals tool box, there's many more useful programs to explore. Take some time to take a look.

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5
Categories:   Easiest geek life
Actions:   E-mail | del.icio.us | Permalink | Comments (0) | Comment RSSRss comment feed

Windows Home Server for developer

Thursday, 22 April 2010 22:47 by mBerube
(Also available in: français)

Last year, after the good comments of Scott Hanselman, I decided to try Windows Home Server, a light version of Windows Server 2003. It's a really integrated OS that allow easy file sharing between all home PC (music, photos, videos), easy and complete backup of all the connected machines and allow to backup all this on an external drive to put in a safe place in case the server is destroy, lose or stealed.

I installed it on a old machine (a 10 years old AMD athlon) and it worked pretty well (but I had some stability problem, mostly caused by aging componants). Also, I began to run out of space and IDE HD are hard to find and cost more than SATA. So, I decided to use a real WHS solution, the Acer Aspire Easy Store Home Server:

I used it for a week now and everything is fine. The transfer was very long (400 gb on a 100mb network takes time), that's a really quiet machine, thanks to Atom processor that consume less energy and runs cooler.

WHS come with a connector that allow basic administration of the machine. It gives access to all operations a home user requires. (BTW, MS sells WHS as a simple consumer product that everybody can setup. FALSE. You need some basic knowledge in Windows Security and networking. Geek required !).

It's also a product that can be really useful for a small developers team because WHS allow sharing and backup for up to 10 PC. As a dev, you surely know how to use RDP so you can connect directly to the box and do almost anything you can do in Windows Server 2003. Beware because WHS use a technology called Drive Extender that create a kind of "raid" where all the disks are added and shown as a big storage space:

Dont' use tools like that manage disks (disk management, RAID controller, defragmenter), let WHS do it and use shared folders to transfer your files.

There's 2 interesting things to do with your WHS:

  • WHS allow remote access to files using a web interface. You'll then see that IIS (6.0) is installed and fully functional on the machine and makes it a really good candidate for QA web site before putting them in production. If you need database, I installed SQLServer 2008 Express without problem.
  • That's also a really good place to put your source code repository. Personally, I use Visual SVN to manage my repositories and I've included them to a shared folder (that is included in my backup) so my SVN database is automatically included in my weekly offsite backup. Really great !

Finally, there's many Add-ins availables, mostly on We got served to add more cool features to your server. It's an interesting product and it relatively low price (less than 400$, OS included), makes it a simple and cheap solution for home and work.

P.S : I don' receive anything from MS to comment that product, I'm just a enthousiast user !

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5
Categories:   Easiest geek life | Programmer life
Actions:   E-mail | del.icio.us | Permalink | Comments (0) | Comment RSSRss comment feed

When you spend to much time moderating, introduce a captcha

Friday, 9 April 2010 20:56 by mBerube
(Also available in: français)

After 3 months moderating comments manually, I had to introduce a captcha due to an exponential increase of the spam in the last month. After spending many hours trying to integrate recaptcha, I finally found a post on Code Capers which was exactly what I needed. Thank Michael.

It's simple, a little less secure than recaptcha but should be good enough.

Sorry for the legetimate users but you know like me it's a necessary evil.

 

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5
Categories:   BlogEngine.NET
Actions:   E-mail | del.icio.us | Permalink | Comments (0) | Comment RSSRss comment feed

Using Visual Studio Remote Debugger without domain user

Saturday, 3 April 2010 10:51 by mBerube
(Also available in: français)

Looking for the bug I talked about in my previous post, I had to run remote debugger on my QA server. I do it daily at work but we are in a domain so as long as your user has administrator rights on the remote server, you're good to go. But at home, I don't have a domain so it's a little bit more complex. I did some search on the web and I get tricks and tips for different sites I've decided to put together here. For the examples, consider that setup:

  • A PC
  • A WS 2003 server running IIS 6.o under the default credentials (Network Service)
  • A PC user named MyLocalUser

Scenario 1 : MyLocalUser is administrator on Server

In that scenario, it's pretty simple. Simply make sure you have the remote debugger on the server (if not, copy it from PC, it's usually located at C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\Remote Debugger\x86) and start msvsmon . If you're logged on the server with MyLocalUser, you're done. It not, make sure to start msvsmon by right clicking it and use Run As.. option. Enter MyLocalUser credentials.

Your remote debugger is now running.

Finally, in Visual Studio, choose "Tools\Attach to process...", in Qualifier, enter the server name as given by the remote debugger (in our case, MyLocalUser@SERVER) and be sure to check "Show Processes for all users" and "Show processes in all sessions". Choose w3wp process and you're ready to debug.

Scenario 2 : MyLocalUser is not administrator on Server

If MyLocalUser isn't an administrator on the server (but is defined as an regular user) and you don't want to give it,  there's another solution. It's almost like scenario 1 but we'll create an account on both PC and server only for remote debugging purpose:

  1. Create an account (lets call it RemoteDbgUser) on PC and server with the same password. This account must be admin on the server but it's not required on PC.
  2. On the server, start the remote debugger with "Run as" and enter RemoteDbgUser credential.
  3. In Remote Debugger, under "Tools\permissions", give access to MyLocalUser to debug (see image below).
  4. On PC, in Visual Studio, go to "Attach process" and enter RemoteDbgUser@SERVER as qualifier

Voilà ! I hope it will help you, it took me about an hour to figure that all so follow these steps and you'll save some extra time to make your project better

Thanks for reading

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5
Actions:   E-mail | del.icio.us | Permalink | Comments (0) | Comment RSSRss comment feed

Little bug, big night

Thursday, 1 April 2010 22:44 by mBerube
(Also available in: français)

Last week, I was trying to find a bug on this blog (with the Next/previous page link). Because I've done a lot of changes in BlogEngine.Net to allow multiple languages, I started by looking into my code. The situation was that the link was formatted like this : http://blog.mberube.net/en/?page=2 (without the page name). There's the results of my tests :

  1. On webdev server (Cassini), it worked.
  2. On my local le IIS 7 on Win7, it worked.
  3. On my QA web server (IIS 6 on WS2003), it didn't work.
  4. On my hoster (Proweb) server on II6 on WS2003, it didn't work either.

 

So good sign : I can reproduce the bug on my QA server. But to find it, I had to fight a lot with the Remote Debugger and I'll talk about this in another post, giving the instructions how to setup and use remote debugger on a network without domain users. 

I finally found that because the path had no file name, IIS was rejecting the request before the URL rewriter in my application could resolve it. On my QA server, I added the ASP.Net engine in wildcard application maps for all files not found and it works at first try. Yé !

 

I did exactly the same thing on my hosted server, it doesn't work. Hmmmm... 

I did a quick fix for the bug but I would like to understand that mystery. If you have suggestions or ever solved that kind of issue, please leave a message.

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5
Categories:   BlogEngine.NET
Actions:   E-mail | del.icio.us | Permalink | Comments (0) | Comment RSSRss comment feed