Saturday, April 25, 2009

Windows Server Core 2008 – 3Com NIC installation problem

It appeared that my on-board NIC was not working as my new installation would not recognise it. So I took my “3C905C-TX-M Etherlink 10/100BT PCI NIC w/Management” from a server that was running Server 2003 and I knew was working. Plugged it in and it still did not recognise this one.

Now the Vista drivers are different so I tried to download some drivers on the net, I copied them onto the new server and ran the exe. Still didn’t recognise the NIC after a reboot. So I went to the extracted location of the R41104.exe and navigated to

Bare in mind that this exe tries to extract the drivers to a Dell Location. Mine is not a Dell, so I extracted them to a “Drivers” folder.

x:\Drivers\R41104\Windows\Update\Source

Then type in the following command.

pnputil –i –a W9X90XBC.INF

My network is all up and running. I might go and see if this works with the on board nForce NIC

Windows 2008 Server install problems - 0x800706F8

“Windows cannot install required files. Make sure all files required for installation are available, and restart the installation. Error code: 0x800706F8”

I originally installed Server 2008 from XP and installed it on a different partition and everything worked fine. However, I nuked the machine as I wanted to get rid of the XP Partition and I accidently lost the MBR (Master Boot Record).

So after trying to install Vista directly from the DVD. I kept getting the message above.

After a lot of research it ended up being that a Samsung SD-604 DVD has problems without the correct device drivers. However it was not listed here.

So the trick is to boot off the DVD and get to Boot Strap to recognise all your drives. Then say that you are going to repair your machine and navigate to the Command Prompt. Copy the DVD onto a folder called E:\Windows2008Setup and then install it from this command prompt.

Some other useful things I learnt were

Thursday, April 9, 2009

Creating a backup plan for SQL Express

Sql Server 2008 Express does not come with the built in agent that most servers do. I have a simple E-Commerce shopping cart system and I have decided to use SQL Server Express as it is free for single processor machines and I don’t need anything fancy – just a simple DB to be honest.

So here is how to have a database backup plan.

http://code.msdn.microsoft.com/SQLExamples/Wiki/View.aspx?title=ExpressMaintenance

which was utter rubbish and his examples don’t even run!

So try this

http://www.sqldbatips.com/showarticle.asp?ID=27

Which is one stored procedure and then a Windows Task to call it every week. Prefect. Exactly what I needed. When I get a spare moment, I am going to look at this one as I want to learn PowerShell

http://www.databasejournal.com/features/mssql/article.php/3693606/Microsoft-Windows-PowerShell-and-SQL-Server-2005-SMO--Part-6.htm

Saturday, March 28, 2009

Getting rid of GoogleUpdater

Google Updater is installed when you install any Google product. It then sits in the background and checks for updates. I don’t want it to on my server. I wanted a browser that wasn’t IE 6.0 and I didn’t want the bloat ware of IE 8.0. So I installed Google Chrome as a light weight browser, that would not constantly require Microsoft Updates.

So how do you get rid of the Google Updater?

1) Go to Scheduled Tasks.

  • Either by Control Panel –> Scheduled Tasks
  • Explorer –> Windows –> Tasks

2) You will see the Google Updater sat there. It will start a process when the processor is Idle for 10 mins. Just delete this task and Google wont update anymore.

Thursday, March 19, 2009

Rebuilding all my Personal Computers

I had some time off work, so I decided to rebuild all those old machines I had in the spare room. I had the following: -

