Tuesday, December 21, 2010

Urban Disaster Preparedness

Below are some simple stockpiling suggestions to help city dwellers survive a disaster. 

Why should I stockpile food, water, and other supplies? 
Because bad things can happen. Natural disasters such as earthquakes, volcanoes, hurricanes, floods, fires, or severe storms could force you to survive on your own for up to two or three weeks. Flu pandemic, terrorist attack by nuclear / biological /chemical /radiation, or economic collapse can breakdown society for several weeks or months. Grocery stores may be empty. The power grid, water/gas lines, transportation, fuel, and highways may all be broken or shut down. If you wait until you need it, it's a sure bet others have beat you to it.

Won’t the government provide for me in an emergency? 
Nope, FEMA clearly states it's your responsibility to provide food, water, and other supplies for at least the first three days of a disaster. In extreme cases, you could be on your own for up to several weeks or even months.

Isn’t stockpiling costly or wasteful?  
Nope. It's good insurance for surviving a disaster, and inexpensive if done right. 

Tier 1: How do I cover basic 2-3 day stockpile needs? 
Food shouldn't be a concern because most people typically have more than 2-3 days worth of food on hand, and could go that long without eating if necessary.  The biggest need is having sufficient water on-hand.  Use tap water in Walmart six-gallon water containers ($9), or use buckets with lids.  To purify, either boil the water or add 8 drops of bleach per gallon.

Tier 2: How do I cover 6-8 week stockpile needs for more severe disasters? 
For food, the simple approach is to buy bulk items having a long shelf-life.  You could buy and store your own rice, beans, pasta, and other dry or canned goods; but Costco makes it easy.  They have an Emergency food supply ($90) with a 20-year shelf-life that provides 275 meals (feed a family of four 2 meals a day for one month).  They also have emergency rice ($50) and pinto bean ($60) buckets. 

Costco offers a solid emergency supply kit ($140) that should cover most basic needs.  It includes 90 servings of food, a water filtration system, hand crank flashlight/radio/cell phone charger, and typical survival supplies (matches, cord, space blankets, water pouches, compass, multi-tool, etc.).  This can be your "go-bag." 

Tier 3: What other stuff might be worth stockpiling?
* Fire: lighter; matches
* Fuel: extra propane tanks; kerosene; gasoline; wood
* Light: flashlights (hand crank?); candles; lantern; wicks
* Cooking: vegetable oil; cook stove; cast iron pans
* Flavoring: salt; sugar; honey
* Protein: tuna/chicken cans; boxes of oatmeal; dry milk
* Carb's: dry pasta w/cans of tomato sauce; crackers; dry cereal
* Toiletries: buy large Costco quantities for everyday use, always have spares
* First-Aid¹: band-aids, vitamins, iodine (f/radiation), rubbing alcohol, hydrogen peroxide
* Drugs: aspirin, analgesics, antibiotics, antifungals, antihistamines, antivirals, and steroids
* Water: buckets w/lid; bleach; filter (Britta?); identify local source 
* Power: batteries; rechargeable batteries; solar recharger
* Weapons: (for defense) shotgun, pistol, rifle, ammo, bat, machete, sword, nun-chuks...
* Shelter: tarp; stakes; rope; twine; sleeping bag; blankets
* Seeds: if extreme TSHTF then start your own vegetable garden
* Help/Barter: buy more of the above than you need to help neighbors and for trading

Other Information and Planning:
* Family Communication Plan²: who to call out of state, etc.
* Utility Shut-Off³: where and how to shut-off the water, power, and gas
* Escape Plan²: when, where, and how to bug out to if the city becomes too dangerous
* Safety Skills: how to provide CPR, dress a wound, properly prepare water, etc.
* Literature: keep books and paper copies of disaster-specific survival tips (no internet?) 

How do I store it?
In a cool, dark, place with low humidity and an ideal temperature of 60°F.  I like buckets and lids (~$4) from Home Depot or Lowes because they stack well, seal well, and are portable.  Ziploc bags inside the buckets keep contents air tight for a longer life.  Use 3" mailing labels and a black felt pen to label buckets and ziploc bags.

