Had another friend lose a hard drive today without a proper backup. Pain!
I now have at least 3 copies of everything with staggered backups to different hardware. For the digital signage software I manage there are two copies on the servers locally and another copy in the cloud on Amazon's S3 storage which is itself replicated multiple times.
The basic concept that people need to use is "SHARED NOTHING".
RAID is NOT the answer to data security, it's a convenient recovery mechanism for failed hard drives but if your data is on two drives connected to the same RAID controller card on the same computer in the same room you have plenty of opportunities to lose it all.
Backups should ROTATE. Backing up to the same location risks a failure in the backup that could wipe both copies, or copy bad data over good before the mistake is discovered. For really critical data I have a daily backup, a weekly backup, and a monthly backup. I also have two backup schedules, morning that copies to one set of drives on controller A and an evening backup that copies to a different set of drives on a different controller.
Friday, December 11, 2009
Making a bootable Windows 7 USB Memory Stick
Had to install Windows 7 onto a laptop today using a USB flash drive. I had an external USB DVD-ROM drive and setup ran just fine off it but then it refused to install without some additional device drivers so I needed to find another way. After a quick search of the internet I came up with the following method to create a bootable USB flash drive using Windows 7:
1. Open a command prompt (CMD) as administrator
2. Insert an empty USB stick and note the drive letter. Make sure you USB stick is big enough to contain the windows disc image: a 4GB USB stick is ideal and make sure there's nothing on it that you need.
3. Insert your Windows 7 DVD into your DVD drive and note down the DVD drive letter.
4. Enter the following at the command prompt:-
DISKPART LIST DISK5. You should see both your hard drive and your USB stick listed plus any other hard drives or memory devices you have connected. Note the disk number for your USB stick. Double check the size to make sure you have the right drive!!! Do not do the following on your primary hard drive!!!
6. Now enter the following commands using your disk number in place of the first '1':-
SELECT DISK 16. After the format has finished (it may take several minutes)
CLEAN
CREATE PARTITION PRIMARY
SELECT PARTITION 1
ACTIVE
FORMAT FS=NTFS
ASSIGN7. Back at the command prompt, type the following:-
EXIT
D: Or whatever your DVD drive is
CD BOOT
BOOTSECT.EXE /NT60 H: Or whatever letter your USB stick is
8. Now copy all the files from the Windows DVD onto your USB stick
9. You have finished! You can now use this bootable copy of windows in any PC that supports booting from USB (most do now).
Wednesday, December 09, 2009
Tip: getting the index in a foreeach statement
List x = new List() {"a", "b", "c"};
var augmented = x.Select((item, index) => new { item = s, index = index });
foreach (var d in augmented)
{
Console.WriteLine(d.item + " " + d.index);
}
Console.ReadKey();
a 0
b 1
c 2
var augmented = x.Select((item, index) => new { item = s, index = index });
foreach (var d in augmented)
{
Console.WriteLine(d.item + " " + d.index);
}
Console.ReadKey();
a 0
b 1
c 2
Friday, November 20, 2009
Future proof your home with a new conduit system?
An interesting approach to future proofing your home with conduit but seriously, who is going to pay $100 a run for this?
http://www.electronichouse.com/article/exapath_conduit_system_futureproofs_your_wired_home/
If you have a crawl space and attic you need a top to bottom conduit and maybe a few conduit runs behind locations where you have or might have any AV equipment but putting 3 of these in every room isn't going to be a good investment. Smurf rube would work just as well for most people.
http://www.electronichouse.com/article/exapath_conduit_system_futureproofs_your_wired_home/
If you have a crawl space and attic you need a top to bottom conduit and maybe a few conduit runs behind locations where you have or might have any AV equipment but putting 3 of these in every room isn't going to be a good investment. Smurf rube would work just as well for most people.
Monday, November 16, 2009
SQL Server - error: 18456, severity: 14, state: 38 - Incorrect Login
Despite the error message this problem can be caused by something other than an Authorization failure. In fact, simply misspelling the Initial Catalog can cause this message to appear. I wish developers wouldn't reuse error messages when the problem and solution is completely different.
Sunday, November 15, 2009
WCF and the SYSTEM account
While trying to move an NT Service over to its own account I hit the following WCF error:-
Exception Alert : System.ServiceModel.AddressAccessDeniedException: HTTP could not register URL http://+:8082/home/. Your process does not have access rights to this namespace (see http://go.microsoft.com/fwlink/?LinkId=70353 for details). ---> System.Net.HttpListenerException: Access is denied at System.Net.HttpListener.AddAllPrefixes() at System.Net.HttpListener.Start() at System.ServiceModel.Channels.SharedHttpTransportManager.OnOpen()
The referenced article wasn't much help but a quick web search led to this article on MSDN which has a better explanation and two ways to solve the problem. Unfortunately neither is 'simple'. In the end I used the source code, built a new .EXE and added it to my setup code.
Seems odd that the SYSTEM account could do this just fine but the safer account I created to run the service cannot. Why isn't there a security group for this that I can just add my user to and be done?
Wednesday, October 21, 2009
404 errors on IIS6 with ASP.NET 4.0 Beta 2
After installing Visual Studio 2010 and .NET framework 4 on Windows Server 2003 (IIS6) I was getting nothing but 404 errors. Turns out .NET 4 had somehow been disabled in the IIS metabase.
Here's the comment I posted to server fault:
Check the metabase.xml file ... is there a '1' at the start of the line for Framework\V4.0.21006 in WebSvcExtRestrictionList?
I had the same problem and setting it to '1' (enabled) cured the problem. ASP.NET 4.0 Beta 1 did not have this problem. The problem only appeared on install of ASP.NET 4.0 Beta 2.
Here's what it looked like BEFORE fixing the problem:
Here's the comment I posted to server fault:
Check the metabase.xml file ... is there a '1' at the start of the line for Framework\V4.0.21006 in WebSvcExtRestrictionList?
I had the same problem and setting it to '1' (enabled) cured the problem. ASP.NET 4.0 Beta 1 did not have this problem. The problem only appeared on install of ASP.NET 4.0 Beta 2.
Here's what it looked like BEFORE fixing the problem:
WebSvcExtRestrictionList="0,C:\SERVER\system32\inetsrv\httpodbc.dll,0,HTTPODBC,Internet Data Connector
0,C:\Perl\bin\perlis.dll,1,,Perl ISAPI Extension
0,C:\SERVER\system32\inetsrv\httpext.dll,0,WEBDAV,WebDAV
0,C:\Perl\bin\PerlEx30.dll,1,,PerlEx ISAPI Extension
0,C:\Perl\bin\perl.exe "%s" %s,1,,Perl CGI Extension
1,C:\SERVER\system32\inetsrv\asp.dll,0,ASP,Active Server Pages
1,C:\SERVER\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll,0,ASP.NET v2.0.50727,ASP.NET v2.0.50727
0,*.exe
0,*.dll
0,C:\SERVER\system32\inetsrv\ssinc.dll,0,SSINC,Server Side Includes
0,C:\SERVER\Microsoft.NET\Framework\v4.0.21006\aspnet_isapi.dll,0,ASP.NET v4.0.21006,ASP.NET v4.0.21006"
And here's an easier way to change that setting:
http://neilkilbride.blogspot.com/2008/02/windows-2003-iis-returns-404-for-aspnet.html
Mixed mode assembly errors after upgrade to .NET 4.0 Beta 2
I began receiving this error after upgrading to .NET Beta 2 ...
System.IO.FileLoadException: Mixed mode assembly is built against version 'v1.1.4322' of the runtime and cannot be loaded in the 4.0 runtime without additional configuration information.
I suspect it's the Managed.DirectX DLL that I'm using.
Adding the following to the application config file appears to have solved the problem for now:-
<configuration>
<startup useLegacyV2RuntimeActivationPolicy="true">
<supportedRuntime version="v4.0"/>
</startup>
</configuration>
System.IO.FileLoadException: Mixed mode assembly is built against version 'v1.1.4322' of the runtime and cannot be loaded in the 4.0 runtime without additional configuration information.
I suspect it's the Managed.DirectX DLL that I'm using.
Adding the following to the application config file appears to have solved the problem for now:-
<configuration>
<startup useLegacyV2RuntimeActivationPolicy="true">
<supportedRuntime version="v4.0"/>
</startup>
</configuration>
Thursday, October 15, 2009
Balloon Boy was much ado about nothing - Twitter
So the whole #balloonboy thing turned out to be a non-event today. The traffic on Twitter around this must have been huge. Here's a few of the more witty comments:-
saymayday UPDATE: kid flying away in a balloon is fake!! It's all fake!!!
candidgyal Black Hawk sent to rescue little boy in helium balloon. Someone will be lowered to attach to the balloon and rescue boy.
QuinnK Major anxiety about this balloon boy situation, and the number of people on Twitter that can't spell ballon baloon balon BALLOON!
boxwood17 Hey, 6-year-old in the hot air balloon, I'mma let you finish, but John Denver had the best crash landing of all time.
ProgGrrl RT @HitFixDaniel I've temporarily switched from CNN to Fox News, because I'm curious how Balloon Boy is Obama's fault.
pasquinade My other car is a helium balloon with a 6-year-old child inside. (Too soon?) #bleakbumperstickers
SpigotTheBear ***BREAKING NEWS*** A SECOND KID IN A SECOND BALLOON HAS JUST CRASHED INTO THE WORLD TRADE CENTER
azbubba RT @tdhurst: The balloon kid would be a lot cooler if he was live tweeting this.
ebonymystique this balloon boy is gonna be the most popular kid in school tomorrow. wait...why wasnt he at school TODAY?
jennknitsalot i'm ok with #boyinballoon crashing twitter as long as the balloon doesn't crash
michelleyus Is it me, or does this balloon thing seem like it shouldn't be that hard? I saw Executive Decision. Mid-air solutions CAN be devised.
kella_bella when i was 6, i wanted to fly away in a hot air balloon.
drewdavies @gregeh The balloon "expert" on CNN pointed out that if the boy isn't separated from the helium chamber, he's not going to have any oxygen.
zamoose 6 year-old boy floating away in helium balloon on CNN. Anchors refuse to address lack of Federal funding for airborne Lassie research.
TiricoSuave "Well, it's obviously landed." - Stan Hess, CNN's experimental balloon expert.
Neomic RT (via @justrod); If we couldnt find #balloonboy in his own house what makes ya think we ever gonna find Osama
bootypirate Just ordered a weather balloon kit from the back of Parents Magzine. #fb #balloonboy
OntieC #balloonboy story just so much hot air.
@EthanSuplee Has America run out of wells to fake falling down?
tsand: http://twitpic.com/loa1c - Working on prototypes of our #balloonboy Halloween costumes.
Yarhoza Yo Balloon Boy was probably in Narnia while all this was all going on. #balloonboy #balloonboy #balloonboy #balloonboy #balloonboy
reverendnathan Ballon Boy's favorite song? "I believe I can fly" by R. Kelly. He thinks about it every night and day. #balloonboy
jaimebradley #balloonboy if you name a child after a bird, he's going to want to fly
saymayday UPDATE: kid flying away in a balloon is fake!! It's all fake!!!
candidgyal Black Hawk sent to rescue little boy in helium balloon. Someone will be lowered to attach to the balloon and rescue boy.
QuinnK Major anxiety about this balloon boy situation, and the number of people on Twitter that can't spell ballon baloon balon BALLOON!
boxwood17 Hey, 6-year-old in the hot air balloon, I'mma let you finish, but John Denver had the best crash landing of all time.
ProgGrrl RT @HitFixDaniel I've temporarily switched from CNN to Fox News, because I'm curious how Balloon Boy is Obama's fault.
pasquinade My other car is a helium balloon with a 6-year-old child inside. (Too soon?) #bleakbumperstickers
SpigotTheBear ***BREAKING NEWS*** A SECOND KID IN A SECOND BALLOON HAS JUST CRASHED INTO THE WORLD TRADE CENTER
azbubba RT @tdhurst: The balloon kid would be a lot cooler if he was live tweeting this.
ebonymystique this balloon boy is gonna be the most popular kid in school tomorrow. wait...why wasnt he at school TODAY?
jennknitsalot i'm ok with #boyinballoon crashing twitter as long as the balloon doesn't crash
michelleyus Is it me, or does this balloon thing seem like it shouldn't be that hard? I saw Executive Decision. Mid-air solutions CAN be devised.
kella_bella when i was 6, i wanted to fly away in a hot air balloon.
drewdavies @gregeh The balloon "expert" on CNN pointed out that if the boy isn't separated from the helium chamber, he's not going to have any oxygen.
zamoose 6 year-old boy floating away in helium balloon on CNN. Anchors refuse to address lack of Federal funding for airborne Lassie research.
TiricoSuave "Well, it's obviously landed." - Stan Hess, CNN's experimental balloon expert.
Neomic RT (via @justrod); If we couldnt find #balloonboy in his own house what makes ya think we ever gonna find Osama
bootypirate Just ordered a weather balloon kit from the back of Parents Magzine. #fb #balloonboy
OntieC #balloonboy story just so much hot air.
@EthanSuplee Has America run out of wells to fake falling down?
tsand: http://twitpic.com/loa1c - Working on prototypes of our #balloonboy Halloween costumes.
Yarhoza Yo Balloon Boy was probably in Narnia while all this was all going on. #balloonboy #balloonboy #balloonboy #balloonboy #balloonboy
reverendnathan Ballon Boy's favorite song? "I believe I can fly" by R. Kelly. He thinks about it every night and day. #balloonboy
jaimebradley #balloonboy if you name a child after a bird, he's going to want to fly
Subscribe to:
Posts (Atom)