she swears <i>geek</i> is a term of endearment

Windows Server 2003 TortoiseSvn / Subversion Lock Corruption

December 4th, 2008 Rusty

Holy CRAP!

I tried to commit my changes to svn and was greeted by a very distressing message: “cannot delete lock, the directory is corrupt or unreadable”.

I tried a few hacks to get around it but apparently my trunk was littered with these unfortunate locks. I have no idea what this means at a low level except that either Windows or Svn(or tortoise) took a big fat dump in my directory

Google to the Rescue

As usual, Google turned up forums where people had the same issue. The only suggestion was to run chkdsk on the drive. One person reported success using a utility called “unlocker” but indicated that the program ran chkdsk. Ok, how do you do that, exactly? in VMWare?

Running Chkdsk under VMWare Fusion

Turns out its really easy. Bring up a command line and type “chkdsk /R C:”. You’ll be told the volume is currently in use and asked if you’d like to run chkdsk the next time Windows is restarted. Answer “Y” and then reboot.

During step 2 of 5, chkdsk reported 15 variations of “Deleting index entry lock in index $130 of file 38956″. That sure sounds like my problem. I hope it is because step 4 of 5 takes forever. It might be wise to use the commandline switch that tells chkdsk to do a less vigorous check of files. I didn’t so I am waiting…

Vista to XP to Server 2003

I started using Vista on this computer and finally just couldn’t take the slowness anymore. I switched to XP but soon realized that all the locked down features were getting in my way. I am now developing on Windows Server 2003 and until today, was very, very happy. Now I am waiting to Windows to do its funky chicken dance, yet again. At least Server tells me what it is doing while I am unable to get my work done. Vista wasn’t nearly so communicative. Its like having a good friend who always says that really offensive thing at the most inopportune time. 90% of the time, you are having a good time. Every now and then you’d like to kick him in the teeth.

hey, thirty minutes later and its done!