¹ First Aid: Ready.gov or 72hours.org
² FEMA Emergency Plans
³ Utilities: 72hours.org, FEMA


Wednesday, August 4, 2010

Release of MSSQL.SchemaDiff

Last 2.5 months' spare time has been spent building MSSQL.DataMask. Just released v1.0.0.5 after several weeks of beta feedback.  Very fun project.  Use it multiple times a day at my real job when doing database updates and ensuring dev, test, staging, and production db's all in synch.  Use it to ensure full setup script database matches udpate script database.

Download from: http://www.wintestgear.com/products/MSSQLSchemaDiff/MSSQLSchemaDiff.html

Description: MSSQL Schema Diff is a free database comparison tool used to quickly and easily locate structural differences between two SQL Server databases. Results are clearly displayed with MSSQL objects in a familiar SQL Management Studio tree layout and property comparisons in a matching  data grid. Intuitive icons and color codes make it easy to spot differences. Filter buttons make it easy to narrow down to just what is different or missing from one or the other database. Usage is simple; you select two MSSQL databases, click Compare, then browse the differences

Use MSSQL.SchemaDiff to:

• Troubleshoot and find errors caused by database differences
• Ensure consistency between dev, test, staging, and production database environments
• Learn what changed between database versions

Thursday, May 20, 2010

How Do I Uninstall a .NET Windows Service If the Executable Was Moved or Deleted?

Was working on a project for another team at work.  Decided to re-arrange folders and re-pull from source control.  But after moving the folder, ran into problems.  Wanted to uninstall the service and reinstall.

After some searching, happened across the right keywords in a Google search.  Turns out David Klein has several answers at his blog: http://ddkonline.blogspot.com/2008/07/cannot-uninstall-net-windows-service.html.

Saved here for future reference.   Thanks David.

Wednesday, April 21, 2010

How Do I Add My Company Logo Icon to Browser URL's

Create a 16 x 16 icon.  Name it "favicon.ico".  Place it in your root folder.

That's all.

Note that the icon is only downloaded the first time a user visits your web page.  Thus, if you cannot test view the icon initially after placing it...then clear your browser cache and try again...it will work.

Note that you can also embed a 32 x 32 icon in the same file as the 16 x 16 for clearer decktop shortcuts and favorites.

Tuesday, April 20, 2010

Beta Release of MSSQL.DataMask

I've been buried for 3 months spending all spare time creating MSSQL.DataMask.  Just released it in beta for feedback.  Will go through several weeks of testing and bug fixing.

Download from: http://www.wintestgear.com/products/MSSQLDataMask/MSSQLDataMask.html

Description: If you need rich test data to develop, test, or outsource your project, you've probably tried either generating from scratch, or cloning from production data. Auto-generating the test data is difficult and error prone for all but the simplest databases due to complex variances, frequencies, and data interdependencies. Business and legal obligations such as HIPAA require that production data clones be thoroughly sanitized of protected personal or health information.

MSSQL.DataMask is a simple, free tool that will quickly sanitize a clone of your production database into a safe, secure test database. Once built, the process is easily repeatable to refresh your test data from production. You can either load and re-run a set of data masks from the application, or generate a fully documented tSQL script to modify, run, or schedule as your needs dictate.

Scrub: Overwrite all rows of a column with the "same value"
• Scrub.Null: Overwrite with null
• Scrub.EmptyString: Overwrite with empty string ("")
• Scrub.FixedString: Overwrite with a text you enter
• Scrub.Zero: Overwrite with zero (0)
• Scrub.FixedNumber: Overwrite with a number you enter
• Scrub.FixedDate: Overwrite with a date/time you enter

Substitute: Overwrite all rows of a column with a "unique value"
• Substitute.LoremGibberish: Overwrite with a random lorem ipsum gibberish text (retains original size)
• Substitute.GUID: Overwrite with a random GUID (16-character text only)
• Substitute.RandomNumber: Overwrite with a random number between min/max points you specify
• Substitute.RowNumber: Overwrite with a row number (and text you specify if n/varchar)
• Substitute.FromList: Overwrite with a random selection from value list you specify

