Frozen Bytes

liquescent frozen bytes of code to manageable puddles

VirtualBox Clone Snapshots

VirtualBox Attacking Clone Snapshots This is mainly a reference post for later. I’ve found myself digging through history or stale bookmarks for steps to clone a snapshot within VirtualBox. This is a pain, be much easier to just search my blog for it. You will thank me later.

The main premises, one of my VMs crapped out after receiving a MS update, unable to boot. Imagine that!? I tried rolling back to a previous snapshot with no luck. My goal is to save the work I’ve done between my last snapshot and the VM not booting. In my case, there are many snapshots, I want to clone the VHD to snapshot I know works, boot it , update it, boot again ensuring all works before trying anything drastic to recover my data on current VM.

Important to note, should be able to boot new VM, reference the old VM as a mountable drive to pull off the data.

The commands below cloned snapshots fine for me in the past. I will say, using clonehd to clone a specific snapshot of a disk is much faster than any other option listed below. However, as of VirtualBox 4.1 Cloning has been added to the GUI menu.

One Big Super Double Warmup Chocolatey to Go

Frozen Bytes Chocolatey Series

Frozen Bytes Chocolatey Series

What is Chocolatey

Chocolatey is a global automation tool that makes use of PowerShell and the NuGet infrastructure to allow you to do virtually anything. It is kind of like apt-get, but for Windows (with windows comes limitations).

Did he just say package manager for Windows!?? Yes! OOOH AHHH! Listen and take note. Remove the complexity and aggravation out of installing and updating applications or a series of applications with Chocolatey. Simply type a few commands in PowerShell or the command prompt then let Chocolatey do the rest. You will never want to install an application on windows by double clicking an MSI again! Enough talk, time to install Chocolatey and explore the sweetness.

Frozen Bytes Chocolatey Series

Frozen Bytes Chocolatey Series Several months ago, back in September of last year I was sitting in a hotel room in D.C. reading blogs and stumbled upon Chocolatey. Chocolatey is a package manager for the Windows platform similar to apt-get package manager concept. The magician behind the brown sweetness is fervantcoder ( Rob Reynolds ). Like many of you, my initial response, ABOUT DAAAAMMMMN time we get a package manager for windows! What a great idea! My goal over the next month is to release a blog series accompanied with videos for my personal development and learning. In the process I hope to demonstrate the OH SO SWEET work Rob has done with Chocolatey.

  1. One Big Super Double Warmup Chocolatey To Go
  2. Grab Some Chocolatey Packages
  3. Create and Publish First Chocolatey Nuget Package
  4. Create Chocolatey Chunks ( dependencies )
  5. Create Development Chocolatey Blocks

Zazar Simple jQuery Plugins for Feed Consumption

ZaZar FREE JQuery Plugins Working on a new landing page for my site this week which leverages Impress.js to transition the user through a series of sections on a page ( deserves another post ). There are two sections, blog and twitter that require feed consumption. I’d like to leverage a widget or JQuery plugin for this functionality. I must admit, has been a long time since I’ve worked with widgets and plugins providing feed consumption I decided to do some Googling and hit up StackOverflow. My goal started out to find something simple, easy to use, quick to setup, and flexible enough to get the job done. I’d rather spend more time on crafting my snappy UI at this point. Below is the list I decided to investigate.

  1. YQL
  2. Google AJAX API
  3. jFeed
  4. jQuery-rss
  5. Zazar

Deciding which to use did not take long.

Git Add All DOH

Git add -A DOH My recent blogging enironment changes now have me at the terminal alot interacting with git. I quickly noticed it was becoming a pain to do git add folderFileName all the time for each folder file. After doing git add -help it become quite clear I can add everything all at once using git add -A. It is important to note, I consider myself a git newbie. This little trick is likely totally apparent to most git users. To that end, being the admitted newbie I made a mistake. Yes, a big DOH moment! You guess it, I did git add -A and never told git to ignore RedCoth directory. Meaning, all my files and folders I wanted did get added to staging BUT so did all the RedCloth files ( which do NOT need to be under source control ). Of course, after the DOH, flashes of Rob Conery warning me about this very occurance in Tekpub Mastering Git session. Moving on. How is the RedCloth directory and files removed from git local staging?

CoffeeScript Play Time and References

