tag:blogger.com,1999:blog-75284362024-03-08T08:36:30.951+00:00Rouge DelimiterUnknownnoreply@blogger.comBlogger8125tag:blogger.com,1999:blog-7528436.post-66521838345849260492007-03-06T01:17:00.000+00:002007-03-06T01:25:52.544+00:00Fix for Could not load NUnit.core errorSpent a few hours today trying to find out why i suddenly started getting <br /><br />System.IO.FileNotFoundException: Could not load file or assembly 'nunit.core, Version:2.2 ......' or one of its dependencies.<br /><br />Turns out there was the config file was not valid xml. so if the nunit project was MyProject.nunit and then the config file MyProject.config had invalid xml content.Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-7528436.post-37037392069748063422007-01-05T14:46:00.000+00:002007-01-05T14:55:26.203+00:00Here's some powershell script/command to find who is logged in on a RemoteMachine.<br /><br /><span style="font-size:85%;color:#000099;">Get-WmiObject -computerName ComputerName -class Win32_ComputerSystem -Property UserName | findstr UserName</span>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-7528436.post-29612031006075704992007-01-03T16:41:00.000+00:002007-01-05T16:45:00.519+00:00Finding dependencies for .net assembliesHave you had .net assembly version mismatch problems?<br />How do you find which assembly is referencing an older version of some shared assembly? <br /><br />Here is a powershell script to list out all the dependencies for all the files in given folder (typically bin/debug or bin/release)<br /><a href="http://rougedelimiterfilestore.googlepages.com/dependencies.ps1">Get script here</a><br /><br />what it does is really easy and i must give credit to <a href="http://blog.opennetcf.org/ncowburn/2005/03/01/DetermineAssemblyDependenciesUsingReflection.aspx">this guy</a>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-7528436.post-58462958820633186542006-12-22T17:37:00.000+00:002006-12-22T17:58:58.073+00:00Powershell Network Scan - ScriptHere's the code/script for network scan I was talking about in previous post <a href="http://rougedelimiter.blogspot.com/2006/12/powershell-network-scan.html">here</a><br /><br /><pre><br />function HandleShare<br />{<br /> $share = $args[0];<br /> write-host ***Scanning Share $share<br /> #write-host net use X: $share <br /> $erroractionpreference = "SilentlyContinue";<br /> $files = Get-ChildItem -recurse -name $share $fileType <br /> $erroractionpreference = "Continue";<br /><br /> foreach($file in $files)<br /> {<br /> if($file.length -gt 0)<br /> {<br /> $filepath = $share + "\" + $file;<br /> write-host $filepath<br /> }<br /> }<br /><br />}<br /><br />function HandleHost <br />{<br /> $hostname = $args[0];<br /> $hostname = $hostname.substring(0, $hostname.indexof(" "))<br /> #write-host "***Scanning Host " + $hostname;<br /><br /> #List shares.<br /> $shares = net view $hostname | findstr " Disk" <br /> foreach($share in $shares)<br /> {<br /> if($share.length -gt 0)<br /> {<br /> $tmp = $share.substring(0, $share.indexof("Disk"));<br /> $tmp = $tmp.Trim();<br /> $tmp = $hostname + "\" + $tmp;<br /> HandleShare $tmp;<br /> }<br /> }<br />}<br /><br />function DisplayUsage<br />{<br /> write-host<br /> write-host -foregroundcolor green "Usage:"<br /> write-host -foregroundcolor green " scan.ps1 fileType maxNoOfMachines"<br /> write-host -foregroundcolor green " e.g. scan.ps1 *.txt 10"<br /> write-host<br />}<br /><br />function Main<br />{<br /> $hostnames = net view | findstr "\\";<br /> foreach($hostname in $hostnames)<br /> {<br /> $maxNoOfMachines = $maxNoOfMachines - 1;<br /> if($maxNoOfMachines -lt 0)<br /> {<br /> exit;<br /> }<br /><br /> HandleHost $hostname;<br /> }<br />}<br /><br />#<br /># Initialise<br />#<br /><br />#Guard against un initialised variables. aka, typos<br />set-psdebug –strict<br /><br />#using $fluff as i dint like LoadWithPartialName o/p somethign to console.<br />$fluff = [reflection.assembly]::LoadWithPartialName("'Microsoft.VisualBasic")<br /><br />#<br /># Validate input paramters<br />#<br />if($args.count -lt 2 -or $args.count -gt 2)<br />{<br /> DisplayUsage;<br /> exit;<br />}<br />if(-not([Microsoft.VisualBasic.Information]::isnumeric($args[1])))<br />{<br /> DisplayUsage;<br /> write-host -foregroundcolor Red "Error:"<br /> write-host -foregroundcolor Red " Second paramter should be numeric."<br /> write-host<br /> exit;<br />}<br /><br />#<br /># Convert args into variables which are used through out this script.<br />#<br /><br />$maxNoOfMachines = $args[1];<br />$fileType = $args[0]; #Global variable used in HandleShare.<br />#$maxNoOfMachines = 30; #Global variable used in Main.<br /><br />#<br /># Start actual work<br />#<br /><br />Main;<br /><br /></pre>Unknownnoreply@blogger.com1tag:blogger.com,1999:blog-7528436.post-77029052824158866942006-12-21T22:21:00.000+00:002006-12-21T22:56:16.820+00:00Christmas gift wrapping scam.We all know what it is like to shop till you drop and then come home and gift wrap them all. Not so much fun is it? Enter Gift Wrapping Services for "a price of a small fee". Just what we want, have cuppa tea, think over have we missed anything or anyone, while someone gift wraps all them million things. One thing off your mind right?<br /><br />Wrong. Hand over your shopping to any Tom, Dick and Harry and they could switch your expensive perfume with a potato or may be an onion. It wont be funny when come Christmas morning, whoever tears into their gift and finds what, "a potato!".<br /><br />So the best option is to get your gifts wrapped while you actually buy them otherwise you better know what you are doing.Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-7528436.post-64942147629201431412006-12-15T12:03:00.000+00:002006-12-21T22:57:47.080+00:00Powershell network scanSimple scan all shares on all machines a given windows domain for a give file type. say scan local network for mp3?<br />should be handy right ;)Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-7528436.post-11253240153028625632006-12-14T00:42:00.000+00:002006-12-21T22:58:47.467+00:00IE automationLately had to work on asp.net based <span onclick="BLOG_clickHandler(this)" class="blsp-spelling-error" id="SPELLING_ERROR_0">workflows</span>. Awfully, painful having to fill in all that test data over several pages just to get to say page 8/10 to do some basic unit testing. Thanks to <span onclick="BLOG_clickHandler(this)" class="blsp-spelling-error" id="SPELLING_ERROR_1">DHTML</span>/JavaScript, No <span onclick="BLOG_clickHandler(this)" class="blsp-spelling-error" id="SPELLING_ERROR_2">Nunits</span>/<span onclick="BLOG_clickHandler(this)" class="blsp-spelling-error" id="SPELLING_ERROR_3">NunitAsp</span> to rescue here!<br /><br />Being as mind buggering as that, i had following options:<br /><ol><li>Don't do any unit testing but loose friends and eventually job.</li><li>Do unit testing but loose sanity.</li><li>Quit and find another job. but how far could i run?<br /></li><li>Find some "free" IE automation tool or GUI testing tool which allows easy recording and playing back browser sessions. Preferably via <span onclick="BLOG_clickHandler(this)" class="blsp-spelling-error" id="SPELLING_ERROR_4">nunit</span> but <span onclick="BLOG_clickHandler(this)" class="blsp-spelling-corrected" id="SPELLING_ERROR_5">beggars</span> can't be choosers so anything else will do, just make it "quick and easy".<br /></li><li>If not found, write one. Like it, ride my hobby horse and charge on to windmills.</li></ol>Options 1-3: are out of question as i am lazy.<br />Option 2 :If money can't buy you friends, unit testing ones own code definitely can. <span onclick="BLOG_clickHandler(this)" class="blsp-spelling-error" id="SPELLING_ERROR_6">hmm</span>... what a life to live.<br />Option 4: sounded promising and it indeed was. There is <span onclick="BLOG_clickHandler(this)" class="blsp-spelling-error" id="SPELLING_ERROR_7">Watir</span>, "Web Application Testing in Ruby" and some such in <span onclick="BLOG_clickHandler(this)" class="blsp-spelling-error" id="SPELLING_ERROR_8">perl</span> too. Then there is Selenium. They are pretty good frameworks and here's some comparison<br />http://opensource.thoughtworks.com/papers/WatirAndSelenium.jsp<br /><br />oh! and now there is <span onclick="BLOG_clickHandler(this)" class="blsp-spelling-error" id="SPELLING_ERROR_9">Watij</span> (<span onclick="BLOG_clickHandler(this)" class="blsp-spelling-corrected" id="SPELLING_ERROR_10">pronounced</span> wattage not Wat-is-e)<br /><br />while <span onclick="BLOG_clickHandler(this)" class="blsp-spelling-error" id="SPELLING_ERROR_11">oogling</span> and googling these things it became clear that it can't be that difficult to write a tool to scratch my itch exactly as i want it.<br /><br />It is as simple as hosting a browser, hook up a few change event handler for recording and playback is just is even easier. How difficult can it be to find a unique identifier for whatever html element has been clicked, get its value and save it say an <span onclick="BLOG_clickHandler(this)" class="blsp-spelling-error" id="SPELLING_ERROR_12">xml</span> file. To play the session back, read each element id from <span onclick="BLOG_clickHandler(this)" class="blsp-spelling-error" id="SPELLING_ERROR_13">xml</span> and do document.all(id) and then call corresponding set value. If the tool is meant to help me <span onclick="BLOG_clickHandler(this)" class="blsp-spelling-error" id="SPELLING_ERROR_14">nunit</span> test my code, i can surely put a silly id on <span onclick="BLOG_clickHandler(this)" class="blsp-spelling-corrected" id="SPELLING_ERROR_15">everything</span> that has a some interesting behaviour. Guess pop-ups will a hassle but perhaps some nifty <span onclick="BLOG_clickHandler(this)" class="blsp-spelling-error" id="SPELLING_ERROR_16">autoit</span> script can come to help.<br /><br />let see ...Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-7528436.post-1088919131225145922004-07-04T06:25:00.000+01:002006-12-14T02:18:24.307+00:00The beginningJust because one don't know anything about it, doesn't mean it doesn't exist. may be its in coming, who knows.Unknownnoreply@blogger.com