Scott Hanselman

The Computer Backup Rule of Three

November 14, '12 Comments [66] Posted in Musings
Sponsored By

Hard drive failure. Seriously. - Used under CC. Photo by Jon RossI'm ALWAYS pounding people to backup. I will continue. BACKUP YOUR STUFF. If you care about it, back it up.

Let's talk. Yes, I'm talking to you, non-technical friend. You're a writer, a blogger, not a techie. I get that. Can't be bothered, I get that. Very busy. You will be even busier when you lose access to your dropbox, or leave your laptop on a train.

Please. Read. Tell your friends.

These are NOT backups

Here are some things that are NOT backups. Feel free to tweet or Facebook them to shame educate your family.

  • Backing up your laptop to an SD Card in the same laptop is #notabackup
  • Backing up to a hard drive that is 6 inches away from your computer is #notabackup
  • Backing up your Gmail to another Gmail account is #notabackup
  • Backing up your book by copying it to another folder is #notabackup
  • The photos that are still in your camera memory are #notabackup

Do you have any other good examples?

The Backup Rule of Three

Here's the rule of three. It's a long time computer-person rule of thumb that you can apply to your life now. It's also called the Backup 3-2-1 rule.

  • 3 copies of anything you care about - Two isn't enough if it's important.
  • 2 different formats - Example: Dropbox+DVDs or Hard Drive+Memory Stick or CD+Crash Plan, or more
  • 1 off-site backup - If the house burns down, how will you get your memories back?

Why so paranoid?

Simple. Because I care about my work, photos and data and I would be sad if I lost it.

Think about all the times you've heard about a friend who has lost everything. A decade of photos. Years of email. It hurts-  just like exercise - because it's good for you.

Try restoring from a backup to practice. Backups always succeed. It's restores that fail.

What should I do?

I think at a minimum folks should do this.

  • Have TWO physical backups (hard drive, memory card) with a copy of everything, at least weekly. You can automate this.
  • Backup everything that has data that matters. That means phones, too.
  • Have a cloud backup storage (CrashPlan, DropBox, SkyDrive, something)
  • Don't trust the cloud. I backup my gmail, too.
  • Rotate the physical backups between your house and somewhere else. I use the safety deposit box. You can use your Mama's house. Just label one "Backup A" and one "Backup B" and when you visit, swap them.

Recommended Reading

Here's some other blog posts on the topic of backup. Now, take action.

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook twitter subscribe
About   Newsletter
Sponsored By
Hosting By
Dedicated Windows Server Hosting by SherWeb

The Internet is not a black box. Look inside.

November 12, '12 Comments [31] Posted in Back to Basics | Musings
Sponsored By

All too often I see programmers trying to solve their problems on the internet by blindly "flipping switches."

Change something, hit refresh in the browser. "Why is that cached? What's going on?" Change something else, hit refresh in the browser. "What's the deal?"

You may have heard the term "cargo cult programming" where islanders after World War II would wave sticks hoping that planes full of supplies would fly over. They drew a conclusion that the sticks waving caused the planes to come.

Think about abstractions. This is a good reminder for the beginner and the long-time expert. This applies not just to computers but to cars, light bulbs, refrigerators and more.

What are you not seeing? Look underneath.

When coding on the web, remember that effectively NOTHING is hidden from you.

A friend emailed with a question about some CSS files not caching. This is a smart guy with a long question about a confusing behavior in the browser. I asked - as I often ask - what's happening underneath? Did you look inside?

Are you using Fiddler? Did you press F12 in your browser of choice and explore their network tools? Are you using WireShark?

Literally this moment, as I am writing this post, I just noticed that the Twitter box on my blog here doesn't have my latest tweet embedded.

Where's my tweet?

I could hit refresh a bunch of times, google around for vague terms, email a friend, or I could look inside.

I hit F12 in my browser. I look at the Network tab, and sort by Status.

Remember to use the Network Tools in your browser

Hey, suddenly my Twitter API call is a 404. First, that's lame of them. They should have redirected me, but alas, no one respects the permalink anymore. #getoffmylawn

With this single  insight I am now armed with googleable terms. I do a single search for "twitter user timeline json api" and see at the Twitter Developer Center that they've changed the format to included "api." and a version number.

