Aaron's blog

Hibernation trickery in Vista

By aaron.axvig, 29 August, 2007

So I was annoyed by the blinking light that my desktop has when it's sleeping, and decided to put it into hibernation.  I was then further annoyed by the lack of a hibernation option in the Vista shutdown menu, and even more annoyed when I couldn't find a way to re-enable hibernation.  Via Google I then found several sites confirming that there is no way to enable or disable hibernation in Vista using the GUI (I think I disabled it by removing the hibernation file in Disk Cleanup).  However, it is possible to enable or disable it via the command line, and you can read about it at those sites I linked to above.

Instead of doing this though, I have found it just as convenient to use the command shutdown -h.  Just type that in the search box in the start menu and hit enter, and the computer will drop into hibernation, whether the menu option is there or not.

Tags

Exchange 2007 OWA login shortcut

By aaron.axvig, 27 August, 2007

I had been using https://example.com/exchange to login to Outlook Web Access, but starting with Exchange 2007 this added numerous steps.  I had to accept an unsigned security certificate, fill out a pop-up login box, accept another certificate (because it transferred me to https://servername.example.com/owa), and then login to the actual application.  If you're like me and looking for a shortcut, just use https://example.com/owa.  Only one sign-in.

Tags

RAID 5 HDD benchmarck

By aaron.axvig, 26 August, 2007

I just finished running a benchmark on the new server's RAID 5 array.  Nothing really surprising but decent performance I think.  There are 4 500GB Seagate ST3500630AS drives in a RAID 5 using the built-in NVRAID on a Asus M2N-E motherboard.  The OS is on a separate drive.

Tags

How to use MMC Administration Tools remotely (over the WAN)

By aaron.axvig, 23 August, 2007

I know, I know, this may seem painfully obvious to some people, but it is something I hadn't thought of doing before.  Say you have a domain controller on one network, and you have your laptop on another network across the WAN.  As long as your domain controller is open to the Internet (DMZ or on a routable address or something) just set your primary DNS server to the IP address of your domain's DNS server.  I suppose your domain controller has to be on a routable address then too (meaning you can directly ping it from anywhere in the world).

Now you should be able to open up any MMC tool, like AD Users & Computers, and use it to remotely administer your domain.  It would make sense that you could even set a computer's DNS entry and even join it to a domain from a remote location.

One implication of doing this is that now all your name resolution (converting google.com into an IP address, etc.) is now relying on your DNS server staying up.  Which makes me wonder how Windows uses the secondary DNS server entry.  Does it wait for the first one to time out?  How long would it wait?

Tags

Summer in Medora - the Nitevision episode

By aaron.axvig, 22 August, 2007

Nitevision: a name which strikes fear into the hearts of many a Medora call-center workers.

To be fair, it's not that bad of a program.  It's what Medora has used for motel reservations for many years.  Written by REMco Software out of Dickinson, ND, Nitevision is a client/server application which keeps tracks of motel reservations, who is checked in, which rooms are clean, etc.  As near as I can tell the client sends raw SQL queries to the server which then spits back some data for the client to display.  A workable strategy, I think.  However, there are some problems.

I started working in Medora's call center at the beginning of the summer of 2005, as a lowly Customer Service Representative (don't be fooled, I have really really really enjoyed all of my jobs in Medora).  I vaguely remember how the Nitevision server had to be restarted quite often because all the clients on the workstations would simply lock up.  I remember more closely how this also happened in the summer of 2006 when I was a team leader, supervisor of CRSs.  At one point I was even trained in as to how to restart the server because the IT guy wanted a day off.  I don't think I ended up having to restart it, but the Internet connection did go down at one point while he was gone, which is another story on its own (credit card processing requires an Internet connection).  Anyways, the restarts were so frequent that Nitevision got its own server so the ticketing system could stay up while it was rebooting.

Enter me (again), in the summer of 2007, as the IT assistant.  Now instead of crossing my fingers in hopes that it didn't crash, I had half of the workers asking me why Nitevision crashed on them all the time.  I didn't really know, but us two IT guys spent a lot of time thinking about it.  Many hours were spent on the phone with REMco support, and they even remoted into the server to delete some rows in a logging table that looked like they were taking a lot of space.  The problem went on though, with crashes becoming a daily occurrence, and often-times hourly during busy times of the day (early morning: lots of reservations, and mid afternoon: lots of checkins).  We poured over all the diagnostics we could find: CPU usage, RAM usage, HDD activity (which is actually difficult to monitor), network activity, and the Event Viewer.