CoffeeScriptI’ve been meaning to play with CoffeeScript for sometime now. A few months ago, I skimmed through CoffecScript.org site and The Little Book on CoffeeScript but never actually wrote code to generated JavaScript. The other day I watched the Tekpub training on the Art of Speaking with Scott Hanselman ( the master ) in which Rob Conary challenged Scott to give a 15 minute presentation on CoffeeScript in a few hours. After listening, I was recharged to get code playtime with CoffeeScript. I leveraged JSFiddle to play with the JavaScript real-time but leveraged Visual Studio with Mindscape Web Workbench to play with CoffeeScript. Scott Hanselman talks in detail about Mindscape Web Workbench here. You can also head over to JS 2 Coffee Generator to generate some JavaScript into CoffeeScript on the fly.

I do NOT plan to introduce CoffeeScript or sell you CoffeeScript like a used car salesman! Instead, breeze through VS 2010 setup, review some code examples and provide a list of resources ( web casts, books, blogs, and tools ) to help educate and convince yourself CoffeeScript is meaningful. I will briefly explain what CoffeeScript is and list a few benefits. In a future post I will discuss what IcedCoffeeScript brings to the table.

What is CoffeeScript?

CoffeeScript is a little language that compiles into JavaScript. CoffeeScript is an attempt to expose the good parts of JavaScript in a simple way. The golden rule of CoffeeScript is: “It’s just JavaScript”.

Advantages of CoffeeScript

  • Safety of compiled code ( passes through JavaScript Lint )
  • JavaScript output code is readable and pretty-printed
  • Repeatability and consistency
  • Runs as fast or faster than most handwritten JavaScript

Disadvantages of CoffeeScript

  • Learning curve?
  • Difficult to debug?

Visual Studio 2010 Setup

At the time of this post version 2.0.515.19552 supports VS 2010 and has experimental support for VS 2011 IDE. To setup Visual Studio 2010 with Mindscape Web Workbench and generate your first JavaScript file from CoffeeScript follow the next steps.

Sublime Text 2 CoffeeScript Setup

Sublime Text 2 and CoffeeScriptI’m using Sublime Text 2 for development on my Linux machine which has good support for CoffeeScript. If you are using Sublime Text 2 I recommend installing Package Control package manager by Will Bond and reading Using Sublime Text 2 for Development by Andy Miller. Sublime Text 2 supports TextMate bundles, to get CoffeeScript syntax highlighting just install the bundle through Package Control.

Install CoffeeScript Interpretor using your Linux distribution package manager or npm. I’m running Linux Mint 10, running my packager installer installed CoffeeScript to usr/bin. Make sure “path” is pointing to where the “coffee” executable is in your system (installing CoffeeScript using npm by running “npm install -g coffee-script” installs it to /usr/local/bin). There is no need to create a new build system file for CoffeeScript as one was created after installing the Sublime Text 2 CoffeeScript plugin. However, the path to CoffeeScript Interpretor needs to be verified before building.

After install Package Control, restart Sublime, access package control through the Command Palette using Ctrl+Shift+P. As you start typing commands, you get an overview of the available options. If you execute “discover packages” a browser pops up giving you a nice overview of all available packages and a search bar. To install a package, use command “install package”. Press enter to get a list of all available packages, type CoffeeScript, install it.

Starting Seven Languages in Seven Weeks

Seven Languages in Seven Weeks, by Bruce A.I recently made the decision to tackle the Seven Languages in Seven Weeks, by Bruce A. Tate. The book covers Ruby, Io, Prolog, Scala, Erlang, Clojure, Haskell. It has been a goal last couple of years to learn one new language each year, which I’ve fallen just a bit short as I did not learn as much as I set out around Objective C or Ruby. Year 2012, I’m excited to tackle Seven Languages in Seven Weeks where I will learn Ruby, Scala, Erlang, Haskell and more. Week one is Ruby. Yellow light, red light, green light Go!

I’ve been reading blogs, working with some basic Ruby in my Octopress Rakefile but am looking to learn more and take some Ruby on Rails too. The plan is to tackle week one with Tate, do one episode from Rails 3 tekpub session every two days and Sinatra, and do a day of Ruby using RubyMonk. RubyMonk currently has 6 chapters, each chapter has 2-3 lessons with exercises to learn Ruby quickly. Within each lesson there are a number of Problems you can tackle to reinforce learning. I’ve complete chapter 0 - Introduction to Ruby Collections.

