Saturday, May 18, 2013

How to install Windows 7 from a USB 3.0 Thumb Drive (FAST installation!)

This is the best article I've found yet on how to take advantage of USB 3.0 when it's needed most - during OS installation!

Serves as a great starter tutorial on using Windows Image format (.WIM). The image (sources\boot.wim) is mounted first. Then drivers are added. then it's saved and unmounted.

Just remember to change the filenames to match the filenames for your usb 3.0 drivers. For my Fujitsu UH572 Ultrabook they are iusb3hub.inf and iusb3xhc.inf.

How to install Windows 7 from a USB 3.0 Thumb Drive (FAST installation!)

Wednesday, May 15, 2013

Why I still use UltraEdit when Visual Studio 2012 is such an Excellent Editor

While Visual Studio has come a long way as an editor (not to mention as an IDE) there are still a few features in UltraEdit that keep me coming back (currently on v17.20):

  1. right click the tab for any open file and you can copy it’s path into the clipboard. This is really handy when you need to type in an outrageously long path as an argument to a command.
  2. quick open (ctrl+q). Often I’ll use this to quickly open log files. The paths are long but included in troubleshooting emails.
  3. reload changed files. Visual Studio will prompt you but UltraEdit can do it automatically (with a configurable polling interval). It can also automatically scroll to the end of changed files – a great way to keep an eye on the spew.
  4. compare files. I never sprang for UltraCompare because the comparison functionality built into UltraEdit has been more than sufficient for my needs.
  5. Regular Expressions. As of Visual Studio 2012 this gap has finally been bridged but even as late as VS 2010 there was still no way to use .net/PERL (pcre) regular expression syntax in the various find dialogs. That’s ridiculous – good thing VS 2012 provides this feature.

Monday, April 29, 2013

Digital Imperialist: What is Digital Imperialism?

Digital Imperialist: What is Digital Imperialism?: Digital Imperialism is all about living an all-digital lifestyle. No paper books, CDs or DVDs. No physical media that can be replaced by a ...

Wednesday, April 24, 2013

Opening a command prompt in a SmartCard security context

In a computing environment with very high security access to many resources requires a physical credential. I’ve only seen this in 2 places: back while working for a bank and at Microsoft. I imagine a similar story in defense related work but I’ve never done defense related contracting so can’t speak from experience.

Anywho, physical credentials are great. Except when you lose them. Or leave them in the computer. Especially if the credential serves double duty; it’s your way to enter the building and to access secured resources.

Windows has a wonderful feature that lets you start a command prompt with the credential. As long as that command prompt remains open it has access to secured resources. So you can take your physical credential out, leave the window open and do what you need to in that command prompt window.

Enter the “runas” command. Introduced in Windows 7 or Vista IIRC, it lets you run a command under different security contexts. One of those contexts is SmartCard. So I created a shortcut on the desktop with the following command:

C:\Windows\System32\runas.exe /smartcard "C:\Windows\System32\cmd.exe /k cd C:\Users\XXX\YYY && C:\Users\XXX\YYY\YYY.cmd"



This opens a command prompt, asks for your credential password then runs the command prompt under the smartcard security context. In this case there’s a bat (.cmd) file that sets up the target command prompt with a bunch of stuff not relevant to this discussion. The /k option to cmd.exe keeps the window open.

Thursday, April 18, 2013

Striping the boot volume across 2 SSDs for non-storage experts

If 1 SSD is good then surely 2 must be better? Smile

For a variety of reasons, one of which is to minimize compile/build times, I decided to try striping (RAID-0) the boot volume across 2 SSDs. My dev box is an HP Z420.

I’m a PC hobbyist not a storage expert. The answers to these questions might be obvious to someone more conversant with storage parlance. Posting this with hopes of helping other PC hobbyists enjoy maximum performance with minimum frustration.

Comments/fixes/errata welcome.

Can I get away with not using RAID at all?

The idea here was to use Windows 7 Dynamic Disks. This is very easy to setup and requires no extra hardware. Unfortunately Windows can’t boot from a dynamic disk.

Ok, How about Intel RAID since it’s built into the motherboard?

This *will* work but presents another problem. I’m striping SSDs. SSDs need TRIM support to extend their lifespan. Intel added TRIM support for it’s RAID solution (called Rapid Storage Technology) but only for series 7 chipsets. The HP Z420 ships with a C600 chipset which I presume is series 6. So no luck.

What’s this LSI RAID stuff in the “BIOS”

The firmware config (aka “BIOS”) has support for optional add-in RAID cards. One of which is the LSI 9212-4i. Apparently this falls somewhere between a standalone RAID controller add-in card and software RAID. And it’s relatively cheap – about $130

WTF is the LSI 9212-4i HBA?

While tracking this down I encounter an unfamiliar acronym (initialism really but no one uses that word properly). HBA is short for Host Bus Adapter. It’s a way of splitting the RAID implementation across the motherboard and an add-in module without requiring a full standalone RAID controller add-in.

Great, Does it support TRIM?

According to the LSI website TRIM is supported for LSI HBAs using an IT firmware (as opposed to an IR firmware). 2 new unfamiliar acronyms:

  • IT – Initiator Target
  • IR – Integrated RAID

I have no idea what these mean – that’s a Wikipedia surf session for another time. Turns out that the LSI 9212-4i HBA supports BOTH!

Both? At the same time? How quantum mechanically confusing!

Does it support both at the same time? Or is it in one mode or the other? Does it support both for UEFI and traditional BIOS?

Apparently it ships with IR firmware (usually) but that can be overwritten with IT firmware by following these instructions.

Tuesday, March 12, 2013

Turning on Visual Studio 2010 Code Analysis in a machine-independent manner

So you want to turn on Visual Studio 2010’s Code Analysis option but someone on the team rightly points out that this adds a machine specific directory to the .csproj file. Machine specific settings shouldn’t be in a shared project file (.csproj is typically shared).

Visual Studio 2010 uses MSBuild. MSBuild has lots of built in (“reserved”) properties. For instance, $(TEMP) will evaluate to the environment variable for temp.

Fortunately Visual Studio defines a property $(DevEnvDir) that, with slight modification, can point to the ruleset file required for Code Analysis in a machine-independent manner.

References

MSBuild Reserved Properties

Visual Studio Integration with MSBuild

Macros for Build Commands

Saturday, March 9, 2013

Command Prompts with Date and Time

I spend a lot of time in command prompts and have found it useful to have the date and time associated with a given command. It’s great for comparing “how long does this take” especially after the fact. To add this to your command prompt on Windows 7 (and probably XP and earlier versions), change the PROMPT environment variable ala:

PROMPT=$d $t$_$p$g

I usually set this as a user environment variable. These can be set by typing Start then entering “sys env” (no quotes). The first option should be “Edit the system environment variables”. Add a new user environment variable named PROMPT with the value specified above.

PROMPT syntax is described at the online docs for the prompt command.

While the date and time displayed don’t account for the amount of time it takes to type in the command (with very long commands this can be a few minutes) it’s usually a good indicator.