Finally I cracked open the SQL Server logs.  I should have done this sooner, but SQL Server Management Studio wasn't installed on the server and I didn't have it on my desktop.  When I got it installed on my laptop though, I found the following error message repeated tens of times in the minutes leading up to each server crash: "This SQL Server has been optimized for 8 concurrent queries. This limit has been exceeded by xx queries and performance may be adversely affected."  xx would be a 1 or 2 for about 20 minutes (always spaced evenly exactly one minute apart) and then it would jump to 20 or 30 for the last few minutes before the crash.

Shortly thereafter we discovered that the server was running the Microsoft Data Engine, better known as MSDE, also well-known for being limited to 8 concurrent queries.  We have 10 call center computers, 6 front desk computers, call accounting, online reservations, accounting staff, and 3 group sales computers fighting for database access. REMco would not really acknowledge that this was the problem, and it's quite possible that they had no experience with this scenario, because judging by a list on their website of their customers, I suspect that we are their largest.  In the end though they did decide to help us move to a trial version of full-blown SQL Server 2000.

Migration day was quite exciting.  I arrived for work at 1:00pm to discover that they had taken down the server at 10:00am to start the migration.  And it still wasn't up.  I found a number of funny things going on:

  • They had backed up the databases and were then restoring them.  One backup was corrupted, and they were going to restore to the backup made during the night, losing an entire morning of new reservations.  So I taught the REMco tech how to detach and attach a database.

  • They were using "SQL Editor."  I had seen this tool before on the Nitevision server.  It seems like some watered down version of Management Studio.  I suspect the tool does not have functionality for attaching and detaching databases, which may be why they weren't doing that before.  I don't think it supports Windows authentication either, because they weren't able to connect to the new database engine...and that's because...


  • They installed the new engine with only Windows authentication.  Yes, the entire Nitevision program runs using SQL authentication.  SQL Editor uses SQL authentication also.  Upon pointing this out, it seemed that it wasn't merely an oversight on their part.  Rather, I think they genuinely did not know the difference between the two authentication methods.

We finally got the thing running around 3:00pm.  Since then it has only required reboots every other week as it gradually begins to more frequently freeze up for 30 seconds at a time.  End result?  Nitevision humming along acceptably, except for some annoying accessory apps running on the server that are poorly setup.  I'll elaborate on them some other time...along with several other interesting stories as I remember them.

How to to setup a server the easy way

By aaron.axvig, 21 August, 2007

Well here we go; I'm going to detail the unpleasant experience of setting up our new server as best as I can remember it.

Problem 1:  Floppy disk with drivers needed for RAID functionality.  We actually had a floppy drive, and even a computer to connect it to, but no floppy disks could be found.  So we drove a couple miles to someone's house and found one floppy--and old Intel motherboard driver disk.  We fired up the ancient computer there, put the disk in, put the CD-ROM from Asus in the optical drive...and got stuck.  It wouldn't read the disk.  Closer examination revealed that it was actually a DVD disk, which the 5+ year old computer couldn't read.  We took the floppy home and made the disk there.

Problem 2:  Getting the computer to boot correctly.  Having not dealt with a floppy drive for several years, we were both unfamiliar with the cause of those cryptic "failure to find boot disk" messages, which were very vexing.  We initially blamed it on the RAID and how that fit into the boot order.

Problem 3:  Not having disk 2.  Server 2003 64-bit comes on two CDs.  We had 2 MSDN-iso burned disks, one labeled disk 1 and one labeled disk 2.  The second one was most certainly not disk 2.  Off to MSDN to download...and in the meantime we went ahead and installed updates and Service Pack 2.

Problem 4:  We ran disk 2, only to get a warning that Service Pack 2 had already been installed.  We proceeded on anyways.  Around this time we started getting random lockups.  Then a message popped up detailing that the RAID had entered a degraded state.  After messing around in the RAID software for a couple minutes, we decided that one of the drives was bad, and that we would have to reinstall on a RAID composed of the three remaining disks.

Problem 5:  Windows installed again, everything updated, RAID fails again.  So this time I backed up an image of everything we had setup to another computer, re-installed Windows on one of the SATA HDDs (not in a RAID) and restored from the backup.  This seemed to work alright, until we started to have a LOT of problems installing Exchange Server 2007.

So we re-installed again (fourth time if you're counting).  By now I figured that something was up and these disks weren't actually failing.  But we were also sick of the RAID idea so just installed Windows on a spare IDE HDD we had laying around.  In the meantime, we figured out that the disks probably hadn't been given adequate time to rebuild (although I'm still not sure why a new RAID with empty disks needs to be built).

This is the install we are currently running on, and it's working quite well.  After the RAID was given time to build (I went into the BIOS RAID control panel and told it to rebuild) it has been running fine.  We had quite a lot of trouble again with Exchange Server 2007, but that is another story altogether...

