2009-11-04

Traverse Corporate Firewalls

Sometimes a solution is so secure it becomes insecure.  The primary example of this is requirements for passwords that are so complex that people write them on a note and stick them under their keyboard.

I have several times been locked into a corporate network where the possibility to cooperate with the outside has made my work more complex and expensive.
Limited email storage and chat protocols that don't make it through the router are things that might hinder my work all the way to effectively stopping it.  A limit of 100 megs of email storage makes it impossible to send large emails without risking filling the mail box of a colleague.  Without chat my communication with competence piers is severed.

A slow internet connection makes every search take longer time or give less thorough result.

Then there are hinderances like forbidden FTP, an email washer that stops binaries and source code, or the stopping of youtube in the firewall.

I live in a world, a community, and we communicate.  A big part of my work is to gather information and spread it to interested parties.  Too many times the rules of a corporation network limits this.  Hence workarounds that don't always play well with security but makes my customer happy.  And that is what it is all about, helping your Customer.

Wired has an article http://howto.wired.com/wiki/Traverse_Corporate_Firewalls that explains some workarounds from the dead simple to way more complex.

2009-10-18

Unable to open the physical file Operating system error 5: "5(failed to retrieve text for this error. Reason: 15105)". (Microsoft SQL Server, Error: 5

Try to attach a database with Management Studio when using Windows 7 and SQLServer 2008 developer edition and one might get an error message similar to the title of the article.

Whether this is a bug or not is beyond my knowledge but the solution/workaround is to connect as SA and not as windows authentication.

Login failed for user 'IIS APPPOOL\DefaultAppPool'.

If one uses trusted connection to a sqlserver database under Windows 7 and II7 one might get the error message "Login failed for user 'IIS APPPOOL\DefaultAppPool'." when trying to run a web application.  There are several articles for this but all points to a different GUI than mine (earlier versions of Windows7/IIS7?).

Fire up Internet Information Services Manager.  (window-iis-return)

Find the Application Pools item in the Connections toolbar.  One can reuse the default application pool or create a new one.  Go for the latter since it is slightly more complicated and hence more fun.


I don't know what the settings above do but they seem to work.

Select your newly created application pool and the advanced settings.  Change the Process model to LocalSystem.
(I had planned to create a "better" account with the proper limited rights but ran out of time.  Someone else...?)



As one can see in the listing above the new application pool runs as different identity than the default ones.

Now change your web application to use this application pool.  This could be made simpler by moving the menu for this to the same place as the other menus.  To make the story short - select your site and look to the right of the IIS manager.



That is all there is to it.


2009-10-05

Microsoft Virtual CD-ROM

Microsoft has for a long time had a very simple application for mounting ISO images to look like a CD-ROM.  The application is called Microsoft Virtual CD-ROM Control Panel.

It is hard to locate though.  The very link is here:
http://download.microsoft.com/download/7/b/6/7b6abd84-7841-4978-96f5-bd58df02efa2/winxpvirtualcdcontrolpanel_21.exe
and can for instance be found through here.

It works for 2000?, XP, Vista, 2003, 2008? but not Windows7.

How to install Visual Studio 2008 for TFS

Installing Visual Studio 2008 is a breeze.  Installing it to work with TFS is not so.  It is not even enough to install the Visual Studio 2008 TFS update but one has to install Visual Studio 2008 SP1 as well.  In this written order.

And here is where I got this information.

2009-07-28

Tools I use

Below are the tools, sites and stuff I use.  I plan to update it as it goes.

7-zip
http://www.7-zip.org/
Even though I have a Winzip license I haven't bothered installing it for several years.  I guess Microsoft killed Winzip through having simple zip support out of the box and for all other needs there are 7-zip.
Open source.
Winzip deserves an extra mentioning though due to their license: your payment is also valid for all updates.  Many many other software companies have something to learn there.

Agent ransack
http://www.mythicsoft.com/agentransack/
The built in searching software in Windows XP and forward sucks big time.  To its defense I must say that it searches Microsoft office documents.  But since it doesn't search all folders it is rendered useless for a developer like me.  Agent ransack searches fast, very fast, and has a simple regex tool to refine searches.

Autohotkey
http://www.autohotkey.com/
This open source solution is handy for global shortcuts.  I use it to set the size of windows to cover half the left, right, top or bottom.  I also send my windows between my monitors with a similar keystroke.  It has a wierd scripting language and some bugs regarding how big monitors and windows are.

Blogger
http://blogger.com/
A blogging site.  Less-than-good user interface for writing.  And the UI hasn't been updated for ages. 
Gratis.

Connectionstrings.com
http://connectionstrings.com/
In Windows one have to have a connection string to connect to a database.  These come in all colours and tastes.  This site has a comprehensive list.  Gratis.

Dpack
http://www.usysware.com/dpack/
It is an addin to Visual Studio.  Gratis.  A must-have if you develop in Visual studio.
The most used shortcuts, for me, are alt-u to open files and alt-m to go to a method.  With this there is no more searching for files in the solution explorer or scrolling up and down looking for the right method.

Filezilla
http://filezilla-project.org/
Filezilla is a free FTP server and client.  I only use the client.  I cannot say if it is the best of its crop or has some whiz-bang stuff that oushines the competition but it is free and fairly simple to use.

Keepass
http://keepass.info/
I have lots of passwords and so do most of us.  Instead of having the same password for most places or a system of passwords, use unique ones; then you don't have to worry about people getting your hotmail because they got hold of the passwords for a small site somewhere and successfullly try it on hotmail too.
I have the same database synchronized with my Windows mobile phone; this requires an older version of the software unfortunately, but I keep the passwords with me without the need of a computer.
It is open source so you can inspect the source code at will.

Media-convert.com
http://media-convert.com/
A gratis site for converting all sorts of formats, not only video and sound.

MyGeneration
http://www.mygenerationsoftware.com/
I am a sucker for not writing code I don't have to.  Automatic code generation is the way to go.
Open source.

Notepad2
http://www.flos-freeware.ch/notepad2.html
http://code.kliu.org/misc/notepad2/
I don't think Notepad2 is the best editor out there.  Not even close really.  But it makes it easy to exchange your Notepad.exe with the vastly superior and open source Notepad2.  Notetab does the same pre WinXP and possibly many other editors too but this is the only I have tried (post win2k) and I use it.

NUnit
http://nunit.org/index.php
Automatic testing is considered good.  I might be too much to test everything but the important things and the difficult things are worth while to test automatically.
Open source.

NUnitEx
http://code.google.com/p/nunitex/
This open source extension lib to NUnit makes it more fluent to write assertions.  The best return of investment is when writing tests for exception throwing.

Opera
http://www.opera.com/
This is my primary web browser and has been since before 2000.  For certain development things Firefox is better and one must have Internet explorer around for about one site a year but for the other 8759 hours Opera is to prefer.Web browsers are a pain to user with the keyboard.  Opera lets you navigate between the controls with shift-arrows; so much easier debugging when one doesn't have to grab for the mouse all the time.
Gratis.

Opera mobile
http://www.opera.com/mobile/
Arguably the best mobile browser for fat mobile phones.  It is gratis.
For smaller phones I would use Opera mini that renders the web page in a farm and then sends just the result.  It doesn't work with javascript heavy sites though.
There is an application, Skyfire, that I believe works like Opera mini.

Pastebin.com
http://pastebin.com/
If you ever have tried sending a snippet over email or especially chat you know bad how the layout gets scrambled.  Enter Pastebin.
Paste the code into Pastebin and send the unique URL.  It even has history so when chatting you can update the code and resend.
Gratis.
There are competitors but I havn't found any as good.

PDFCreator
http://sourceforge.net/projects/pdfcreator/
To create PDF documents I use an open source solution.  It installs itself as a printer so it is usable for everything from everywhere.  For reading I use OpenOffice instead of the competitor-for-the-worst-software-written-ever program from Adobe themselves.

PowerCommand for Visual Studio 2008
http://code.msdn.microsoft.com/PowerCommands
Gratis.  Source code available but I don't know if there are any strings attached.
It has Copy reference and Open folder and Open command prompt.  No more tedious searching for references or walking all over the hard drive to find the correct folder.

Spam gourmet
http://www.spamgourmet.com/
An online solution for one time email addresses.  Good for avoiding spam.  It is gratis but it sometimes takes a while for the emails to pass through.Approximately the same result can be gained by having a spare email account for this but Spam gourmet comes with a number-of-possible-sendings solution that might be handy.

VLC
http://www.videolan.org/vlc/
There are many media players.  VLC is one of them.  I use it since it takes most formats.
It went version 1 in 2009.
Open source.There is another well known application, Media player classic, that does approximately the same.  To be honest, I use both.

Winmerge
http://winmerge.org/
This is an open source diff tool.  It has a nice keyboard navigation, something that the diff program that comes with Visual studio has totally messed up.  None of these two have any knowledge about classes and methods so if you swap two methods it is recognized as add and delete instead of the move it really is.
Somewhere I found a program that can diff 3 files at once but the URL is since long forgotten.

2009-07-22

NUnitEx

NUnitEx is an extension to NUnit.  It makes the assertions more of a flow to write.

Instead of writing

string myString = MyMethod();
Assert.AreEqual( "selfelected", myString );
one writes
string myString = MyMethod();
myString.Should().Be.EqualTo( "selfelected" );
A good thing with the former approach is that the coloured syntax makes it easier to distinquish method calls from assertions.

But when one tests exception throwing nunitex is the way to go.

Originally one had to write one method per call that threw an exception.  Even as a happy typist I think it was too much.  Nunitex easily handles exception throwing calls almost as ordinary calls.

See the example code at http://code.google.com/p/nunitex/ for yourself.

2009-07-13

Go to definition VBNet to C#

In visual studio a very handy context menu item is the Go to definition item.  Position you caret on a metod call, open the context menu and choose "Go to definition".  The caret is then positioned on the method.  Press ctrl-minus to go back again.

You cannot do this when a VBNet project calls a method i a C# dll.  The trick here is to instead choose Find all references and choose the correct result row.

Xml comment check

In C#/VBNet there is a nifty thing called Xml comments.  I always use it to explain my methods and classes.  A good thing about Xml comments is that they pop up as intellisense.  Press ctrl-J at your method call and your comments are shown.  The comments survive project boundaries so your well crafted comments in the business layer pop up at the presentation method calls to aid the GUI programmers.

The comments don't travel C#->VBNet though.

In VBNet you get squiggly lines when the method call and the Xml comment don't match.  In C# you have to go through the Analyze->Run code analysis to get the differences.

Visual studio database edition - how to think to get started

Visual studio database edition is part of the "normal" Visual studio.  One cannot be totally sure of this since Microsofts licences are as comprehensible as scientology.

I made two tries at it before I got it to work.  Then it failed me anyway, but that is another posting.

The way to think is to think about the database as source code.  You make changes, compare them to the checked in/commited code and let the machine do its magic merge and check in the result.