..and the verdict is: (waiting… waiting… waiting… ugh! still waiting… FIXED

IBM Thinkpad 600e resurrected

November 17th, 2008 Rusty

Lou, of OckhamResearch.com, had an old IBM Thinkpad 600e sitting on a shelf elevating some boxes of archived papers.  My 5yo son was visiting me at work and wanted to "type on the computer" so I tried to fire it up.  It booted to the log in screen but I didn’t have the password.  My son proceeded to draw on the white board.  When he’s 15, I’ll just be a geek with a dorky job but for now daddy’s office is fun.

Stop Taunting Me You Silly Twit!

The thinkpad sat there, requesting a password, for several weeks.  Lou didn’t know the password either so there it sat, taunting me. 

Showing My Age

I grew tired of staring at a Windows NT Workstation…

Memory
All alone in the moonlight
I can smile at the old days
I was beautiful then

…prompt so I tried to wipe it and install Windows XP.  The machine boasts a mind blowing Pentium II 366mhz processor with 280MB RAM and a 12 Gig Hard Drive. 

Crash & Burn

Upon installing XP, I was greeted by the always ever popular Windows BSOD (blue screen of death).  I don’t keep a copy of NT lying around so it was off to Linux world for something that might not crash on this barely used, completely not useful little IBM notebook.

p.s. Wouldn’t it be funny if computers got grey hair and wrinkles like we do? 

Plan B

I burned a cd of Ubuntu from their website using my Mac…

Friday night and I need a fight
My motorcycle and a switchblade knife
Handful of grease in my hair feels right
But what I need to make me tight are those…

…uh, where was I?  I ran the installer, answered several questions about where I am and how I like my stuff displayed, and launched into a fully functional, very useful and pleasing to use Ubuntu desktop.  For the uninitiated, it comes pre-installed with the O/S (duh), Open Office (Word Processing, Spreadsheets, Presentation), Firefox Internet Browser, a bunch of games, a sound recorder, Gimp Image Editor, Photo Manager, Open Office Drawing, Ekiga Soft Phone, Pidgin IM, Transmission BitTorrent Client, Movie Player, Rhythmbox Music Player, the list goes on…  it comes loaded with useful programs.  It does not however have any of the following included with the installation: trials to aol, msn or netzero; dell notifications irritator, Lenovo restore manager; background update managers; heavy device management utilities; alternate network management or power profile sub systems; OEM crapware.  Of course, a fresh install of XP doesn’t have that junk either but then you have to spend several hours assembling all that other stuff and it is not, well, free.

Sweeeeeeeeeeeet, psych!

To see if my new Linux dog could hunt, I launched Firefox.  Aw, snap!  No wireless.  Wireless was a luxury in 1999.  I can hardly remember such a time.  So I looked into the possibilities and found that this old monster used cardbus architecture.  Those were little laptop cards we used to have to buy to enable mobility in mobile computers.  You kids are too young to remember. 

I seem to recognize your face
Haunting, familiar, yet I cant seem to place it
Cannot find the candle of thought to light your name
Lifetimes are catching up with me

Amazon had a 802.11G Wireless Xtreme Cardbus Adapter (D-Link Wireless 108G) for $8 plus shipping.  For $15 I was willing to give it a shot.  In two business days, my new cardbus adapter and "Programming in Objective C" book arrived (I never order just one thing from Amazon).  I opened it up (the card) and hoped to see a Linux install option…

The time is right your perfume fills my head, the stars get red
And oh the night’s so blue
And then I go and spoil it all, by saying something stupid  

My heart sank as I realized I have no experience with Linux and I didn’t know how to get, much less install, drivers for Linux.  Visions of vi filled my head.  In the mean time, I shoved the card in the slot and watched as the green lights began to blink.  Then, as I clicked on the network icon near the top of the screen, I found that it had "installed itself".  The computer discovered and enabled the card and the networks were listed in the available networks box.  I had to provide my password 3 times, resulting in a timeout on the first 2, but since that time it just connects when it boots like a good little computer should.

Wow is all I can say.

So now we have, for the investment of about 30 minutes and $15 for a wireless card, an extra laptop.  It works perfectly for browsing the Internets and will be a perfect machine for my son to type on when he visits me at work.  Should he spill his chocolate milk slammer down into the keyboard, it will go back on the shelf from whence it came.

I can’t speak to whether it would be a good choice for a student as their teacher is going to be using Windows.  I don’t know exactly how interoperable Open Office is with MS Office but I can tell you that its not as sexy or easy to use. MS Office sets the standard there.  However, for an extra computer that is constrained on cpu or memory or both, its a perfect way to get a little extra life out of something that was otherwise beyond its functional lifespan.  You don’t have to worry about viruses and its inherently secure and stable. 

Ftp on Windows

September 12th, 2008 Rusty

This morning I needed to copy a 300 MB file from my dev server to my local machine.  I was lazy and Windows Explorer was already open.  So I called up my ftp:// url and copied the file to my local folder.  It showed 1 hour and some odd minutes to complete.  That’s an amazing 50k per second!  Wow…  broadband has brought us so far. 

2 hours later, the dialog stated 39 minutes remaining.  Hmmm, perhaps that initial prediction was a little fuzzy.  Vista must be applying some fractal logic to determine how long things should take.  Then, KABOOM.  "Windows was unable to copy the file"

Now I remember why I started using FileZilla and why I stopped hating ftp.

So I launched old FileZilla, connected to my same server, and copied the same file.  Now I can see that it, indeed, is achieving around 40k per second.  FileZilla handles communication issues much better.   I failed to time it but I was able to leave the transfer window minimized and continue on with other work.

I still don’t like ftp but no-one has really come up with a great alternative.  Although I am now checking out Drop Box.  Looks promising…

SugarCrm missed mustard, passes gas

August 29th, 2008 Rusty

I hate to be critical and negative but someone ought to benefit from the half day I lost evaluating a tool that stinks like yesterday’s chili at breakfast.

I installed SugarCRM yesterday as it appeared to be the tool for Crm in the Open Source space.  I was also excited that it supports MS SQL Server.  I liked the idea of being able to use my comfort tools for digging through the data.

When I launched the app, I noticed that it was pathetically slow.  I mean,   s   l   o   w  . . .

I tried all my tricks to speed it up but the reality is that there are just too many huge include files.  The server tends to respond in less than 10 seconds for the most complicated pages (less than 1 second for some) but no page loads in less than 6.  Most pages take more than 30 seconds! 

Using firebug, I measured the download of several pages.  I installed on Windows IIS using SQL Server with the demo data installed.  I was the only user hitting the server.

I clicked on "Create New Opportunity" and the page note indicated: "Server response time: 2.54 seconds."  However, the icons and images took more than 20 seconds to finish loading.
Granted, I could probably have used the page after ten seconds but that is far too long to wait considering I expect early users to have to click a few times to find what they are looking for. 3 clicks at 30 seconds is not acceptable.3 clicks at 60 is completely unmanageable.

I tried clicking on Dashboard and "Server response time: 12.48 second" but the page took more than 60 seconds to display content.

I tried to reindex tables and set content expiration on the themes and includes directory but this didn’t help much at all.

Using Firebug, loading the "Emails" default tab, the total is:
140 requests 2.25 MB (0 b from cache) 33.8s
That is HUGE. a plain refresh results in: 39.77s
Oucharama!

 

I am now trying vTigerCrm…

perhaps salesforce.com is worth $9/user/mo?  Probably!

Browser competition 2008

July 10th, 2008 Rusty

I haven’t checked stats for a long time.  I used to be very concerned about which browsers were most popular and therefore had to support.  These days I write w3c compliant xHtml and test in IE and FF.  That usually means Safari works fine.  Every now and again, I yuck it up on my BlackBerry.  If I can legitimately use the site on the BlackBerry and it looks relatively consistent between IE and FF, I move on! 

IE comes with Windows so it goes without saying that the average consumers will use IE.  I’m astounded by how many people still have IE6, as Microsoft is so persistent with Windows Update, but IE 6 is still a lingering Png hater.  Those people who choose, for whatever reason, to use an antiquated browser will have a down-level experience

FireFox has done a great job providing a free-IE-alternative that actually surpasses IE in many, many ways due to an awesome plug-in (add-in) architecture and devoted community support.  It also happens to be standards compliant, an absolutely critical feature.

Browser Beefs

So these two browsers are both duking it out for Internet supremacy while the rest are dismissed as geek toys that real clients would never use.  Since they are in a feature war, performance has been declining.  On the other hand, one company has focused on making a browser that is lightweight enough to run on a handheld yet give full browser feature support such as JavaScript and real html page rendering with css. Safari is an incredibly efficient browser that is also standards compliant so it isn’t difficult to support nor challenging to use

Firefox and IE suffer from the same problem: bloat

The simple act of surfing the Internet is no longer the simple act of surfing the Internet as we have phishing filters, content filters, experience trackers, toolbars, etc.  I couldn’t live without FireBug for FireFox.  However, for regular surfing, I just want an Html browser, nothing more.

The Sleeper

Safari not only is the default browser on the ever more popular Mac computers, its the browser on the iPhone and iPod Touch (I think, will know shortly).  For this reason, the Safari browser is very quickly becoming a main stream browser. 

I’m quite pleased with this.  Recently, I’d started using Safari on Windows.  My home computer had gotten so bogged down and slow that that it was almost unusable even to browse the Internet.  It has 760MB or so of Ram and plenty of HD space but I’d been too liberal with service based tools and everyone needs their always on "helper" or "update" service installed with their software so just launch windows and I’d start paging.  

I had switched, almost exclusively, to Firefox.  About a year ago, however, FF started crashing whenever there was Flash on a page.  As it turns out, there is Flash on almost every website, once you leave Google, and FF was completely useless with this problem.  I tried reinstalling Flash.  I uninstalled FireFox, deleting everything I could find, only to find it happily restored its old settings and bad behavior from some unknown location.  I couldn’t reasonably find all the FF references, in order to fully remove it, because searching the hard drive took freakin’ forever.  The computer was dying a slow, slow death and was asking for the hammer treatment.

After installing iTunes (because I got an AppleTV and had to), I discovered that, using Safari, I could launch the browser, load Google, complete my search, and walk away before IE would load the first Google home pageIE would pop sometime after I’d gone to bed, I think.  Even when IE was already open and waiting, I could launch and use Safari before IE would finish rendering a page.  I recently reformatted that computer and installed a clean version of XP.  Oh how I miss how a clean XP install is so snappy.  The same is not true of Vista, unfortunately (at least not, typically, before the last service pack.  Perhaps they’ve affected some improvement?).  After my clean XP install, I quickly changed the default browser to Safari and refused the IE7 updates (I guess I’m one of those people mentioned above.  I’m also overdoing the parenthesis).  The computer that was ready for the scrap pile is now a perfectly suitable Internet machine with games for my 5 year old and Open Office for when someone sends you a document in your email. 

When you click an Internet link, Safari happily services your request within seconds.  It launches super fast now.  It browses ridiculously fastPop-up blocker?  not so good.  That’ll discourage me from wasting time on those sites that pop windows.  If you are a site that pops windows and you aren’t peddling porn, you suck.  If you are peddling porn, you definitely don’t care and you probably also swa||0%.

Setting the Active Record straight

June 19th, 2008 Rusty

I was asked yesterday whether my new site, beta.ockhamresearch.com, was developed using Ruby on Rails.  In a very indirect way, sort of.  Ok, no, not at all!  Its Asp.Net MVC

Mvc stands for Model View Controller, a popular design pattern for modern website architecture.  I feel it is significantly more productive and effective than the page-centric architecture you find as the default in most web programming languages.  Ruby’s first popular website platform was Ruby on Rails.  There were other MVC implementations out there already for platforms such as Java and Smalltalk.  However, Rails maid it intuitive, productive and even fun.  This led other programmers to favor the pattern for developing websites (such as myself) and led to the development of Castle Monorail in dot net and other variants as well as on other platforms.  Many of these were ports of Rails for folks who weren’t able to use Ruby as their target language for one reason or another.  I had been using Monorail for some time when Microsoft announced the development of Asp.Net MVC.  Microsoft isn’t well-known for open development initiatives and often does things the Microsoft way rather than the conventional way.  The Microsoft Asp.Net team deserves much credit for the current quality of Asp.Net MVC and the integration of tremendous community feedback. 

Why not just use Rails?

Competency

I have very little experience with Ruby.  When I need to write some Ruby code, I need to look up each construct and find examples to work from.  I can code C# in the woods on the trunk of a tree.  Of course, compiling it would be a challenge.

Confidence

I know where Asp.Net and SQL Server limitations are and that the platform can achieve high performance.  I know that Ruby has known performance issues and no roadmap for reconciling these issues.  I’d rather not be the person responsible for overcoming performance issues on a production web server farm when we have paying clients expecting service.  If I can run a commercially supported platform with current licenses and support contracts, I have someone to lean on if anything goes wrong.  Furthermore, I can fix almost anything on Windows but my experience with Linux is feeble.  I aim to change that but, for now, I can provide confidence to my constituents that my web app will not fail due to memory leaks or unusual bugs that are not a result of my code.  Yes, there will definitely be errors in our future but using NUnit, Cruisecontrol.Net, WatiN, Visual Studio.Net and SQL Server will minimize the risk to a more than acceptable level.  I don’t know where to turn for the same thing in Rails.

Community

This is the most important factor.  The above two points are true for all the programmers I’ve worked with over more than the last decadeWe’re all very familiar and invested in Microsoft technologies.  There is no reason to switch if the features are available and productivity is commensurate with alternatives.  If I need help modifying some code because I have too much to do myself or we have an awesome contract pending, I don’t want to be searching in a small pond for good people. For every good programmer, there are a hundred terrible ones that will make a mess of my beautiful code :)  I can’t have that. 