New axvius.com server

By aaron.axvig, 19 August, 2007

Yep, we finally did it.  After inching along for two years on 1.0 GHz servers (one or two or three as we saw fit at the time) we have finally invested in some big iron.  $800 got us the following:

  • 2x 1GB DDR2 667MHz RAM
  • 4x 500GB Seagate 7200.10 HDDs
  • 400-watt Rosewill PSU
  • 4U Rackmount Case
  • 2.2GHz AMD Athlon 64 X2 ProcessorAsus M2N-E Motherboard

I managed to get the HDDs for $100 through some sort of error on Tigerdirect's website I think.  They had ones with 16MB cache listed there for $120 (and the same price was at Newegg), but 8MB ones for $100.  I didn't really care that much about that so I ordered them.  Then I read online that those drives aren't available with 16MB cache so I clicked on the link in the shipping confirmation e-mail they had given me and that lead me to a non-existant page.  Then 16MB cache drives showed up at the door, which made me happy.  But the HDDs still made up 1/2 of the total price.

Buying the RAM second-hand from my boss in Medora also helped stay under budget as I got it for $60.  The power supply was pretty cheap ($35) and I have some doubts about it (it's not very heavy) but it had lots of good reviews on Newegg.

I got that motherboard because it's an Asus and it has 6 SATA ports with RAID 5 support.  So the HDDs are in a RAID 5 with an end total capacity in Windows of 1.36TB.  Unfortunately due to some initial issues installing Windows I ended up not putting the OS in the 60GB partition on the RAID that I had planned.  I threw in an old 160GB drive for that, and we are now using the RAID solely for file storage.

I also threw in one out-of-budget expenditure: an 8-port gigabit switch which I picked up for ~$60.

Tomorrow I will detail all the headaches that we had installing everything.

Tags

ASP.NET/SQL Server key manager application

By aaron.axvig, 27 April, 2007

This is a project I worked on mostly a few months ago: an application to keep track of license keys and which computers certain keys have been activated on.  It is primarily designed for internal use by an organization.  Being quite simple, it does not have a lot of features, but this also makes it easy to use I hope.  Here is a screenshot of the main page:

<lost>

And then there are a couple of different screens for adding items; here is one of them:

<lost>

You can view details of a key, software, computer, or installation:

<lost>

Lastly, there are a few different list views for various things, like all the keys that you have for a certain software package:

<lost>

A few caveats regarding the quality of the application:

  • There is no protection against dumbness.
  • No limits on data input, and database fields are varchar(max).
  • Should be relatively save against SQL injection attacks, as all data is passed as parameters to stored procedures.
  • No foreign key checking.  So if you delete a software from the database that still has keys that refer to it, bad things may happen.
  • Delete is permanent.  Be careful.
  • I'm quite sure something will be discovered to be broken for this first release.  So there is room for improvement.

Now some positives:

  • Activation is not permanent.  If you change something to not be activated, it will update the software's activation totals.  So you could use this field to track how many computers the key is used on if you really wanted to.
  • In fact nothing is permanent.  You can all of the data you have entered as you need to.
  • Clean design.
  • Database is simple if you really need to go in and edit something by hand.
  • Released under GNU General Public License.

You can get the application here.  You should have a machine with ASP (probably 2.0 is required) installed, and SQL Server (tested on SQL Server 2005).  Unzip the precompiled files into a web directory.  One file is called procedures.sql, and you must run the text of this in a SQL Server Management Studio window in order to create the 4 tables and 27 stored procedures.  Delete or move it when you are done.  Then you must modify the connection string in the web.config file to allow for a connection to your SQL Server.  While in the web.config file you can change the text that appears as the main logo (doubling as the home button) of each page.

To keep everyone on the Internet from viewing your keys, you should implement some security.  I do this by disallowing anonymous access in IIS and requiring Integrated Windows Authentication.  Then any domain users that have NTFS permissions to the files in that directory can view the keys.  Users only need read access to the directory.  In my testing the page could not be shown unless the viewer was authenticated as something, but I wouldn't rely on that keeping everyone out (I think it was the web.config authorization setting that was doing this).  Much better to set those NTFS permissions.

The lack of complete automation and difficulty of setup means that unless you have some experience with web servers, ASP, and SQL you are probably going to find it difficult to get it to work.  I plan to add more documentation and make it easier in the future.  Of course if you ask questions or leave thanks in the comments I will answer them to the best of my ability, and also be greatly encouraged to know that someone else is out there using this.  :)

Tags

How to Fix "BOOTMGR is missing"

By aaron.axvig, 25 April, 2007