I change my template to call this changed URL https://api.twitter.com/1/statuses/user_timeline/shanselman.json?callback=twitterCallback2&count=10 instead, and hit Refresh in my browser, once.

There's my tweet?

There's my tweet. No joke, this just happened. Good timing, I think.

You decide how deep you want to go down the rabbit hole. I am not expecting everyone to be a neurosurgeon or a professional network engineer but I firmly believe that digging just one layer deeper in all things will enhance your life and your work.

Learn basic HTTP debugging and ALWAYS check your result codes. Even if you are a non-technical blogger, learn how to check for 404s and 301s and 500s and assert your assumptions.

The world - and the internet - is not a black box. Look inside.

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook twitter subscribe
About   Newsletter
Sponsored By
Hosting By
Dedicated Windows Server Hosting by SherWeb

Windows 8, Step 0 - Turn on continuous backups via File History

November 11, '12 Comments [52] Posted in Win8
Sponsored By

So you've installed Windows 8. I'm going to do a small series of posts called "Windows 8, Step 0" with tips on what to be sure to do after you've installed Windows.

Here's an important TODO for you. Do it NOW. Do it all your machines, especially Non Technical Family Member's machine. Take that giant external USB drive you've got lying around and plug it in.

From within the Windows 8 Start Screen, type "File History" then click "Settings"

File History in Settings

Click it. Turn on File History and point it to your giant external drive, or some large network share that you have available.

File History is ON

This is kind of like Time Machine on a Mac. It will keep a constant shadow of your files backed up to this other drive. It runs automatically and you don't think about it until you lose something. It will automatically backup anything and everything in your Libraries (including Documents, Photos, Videos, Music) and everything on your Desktop.

If you want to backup more specific stuff, add whatever files you want to your Windows Libraries. I've added photos from another drive, for example as well as Documents from my DropBox folder.

image

You can click Advanced Settings there on the left to control how long the files are kept, how much disk space is used and how often it happens.

My File History runs hourly and uses 5% of the drive

I've also checked the box under HomeGroup to automatically recommend this large drive to the rest of the house! This is awesome for a few reasons. Other machines in the HomeGroup will automatically see this drive and can use it just by clicking "Turn on."

In the screenshot below you can see the File History dialog from my laptop with the 3TB drive from my other machine called HEXPOWER7 being recommended as a good drive for File History. One click, now my files are backed up on this machine.

File History from another computer recommends the main HomeGroup machine

HomeGroups are groups of computers at home that you trust and want to share files and devices with. You can make a HomeGroup in less than a minute. From the Start Screen, type "HomeGroup" then Click "Settings." Follow the instructions.

If you want, you can click Select Drive and pick any drive on your machine or add a network location. I have a 5TB Synology NAS so I could use that also. Any Windows-compatible SMB/Samba NAS will do.

File History to a NAS

Now I'm backing up to the Network Attached Storage (NAS).

File History on my NAS

Restoring from File History

Once you've been running File History for a while, you can go back to the Start Screen and type "Restore Your Files" and click "Settings" to get this dialog:

Restore File History with my files in a scrolling calendar

There's folder I want from my Desktop but it's not there as I've deleted it before. I will click the back button (you can hold it down to go back in time fast) until I get to a day when that file existed. I can also search my entire File History for previous versions of files.

I've backed up to November 6th and there's the file on my Desktop.

An old file from the past

Just click the green back-in-time Restore button and it's put back where it was. I can also restore it to a specific new place if I want to.

I hope this helps you. It's helped me!

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook twitter subscribe
About   Newsletter
Sponsored By
Hosting By
Dedicated Windows Server Hosting by SherWeb

Many Raspberry Pi projects - How can you not love a tiny computer?

November 8, '12 Comments [23] Posted in Hardware | Open Source | Reviews
Sponsored By

Picade Raspberry Pi ArcadeHow can you not love a tiny computer? I posted about Top 10 Raspberry Pi Myths and Truths and since then I'm up to four Raspberry Pi devices. The most recent is the new Raspberry Pi "Model B" that includes 512 megs of RAM.