Why Use Rails at All?

I can’t find current data that indicates the trend for what programmers are using but I can tell you my gut feelings and personal observations.  No community growth, in my technology career, has struck me with as much fervor and excitement as the Ruby and Rails explosion has.  These people aren’t Windows haters like Java programmers were.  They aren’t choosing Ruby because that’s where the jobs are (yet).  They are choosing Ruby because they get hooked!  They love working with it.  More often than not, a Ruby programmer dresses hip, is very laid back, uses a Mac, drives a Hybrid.  These are all traits of people with both time and money.  I want more time and money and would like to be hip.  However, I still prefer to burn more gas in exchange for fast times to sixty.  Glutinous, I know.

When do you switch?

Rails still needs to be proven in the enterprise.  My prediction is that this will happen in 2008.  Sites using Ruby on Rails will publish numbers and costs of operation that make it a very attractive alternative to the company standard.  The best place to try Ruby is on a new, small scoped project with just a few very close end users in a highly agile environment.  Don’t be silly and just announce that you are now Ruby and expect all your devs to just pick it up.  On the other hand, it would be a good idea to get some very intense training for your old school programmers (if you have them) because they are accustomed to working within the constraints of their strongly typed, compiled, high performance environment and will not naturally make the appropriate transitions necessary to achieve success, maintainability and scalability in a Rails environment.  Ask yourself if your compiled apps (yes, Asp.Net is compiled) are as fast as they should be and then ask yourself whether your app will still be acceptable at 50% of that speed.  On the other hand, if you have 80% of your hardware capacity remaining, you can probably virtualize and take advantage of your current infrastructure with very little cost.