So you've got a shiny new Vista install on your desktop, and you're happily installing all of your favorite programs.  One of them requires a reboot, and begrudgingly you comply.  On startup you get an error message reading "BOOTMGR is missing.  Press Ctrl+Alt+Del to restart."  That could be a problem.

As near as I've been able to figure out, Vista gets confused when installed while you have a SATA drive and an IDE drive plugged in and powered on.  In my case, I had one of each, and was installing to the SATA drive.  The IDE drive was already formatted as NTFS (not sure whether that matters, but it might).  So when I installed Vista, it put the Windows files on the SATA drive, but somehow decided to put the boot files on the IDE drive.  It worked like this for a couple of reboots, but then stopped working, giving me the mentioned error.

Vista repair to the rescue, right?  Reportedly it works quite well for some things, but not this case I guess.  I tried the auto repair function that specifically looks for startup problems, but it couldn't find any.  There is a command line option though, so in I dove...

The idea is that some files are placed on the wrong hard drive and they need to be on the other one.  It just so happened that the command line I got though the repair interface gave me C:\ as the drive that had the boot files (incorrectly), and the D:\ as the main (SATA) drive that I wanted the files on.  To find out which is which in your case, just use the following commands (all quotes in this post are NOT part of the command, and the commands are NOT case sensitive):

  • "c:" to switch to the C drive.
  • "dir /a" to view all the files.  The "/a" switch is to show the hidden ones (the files you are looking for, listed below, are hidden).
  • "d:" to switch to the D drive.
  • "dir /a" to view all the files there.

Basically what you are looking for is the drive that has a BOOT folder with files in it, and also a file named BOOTMGR (not in the BOOT folder).  And you want to identify the drive that has the "WINDOWS" folder in it, as that is where you are going to copy those files.

As far as copying the files, just use the following commands:

  • "c:" to switch to the C drive, or wherever you determined the boot files to be.
  • "xcopy /h bootmgr d:" to copy the BOOTMGR file to the D drive, or whichever drive you need to copy them too.  The "/h" switch makes sure that it sees hidden files.
  • "robocopy c:\boot d:\boot /mir" to copy the entire BOOT folder from the C drive to the D drive, again switching the drive letters as you deem necessary.  The "/mir" switch mirrors the entire directory structure, and is necessary because the BOOT folder contains some other folders with files.

That should do it, provided you just saw a bunch of files and copy commands scrolling by.  Just to be sure though, you should test to make sure this problem isn't going to rear its ugly head in the future.  What I'm thinking of is that maybe the files didn't get copied right and it is finding some weird way to use the files that are still on the wrong drive.  So I would recommend unplugging all the cables for the non-OS drive and making sure that you are able to boot Vista completely and that everything is in order.  Then you can plug that drive back in safe in the knowledge that it is not using the files on that drive and you can remove it in the future without repurcussions.

(Note: Lots of information was derived from this Lifehacker post's comments, although my circumstances were a bit different and so my instructions are modified (mainly because those instructions copy the entire drive contents over, and I had data on the second drive that wouldn't fit on the OS drive).  Also, some thanks goes out to this post over at Scott Hanselman's blog.)

Server maintenance notes

By aaron.axvig, 23 April, 2007

Today I did some server maintenance.  That would be the reason you noticed the blog was down for 45 minutes or so.  (Who am I kidding, like anyone actually visits.)  The main idea was to add some RAM, but I also removed a HDD from one machine.

I have two servers, one of which runs the web stuff (all ASP.NET) and one which stores backups and other "files."  It also runs runs SQL Server.  This file/database server used to get really hot, since it was stuffed with 5 HDDs at one point.  I have since added a fan to blow across most of the HDDs and things have improved a lot.  It runs on a 1.2GHz Athlon and now has 384MB RAM.

The web server (and domain controller, and mail server, and anything else I throw at it I guess) is a 1.1GHz Celeron with 640MB RAM.  When I opened the case up on this beast to add some RAM, I noticed that this was now the hotter of the two computers.  In fact, nearly everything was so hot I could hardly hold my hands tight up against the parts (chassis, power supply, HDD, you name it).  This computer used to run fairly cool, so something was obviously up.

I added the RAM, fired the box back up, and promptly noticed that the power supply fan wasn't spinning.  There is no other fan in there other than the CPU fan (still chugging along), so there was little-to-none airflow through the case.  Amazingly it had been stuggling along for probably a month or two like this, in a very warm closet even!

I thought maybe the fan was just jammed and tried rotating it with a key, but it is very sluggish.  I imagine the bearing dried out and failed.  So now I have the computer up and running again, but this time with the case cover off.  I must say though, what a tough little machine.

The moral of the story: If the blog goes down again, you know what happened...

Tags