Sure, Raspberry Pis aren't fast, but what they lack in performance they make up for with chutzpah. They have a nice GPU as well which will decode 1080p MP4 video in hardware and play it just fine. Even better, for about $4 you can get a license to unlock MPEG-2 or VC-1 decoding in hardware.

I also have a Netduino and Netduino Plus as well as an Arduino that I use with the greatest FPS Controller in history, the SpaceTec SpaceOrb along with a custom OrbShield that provides a bridge between the RS-232 Serial Port and the Arduino.

All these devices are very reasonably priced and a great fun for kids or adults.  Next I'm looking at the PIX-6T4 "game console" that lets you write tiny games in C# on a Netduino Mini or perhaps a Netduino Go.

Don't listen to the folks who write negative headlines about the Raspberry Pi. Sure, it's the wild west but with a little patience you'll do fine. There's an amazing community around the Raspberry Pi.

The amount of excitement around these tiny machines is amazing. There's even a Kickstarter for a "Picade" tiny arcade cabinet.

To make things easier once you get your Pi, I do recommend the Adafruit Raspberry Pi Budget Pack if you don't want to go hunting for parts. This kit includes a great little clear case, a 4 gig SD Card (actually a mini with an adapter, which is great since the Netduino Plus has a mini SD slot), cables and power, but best of all, a breadboard, wires and a lovely little ribbon cable and "cobbler" that makes it super easy to keep things tidy while still messing with the Raspberry Pi's GPIO (General Purpose Input Output) connections.

Related posts you might like

LEGO Raspberry Pi CaseWhat's great about the Raspberry Pi and small devices like it isn't the price -although that's great - it's that the Raspberry Pi has a GPIO and HDMI. This means it's the easiest and cheapest little PC that can talk to the outside world's many hardware devices. Having the combination of  HDMI out (for your TV) and GPIO (for everything else) means it's extremely accessible to the beginner.

That GPIO port along with its ease of programming gives rise to such fun as as the RetroPie GPIO Adapter that let you hook up your old Super Nintendo (SNES) controllers to a Pi! You can order a RetroPie GPIO Adapter here. Here is Video of the RetroPie in action. I am not affiliated with this creative person at all, I just dig the idea.

So I've got four now. Some friends have tweeted me saying that they bought one Raspberry Pi and haven't gotten around to doing antyhing with it, usually because they aren't sure WHAT to use it for.

Here's what my Pi's are currently doing:

I'm sure there are more reasons to buy more Raspberry Pis. Here's a few.

Seventeen Awesome Raspberry Pi Projects

These are some exciting and fun projects for you to explore with Raspberry Pi that might make your Pi feel more useful and get you playing today!

Be sure to check out the Element 14 Community Site for Raspberry Pi. I also love AdaFruit and their Pi-related products like the Adafruit Pi Box (I have 2) or the Budget Pack (I have 1).

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook twitter subscribe
About   Newsletter
Sponsored By
Hosting By
Dedicated Windows Server Hosting by SherWeb

Reactive Extensions (Rx) is now Open Source

November 6, '12 Comments [10] Posted in LINQ | Open Source
Sponsored By

A few years back I did a podcast with Erik Meijer about Reactive Extensions for .NET (Rx). Since then thousands of people have enjoyed using Rx in the projects and a number of open source projects like ReactiveUI (also on the podcast) have popped up around it. Even GitHub for Windows uses Reactive Extensions. In fact, GitHub uses Rx a LOT in their Windows product. My friend Paul at GitHub says they liked the model so much they made a Mac version!

“GitHub for Windows uses the Reactive Extensions for almost everything it does, including network requests, UI events, managing child processes (git.exe). Using Rx and ReactiveUI, we've written a fast, nearly 100% asynchronous, responsive application, while still having 100% deterministic, reliable unit tests. The desktop developers at GitHub loved Rx so much, that the Mac team created their own version of Rx and ReactiveUI, called ReactiveCocoa, and are now using it on the Mac to obtain similar benefits.” – Paul Betts, GitHub

Today, Microsoft Open Technologies announced the open sourcing of Reactive Extensions! You can get the code with git up on Codeplex at https://rx.codeplex.com. You can’t stop the open source train! Congrats to the team!