Try it on like deodorant.  Give it a few days and try a few different activities and then ask your wife if your pits stink.  If not, take it a little further.

Sitemap Provider throws empty HttpException when reserved word is used for url

June 4th, 2008 Rusty

I ran across a strange bug today.  Fortunately, Bill saw it first and lead me straight to it.  I banged my head against it (unsuccessfully), trying to diagnose the cause of a System.Web.HttpException with no message being thrown from SiteNavNode.ChildNodes until my battery died on my laptop and then came into the office to continue.  Good thing!

In the Financial Services industry, there is a company with the symbol PRN.  I, of course, use directory urls to organize our dynamic website.  PRN is a reserved word for urls because it is a reserved file system word.  In my opinion, modern OS’s should not have this limitation, but I don’t know enough about it to suggest that it isn’t necessary.

If you attempt to create a file, with any extension, using the following list, it will fail to resolve in a browser.

Reserved Word

What it is

AUX Auxiliary port aka Serial Port COM1
CON Short for console, which Microsoft describes as the display monitor.
COM1 COM port.
COM2 COM port.
COM3 COM port.
COM4 COM port.
LPT1 LPT port.
LPT2 LPT port.
LPT3 LPT port.
NUL NULL
PRN Printer aka LPT1

This is also true of rewritten urls.  I defensively have incorporated a lovely "~" into any url that attempts to name the path segment using one of these reserved words. 