RubyMonk Chapters:

  1. Introduction to Ruby Collections
  2. Introduction to Ruby Objects
  3. Classes and Object Oriented Programming in Ruby
  4. Introduction to Strings
  5. Conditions and Loops: Control Structures in Ruby
  6. Hashes in Ruby
  7. More Ruby
  8. Coming Soon

How to YAML

It is no secret, I’m enjoying Octopress! I’ve been tweaking Octopress to better suite my needs and make my process even simpler. In my effort to build a couple custom rake tasks for my Octopress fork I required the ability to read a few properties from the _config.yaml file. Before we dive into the code, what is YAML anyway? YAML stands for YAML Ain’t Markup Language and it is a versatile human friendly data serialization format. Some people believe YAML is easier to use and understand than JSON. That might be true, but I believe they serve two different purposes.

YAML is a simple human readable store of name/value pairs. You could compare it to an INI file, some also compare it to a Java properties file. Comparing YAML to JSON, you can, they both store name/value pairs or collections of but JSON is the accepted data transport for the web. When you think of RESTful services or even AJAX calls, I do not think of YAML for data transport, I think of JSON. Why? Because JavaScript understands JSON natively, not YAML. There are JavaScript YAML parsers available, like this js-yaml and checkout js-yaml online. In the same respect, dealing with configuration files, I think of YAML, XML or INI files not JSON.

Here is a simple YAML file to store values for root, url_base, and disqus_developer. In the Octopress world this file is called _config.yml, you name it anything you’d like just ensure it has .yml extension.

root: /
url_base: http://i-m-code.com/blog/
disqus_developer: 0

Open your favorite editor, mine is Sublime Text 2, create a new file, save it as Rakefile. Now add the below code to create your first Rake task to output the values in your YAML file. Open a terminal, navigate to the directory, run bundle exec rake burst to execute the task.

Rakefile burst
1
2
3
4
5
6
7
8
9
10
require "rubygems"
require "bundler/setup"

desc "My first Rake task to read and output a YAML file."
task :burst do
  yml = YAML::load(File.open('_config.yml'))
  puts yml['root'] # /
  puts yml['url_base'] # http://i-m-code.com/blog/
  puts yml['disqus_developer'] # 0
end

Evolving Windows Installer Error 0x80110414 Nightmare

This blog post will evolve as I progress through this Windows Installer error 0x80110414 nightmare I find myself in. Please keep in mind this is a work in progress BUT I would WELCOME any input, battle scars, references, suggestions, questions in the spirit of working towards an acceptable solution.

Problem

A Windows Installer error Error 26105. Failed to create web application. (-2146368492 /LM/W3SVC/1/Root ) which does not happen consistently is rolling back out installation. Using Wix 3.5.2519.0, the package installs one IIS Web Site and configures a Virtual Directory under the new web site created. Running the Windows Installer again no error occurs, installs successfully. I can only reproduce this the very first time the Windows Installer is run, all subsequent installs run fine. Basically we are rolling back a VM to be able to reproduce the installation error otherwise it does not occur again.

Error Messages

The error messages below are the very first errors that Wilogutl picks up leading me to believe this is the root cause of the downstream errors with a few custom actions. This error message has been the focus of my investigation the last day or so.

1
2
3
4
5
6
7
8
(UNKNOWN)     WriteMetabaseChanges: failed to open '/LM/W3SVC/AppPools/MyClientAppPool/' key, retrying 30 time(s)... 
  (UNKNOWN)     WriteMetabaseChanges: Error 0x80110414: failed to create web application: /LM/W3SVC/1/Root 
  (SERVER)     MSI (s) (B8!24) [11:07:20:553]: Product: My Client Application (MCA 02.00.01) -- Error 26105. Failed to create web application. (-2146368492 /LM/W3SVC/1/Root ) 
  (UNKNOWN)      
  (UNKNOWN)     WriteMetabaseChanges: Error 0x80110414: failed to create ASP App 

  NOTE: Look at few lines above for clues on error
  (ERROR)      Action ended 11:07:20: InstallFinalize. Return value 3.