Win7 Library Tool

November 3rd, 2009

Windows 7 libraries are a really useful feature of Windows 7, however unfortunately they arrive in a slighly cut-down form out of the box.  Microsoft decided against exposing some really useful capabilities to users, like adding network locations, pretty much the first thing I tried to do.  You get this message:

windows7libraryerror

Luckily, you can add network locations (and any other un-indexed locations), but it must be done programatically.  MS supply a command line utility slutil.exe, candidate for the worst named executable in history.  Pretty sure it stands for shell_library_util.  Anyway, I decided to write a tool to make it easy to add network locations, and added a few other features as well:

  • Add network (UNC or mapped drive) and any other un-indexed folders to libraries.
  • Backup library configuration, such that a saved set of libraries can be instantly restored at any point (like after a re-install of the OS or for transfer between multiple computers).
  • Create a mirror of all libraries (using symbolic links) in [SystemDrive]:\libraries.  This means you can reference all your files using a much shorter path, and also provides another entry-point to your files in many places in the Operating System (e.g. file open/save dialogs).
  • Change a library’s icon.

win7librarytool

Hopefully it’s easy enough to use, so I don’t have to explain it :)

You can download it for free below.  (Note: This will only run on >= Windows 7.)

Download Installer | Source Code

I must give credit to Josh Smith for his TreeView CodeProject article, upon which this solution is modelled.

The application uses the Microsoft API CodePack to manipulate libraries, which I encourage you to check out if you are writing software to integrate / take advantage of new features in Windows 7.

If you want to learn why and how libraries were introduced in Windows 7, including diving into the .library-ms file format, you can read this MSDN article.

Usenet vs Bittorrent

February 9th, 2010

I switched from Bittorrent to Usenet about 2 years ago, and honestly it is hands-down the best way to get your movies/music/apps etc. Usenet has essentially all the same stuff as can be found on torrent sites (from what I understand, most content appears first on Usenet before it’s uploaded as torrents) but instead of downloading from ‘peers’, you download everything off a central server, so you are not relying on:

a) Popularity of the file
b) Your ‘peers’ having their computers switched on with bittorrent client running
c) Your ‘peers’ having good upload bandwidth

All major usenet providers support SSL so your connection to their servers is secure, and you will download at the maximum speed of your connection, so you will know exactly when you will have your files. Furthermore, you don’t upload anything (on Usenet, you are actually encouraged to leech), so if your ISP counts uploads, that’s a big saving. In fact, that was one of the primary reasons I switched. One night I accidently left my bittorrent client running and by morning my 15Gb quota for the month was blown and I had only downloaded a 700Mb file >:(

To download from Usenet, you use NZB files (sort of the equivalent of .torrent files). These tiny files contain information on ‘reports’ that make up a set of files (usually a collection of .rar files) that have been posted to a newsgroup. There are lots of sites where you can get NZB files, but I pretty much only use BinSearch, which is fast, free and secure. Some tips for beginners are:

  • After searching, you need to tick/check the items you want and then click the ‘Create NZB’ button.
  • Focus on collections (the ones with green text) and pay attention to the file size.
  • Use the Advanced search to search only for collections containing NFO files and that are between a specific file size range (very useful for narrowing down searches that return lots of results).

An alternative to searching is just browsing (like PB’s Top 100), probably the best site for this is NewzBin however you have to be invited to join. This site categorizes everything on usenet just like you were browsing the shelves of your local Video store. It’s free to browse, however you have to pay to download NZB files (or view NFO files), so I just switch back to BinSearch after i find something interesting.

Once you have your NZB file(s) you need a news reader application (equivalent to a bittorrent client) to actually download the files. I’m currently using the free GrabIt but this crashes almost every time on shutdown on Windows 7 (no data is lost, it’s just friggen annoying), so I’m currently investigating the other free options out there. There are stax of readers, including many you can pay for (e.g. NewsLeecher).

Your news reader app must connect to a news server which hosts essentially a mirror of all newsgroups, for which you must pay. I use and recommend AstraWeb $25 for 180Gb, never expires, SSL, 541 days retention. Giganews has a 14-day free trial if you want to try out Usenet before spending any ca$h.

Once you have downloaded, if any individual file was missing or damaged, you can repair/recover the missing info using QuickPar.

Although it may seem from the above that using Usenet is complicated, it’s really only the fact that there are a few things you need to do at the start (getting the apps, signing up to a news server). Once you have those in place, Usenet is a breeze and provides numerous benefits over torrenting. Go try it!!

Internet over copper sucks

November 7th, 2009

I am subscribed to the fastest available ADSL 2+ (24Mbps) connection here in Sydney, and my connection at three different houses I’ve lived in has always been unreliable.  Currently where I’m living, the connection actually goes down whenever it starts raining!  :?   It also frequently goes down just at random, when it’s not raining.  P2P seems to worsen the situation (not surprisingly), but usenet is superior anyway, so that’s not a problem anymore.  Granted, I am pretty far from the exchange (~4km), hopefully copper will be replaced with optic fibre in the next decade.

So a while back I wrote a small utility that shows an icon in the system tray reflecting whether you can contact (via ping) a remote host (google, or your ISP’s DNS server, for example).

Online icon: lookalive-up

Offline icon: lookalive-down

Clicking the icon shows your the history of ping times:

Look Alive

It can be run on startup, passing the name or IP of the remote host as an argument.  For example:

"lookalive.exe www.google.com"

You can download the utility for free here.

Cutting your chances of data loss

November 5th, 2009

Data loss is probably the single most traumatic experience possible for those that store their data electronically. In recent years, I have had the good fortune to be spared of this event, touch wood, but I will be forever mourning the loss of the first computer game I wrote, back in the early 90’s on a Mac SE/30.  It was a hypercard stack, 2.1 Mb in size, so I couldn’t back it up on a single floppy.  Eventually, the 40Mb HDD in that great machine died, and I was crushed.  Years of work, all that creativity, a window on my teenage years.  Gone.

But it was just a game after all.  Recently a friend of mine lost pretty much all the photos of their first born child (3 months worth) due to a botched home server upgrade.  Crushing.

We all know the answer is backup, but many people just don’t get around to it, thinking, ‘yeah I should do that’.  Like many people, I have a server at home (Gentoo linux) that is my firewall, dhcp server etc. and of course file server.  I have a 4.5Tb RAID5 (7 x 750Gb drives) which is about 80% full of data that I’ve amassed over the years.  At the moment there are only two clients – a desktop for everyday use, and a media centre hooked up to the TV.  Even though I do have some level of data redundancy since I am using RAID5, data loss will still occur if more than one HDD fails.

Ok, so finally to the point of this post – to boost my data integrity (and aid in learning WPF), I have written a ‘folder mirror’ utility.

Folder Mirror Screenshot

Folder Mirror Screenshot

As you can see, the folder mirroring process can be paused and resumed at will, log files are maintained in a directory of your choice, and a system tray icon is shown, which dynamically displays the percent complete.  To configure which folders to mirror, the program reads a file called folderMirror.config, in which you can define as many folders to copy as desired.  The utility is designed to be used as part of a scheduled backup, such as a scheduled task.  I have it running every day, creating a mirror of  the data I care most about on the two client computers.  So now my chances of losing data due to HDD failure have been cut down to managable odds, and I can sleep much easier.

You can download the utility for free here.