I initially thought that I could take the disks out of the P6DBS and undo the Caddy and just copy the data onto my laptop. I forgot the old IDE vs SCSI differences (http://www.mindconnection.com/library/computertips/ide-scsi.htm). But I was reminded about the beauty of SCSI and the way you can just “span” disks together to be seen as one by the operating system.

I stole the memory from the 6BTA3 to boot the P6DBS. I noticed that although it had 5 HDD, it only had power cables for 4 devices. So the first step was to copy all the data onto my Western Digital My Book (http://support.wdc.com/product/spec.asp?groupid=110&lang=en&print=y) I always thought 1 Tb of data was overkill, but I am slowly filling it!

After I had copied 16Gb of data of 2 of the drives, I noticed that my P6DBS was a dual processor motherboard, I decided to take the Pentium III out of the 6BTA3 and plug it in. It worked! It just said that I had 2x Pentium II. Oh well, wasn’t even expecting it to work to be honest! Then the first mistake – flashing the BIOS!!!

I went to SuperMicro (http://www.supermicro.com/support/bios/archive.cfm) site to get a new BIOS and used (http://www.bootdisk.com/) to create a Boot disk. Well that completely fried my machine and it constantly beeped after turning it on. Which according the web was the Power Unit failing (http://www.wimsbios.com/faq/solveamibiosbeepcodes.jsp). So I ripped the Power Supply Unit (PSU) out of the 6BTA3 (that ATX case was just a motherboard now!) and used that. This made the constant beeps turn into 7 beeps (apparently the graphics card was now not seated), and after taking out the memory it had a different number of beeps! So I thought, I need to recover the BIOS.

I followed this (http://www.wimsbios.com/faq/howtorecoveracorruptbios.jsp) guide and ended up setting the motherboard jumper and even took the CMOS battery out and left it over night (was 3am by now!). By this time frustration made me read the manual and release that I should have renamed the backed up BIOS (super.rom). I wish I had followed the instructions to the letter!!

So now I had no way off renaming the rom file as I needed to boot the P6DBS and hold down CTRL and HOME with the floppy disk in and it should reflash the drive reading the super.rom file.

So onto destroying the other machine so that I could use the floppy drive!

More to come . . . .

http://neosmart.net/wiki/display/EBCD/Recovering+the+Vista+Bootloader+from+the+DVD

http://neosmart.net/blog/2008/windows-vista-recovery-disc-download/

http://isorecorder.alexfeinman.com/v2.htm

Wednesday, March 18, 2009

ConfigurationSection that reports missing sections in config

It has long annoyed me taken other frameworks that need config sections defined and spending the time copying the sections over, it would be so much easier if the Framework told you what bit of configuration it was trying to load. So I always use this abstract class for all of my config sections.

public abstract class SimianConfigurationSection : ConfigurationSection
{
/// <summary>
///
Gets the section.
/// </summary>
/// <param name="definedName">
Name of the defined.</param>
/// <returns></returns>
public static ConfigurationSection GetSection(string definedName)
{
ConfigurationSection section = ConfigurationManager.GetSection(definedName) as ConfigurationSection;

if (section == null)
throw new ConfigurationErrorsException("The <" + definedName +
"> section is not defined in your .config file!");

return section;
}
}


Next derive from this class rather than the .Net Framework class. e.g.



public class EmailTemplatesSection : SimianConfigurationSection



Once this has been completed your application will report a simple configuration exception if it cannot find your section in the config file. This takes 5 minutes to implement, but helps so much when you are configuring frameworks.



This then allows a really simple pattern when you want your configuration section.



return DBCategoryProviderSection.GetSection("nopDataProviders/CategoryProvider") as DBCategoryProviderSection;

You will no longer get an “Object is not a reference . . . “ exception.

Monday, March 16, 2009

Json Extension methods

Extension methods are so cool in your web layer so that you can easily convert your things between Json and your object. All you have to do now is decorate your classes with the DataContract/DataMember attributes. How simple is that?

public static class JsonHelper
{
/// <summary>
///
Converts any object to a JSON string
/// </summary>
/// <param name="value">
The value.</param>
/// <returns></returns>
public static string ToJson(this object value)
{
DataContractJsonSerializer serializer = new DataContractJsonSerializer(value.GetType());
using (MemoryStream ms = new MemoryStream())
{
serializer.WriteObject(ms, value);
return Encoding.Default.GetString(ms.ToArray());
}
}

/// <summary>
///
Deserializes the specified json.
/// </summary>
/// <typeparam name="T"></typeparam>
/// <param name="value">
The value.</param>
/// <returns></returns>
[SuppressMessage("Microsoft.Design", "CA1004:GenericMethodsShouldProvideTypeParameter")]
public static T FromJson<T>(this string value)
{
using (MemoryStream ms = new MemoryStream(Encoding.Unicode.GetBytes(value)))
{
DataContractJsonSerializer serializer = new DataContractJsonSerializer(typeof(T));
return (T)serializer.ReadObject(ms);
}
}
}