Transform: Overwrite all rows of a column with an "obsfucated original value"
• Transform.Scramble: Overwrite with scrambled original value (encrypt, then truncate at initial length)
• Transform.Hash: Overwrite with hashed original value (MD5, always 16-bytes)
• Transform.Prefix/Suffix: Prefix and suffix original value (with text you specify, can leave blank)
• Transform.Find/Replace: Find & Replace text within original value (you enter find/replace text)
• Transform.AsteriskMask: Overwrite first (n) characters with asterisks (like credit card statements)
• Transform.ShuffleRecords: Randomly shuffle all rows within column (my favorite for most test data)
• Transform.NumericVariance: Randomly de/increment original numeric value by percent you select
• Transform.DateVariance: Randomly de/increment original date value by number days you select
• Transform.DateTimeVariance: Randomly de/increment original date & time values by your selections
• Transform.Truncate: Cutoff original value at character length you specify

Saturday, January 30, 2010

Test Case Manager Lite

Do you develop and test software...if so you may often run into these questions...

1. Are we ready to ship?
2. How much longer will it take to test?
3. If we release now, what is our exposure (lack of test coverage)?
4. Are we systematically regression testing existing functionality, or adhoc testing differently each time?
5. Are we capturing every bug in a test case to prevent recurrence?
6. How is our quality trending from test cycle to test cycle?
7. Do we have proven written test cases on which to start automating?

Just released TCMLite as a free, simple, highly configurable test case management tool enabling you to better answer these questions. Use TCMLite to design, write, and execute your test cases. Your entire test team can concurrently access the same test case repository (XLS file) using Excel's "shared workbooks" feature (Help section 1.4).

Saturday, January 16, 2010

Tuesday, January 12, 2010

How do I quickly get record counts for all MSSQL tables?

Frequently when testing, you will need a quick way to get record counts for all tables in a given database. For example, you can take before and after snapshots of all tables' record counts to quickly ensure the proper work was done on the right tables.

The following two-line SQL statement will automatically generate a much larger, custom-built SQL script that can be copied and executed to fetch counts for all tables in the target database.

Monday, January 11, 2010

How do I quickly get MSSQL table sizes?

Frequently when testing, you will need a quick way to get the size (in kilobytes) for all tables in a given database. For example, you can take before and after snapshots of all tables' sizes to quickly ensure the proper work was done on the right tables.

Sunday, January 10, 2010

How do I flush the MSSQL cache for performance testing?

When performance tuning, you often follow a cycle of changing the tSQL, running it in query analyzer, jotting down the new execution time...and repeating the cycle again and again to reduce the time.

Because MSSQL caches results, your performance timings can be inaccurate. For example, the first run does the work and takes say 35 seconds. All subsequent runs might take 1 second or less because they are not doing any work. The subsequent runs are simply fetching the previously cached results.

Saturday, January 9, 2010

Free Tool for Comparing MSSQL Databases

There is frequently a need to compare two databases when developing or testing a data-driven application.

You'll want answers to questions:
  • Did a table change?
  • Did some fields get added, deleted, renamed, or have a type change?
  • Did views or triggers or indexes get modified or added?
  • Did source code inside a stored procedure change?
  • Is the testing schema different from the development schema?
  • Have there been any changes in the development schema since last week?

Saturday, January 2, 2010

Oops, I've Been Breaking Many .NET Coding Standards!

Back in the classic VB3-6/VBA days, I heavily used hungarian notation as it was the naming convention standard. Assumed I should continue following the same standard when naming my objects in .NET. Found out this is wrong and that I've been violating several .NET / C# best practices.

Friday, January 1, 2010

Wait! Don't throw out that old computer that won't boot

The fix can be as simple as a $4 CMOS (watch) battery.

My evening backups failed two nights ago. A ping didn't respond. When I hooked up a monitor, the Windows logo was frozen onscreen.

Okay, no problem, BSOD's or freezes can happen on old hardware running windows. Reboot should do the trick.