There’s a LOT included, so be stoked. It’s not just Rx.NET, but also the C++ library as well as RxJS for JavaScript! Now everyone gets to play with IObservable<T> and IObserver<T>.

  • Reactive Extensions:
    • Rx.NET: The Reactive Extensions (Rx) is a library for composing asynchronous and event-based programs using observable sequences and LINQ-style query operators.
    • RxJS: The Reactive Extensions for JavaScript (RxJS) is a library for composing asynchronous and event-based programs using observable sequences and LINQ-style query operators in JavaScript which can target both the browser and Node.js.
    • Rx++: The Reactive Extensions for Native (RxC) is a library for composing asynchronous and event-based programs using observable sequences and LINQ-style query operators in both C and C++.
  • Interactive Extensions
    • Ix: The Interactive Extensions (Ix) is a .NET library which extends LINQ to Objects to provide many of the operators available in Rx but targeted for IEnumerable<T>.
    • IxJS: An implementation of LINQ to Objects and the Interactive Extensions (Ix) in JavaScript.
    • Ix++: An implantation of LINQ for Native Developers in C++

A great way to learn about why Rx is useful is to check out the Rx Koan’s project or to read the IntroToRx online e-book.

Why do I think Rx matters? It’s a way to do asynchronous operations on event streams. Rather than hooking up click events and managing state with event handlers all over, you effectively “query” an infinite stream of events with LINQ. You can declaratively sequence events…no flags, no state machine.

For example, here’s a dragging event created (composed) via Mouse button and Mouse move events:

IObservable<Event<MouseEventArgs>> draggingEvent =
from mouseLeftDownEvent in control.GetMouseLeftDown()
from mouseMoveEvent in control.GetMouseMove().Until(control.GetMouseLeftUp())
select mouseMoveEvent;

Even better, Rx makes it easier (or possible!) to create event-based tests that are asynchronous, like this example from Jafar Husain:

Rating rating = new Rating();
IObservable<Unit> test = // Unit is an object that represents null.
ObservableExtensions
.DoAsync(() => TestPanel.Children.Add(rating))
.WaitFor(TestPanel.GetLayoutUpdated()) // Extension method GetLayoutUpdated converts the event to observable
.DoAsync(() => rating.Value = 1.0) // Calls the Ignite EnqueueCallback method
.WaitFor( // waits for an observable to raise before going on
// listen to all the actual value change events and filters them until ActualValue reaches Value
rating
.GetActualValueChanged() // extension method that converts ActualValueChanged event to IObservable
.SkipWhile(actualValueChangedEvent => actualValueChangedEvent.EventArgs.NewValue != rating.Value))
// check to make sure the actual value of the rating item is set appropriately now that the animation has completed
.Assert(() => rating.GetRatingItems().Last().ActualValue == 1.0) // crawls the expression tree and makes a call to the appropriate Assert method

Test.Subscribe(() => TestPanel.Children.Remove(rating)); //run the test and clean up at the end.

There’s amazing Time-related operators that let you simulate events over time. Note the Buffer and Subscribe calls.

var myInbox = EndlessBarrageOfEmail().ToObservable();

// Instead of making you wait 5 minutes, we will just check every three seconds instead. :)
var getMailEveryThreeSeconds = myInbox.Buffer(TimeSpan.FromSeconds(3)); // Was .BufferWithTime(...

getMailEveryThreeSeconds.Subscribe(emails =>
{
Console.WriteLine("You've got {0} new messages! Here they are!", emails.Count());
foreach (var email in emails)
{
Console.WriteLine("> {0}", email);
}
Console.WriteLine();
});

You can use await and async, like in this example returning the number 42 after 5 seconds:

static async void button_Click()
{
int x = await Observable.Return(42).Delay(TimeSpan.FromSeconds(5));
// x with value 42 is returned after 5 seconds
label.Text = x.ToString();
}
I’m just showing you the parts that tickle me, but one could easily teach a 10 week university course on Rx, and I’m still a beginner myself!

Here’s some more resources to check out about Rx. Congrats to the team for their contribution to Open Source!

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook twitter subscribe
About   Newsletter
Sponsored By
Hosting By
Dedicated Windows Server Hosting by SherWeb

Disclaimer: The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.