Setting up SMTP virtual server in IIS 6.0

June 3rd, 2008 Rusty

Sending notification emails from an app is a pretty straight forward thing.  I can’t think of an server app that I’ve used or written where this wasn’t a requirement.  A good designer will abstract the details of sending email into a notifications object model where smtp is one provider of delivery services.  However, you still have to set up an email server.  You will also bump against a third party product that needs smtp to function.  We use Google Apps for email.  By doing so we have no need for email administration.  Google handles that for us.  Perhaps they’ll appreciate our patronage when they take over the world.  Who knows?

But I stil need a dang smtp server.  Widows Server 2003 comes with IIS 6.0, which comes with a free smtp server.  GREAT!  There’s a pop server, too, but that’s outta scope.

Enable SMTP

Install SMTP.  That link should have you running smtp services.  Pretty simple, so far.

Configure Access

I’m only including the relevant screens to get it going.  By no means is this an Enterprise Solution but it will get you sending email.

image

Open IIS Admin.  Right click on the SMTP Virtual Server.   Choose "Properties"

Click on the Access tab.

Click on Relay.

This is the part that messed with me all day.  I was getting "Cannot Relay" errors trying to send.  When I Enabled "All Except the list below", with no exceptions listed, email went out.  So I played around until I got to this config. image

 

 

YMMV

The first listed setting is the following:

image  I’m a little rusty on my subnetting (pun intended) but that should allow all local network connections to relay through this server.  All I knows is that it done did worked right.

 

Ports and such

I experimented quite a bit with ports, only to find that changing the outgoing connection port makes it impossible to connect to real smtp server.  So leave it all default unless you know what the hell you are doing. 

Note: I read that leaving "Anonymous Access" enabled without some sort of authentication option means that the server never authenticates but treats all connections as autheticated.  Therefore, uncheck that box on Relay Restrctions to "Allow computers which successfully authenticate to relay…"  Unless you would like to see how long it takes spammers to discover your open server :)

PHP and MySQL on Windows IIS Error / Solution

April 12th, 2008 Rusty

I’ve set up PHP and mySQL no less than a dozen times over the last two years for various reasons.  Each time, I am astounded by how inconsistent the experience is.  Once it works, it works.  However, getting there can be a breeze or it can be a pain in the neck.  Documentation sucks and troubleshooting is impossible.  My hope is to save someone the hours I spent over the last couple of weeks trying to get WordPress and MediaWiki configured on a new Windows Server 2003 machine.

Order of Operations

First, make sure you have IIS installed and configured and that you can serve asp pages through IIS.  If you can’t do that, you’re going to have no luck with php.

Next, I recommend installing MySQL and then PHP.  No worries if you don’t follow that sequence but it helps you to ensure some details later.

When you install MySQL, make sure you can connect via some non php tool using your expected credentials.  I love MySQL Administrator available from the MySQL website.

Installing MySQL

MySQL is pretty straight forward.  Just run the latest installer, accept the defaults.  Done.  Keep in mind that MySQL will require some configuration to expose it outside the local machine, if that’s your infrastructure goal, but local execution is ready out of the box.  I usually create users for my PHP apps using MySQL Administrator.

Installing PHP

Do not use the installer.  From what I’ve read it tries to configure CGI and CGI is just silly.  Isapi is far superior but, as I experienced, has some hidden issues that are difficult to resolve.  More on that in a sec.  The bottom line, however, is that the installer has never worked for me, not once. 

Follow the instructions on the for a manual php install on Windows and enable (at least) mySql and MBString extensions (uncomment the lines referring to them in php.config).

Configure a website to serve php, using isapi, and ensure you can serve a php page.  Here’s the most useful thing you can do to prove php execution.

<?php
phpinfo ();
?>

 

Windows Path Environment Variables

I’m not a fan of throwing anything in System32 so I use the PHPRC environment variable to tell php where to load config from. 

More importantly, the PATH environment variable needs to know where php and its extensions are.  include both of these directories in the PATH.  Make sure PHP comes before MySQL in the list.

PHP / MySQL Access Violation

I experienced "PHP has encountered an Access Violation at 015B73DD" each time any MySQL operation was attempted.  There was no Windows event record, no logged issue, no information to the screen and nothing registered with SysInternals FileMon or RegMon.  This issue sucked about as hard as any computer frustration could.  I finally found a post about Installing PHP on IIS 6 where he referenced someone else’s observation: "Adam Carter worked through this problem …insightful conclusion …problem was caused by his mySQL install’s bin folder being included in the PATH before PHP’s install folder. …mySQL’s libmysql.dll loaded before PHP’s libmysql.dll file …upon loading its mySQL extension [causing access violation].  [fix: ensure php precedes mysql in the path] enabled PHP to find its own libmysql.dll"

The error: "PHP has encountered an Access Violation at xxxxxxx" changes the number but does not provide any other useful information and there is no information on the net regarding fixing this.  Well, now there is :)

Conclusion

I hope I saved someone from this hellishness.  There are quite a number of great php apps available and its a shame that its so hard to get through install issues.  Now that I am a Mac convert, I believe most of these issues are a result of the way Windows loads and operates rather than some deficiency in the php stack.  Its worth noting that php on windows is more of a port form apache than part of a design intent.  I am going to load up a Linux WMWare machine and see how that experience works for a Windows guy.  For now, I’ve got Windows working and I feel confident the install is reliable.  It just required a lot of screwing around to get there.   Cheers.