Himanshu Gilani

Web Developer and Entrepreneur. Founder of mementodb.com

Configuring a Vagrant VM as Chef Workstation: Part 2

| Comments

In this part we would configure chef workstation that we created in Part 1 to provision nodes on the Rackspace cloud provider.

Chef Terminology

Before we go over details of how to provision a Rackspace VM, lets review the chef terminology so that we have some common vocabulary

  • Nodes: Servers, VMs or physical machines or cloud instances.
  • Cookbook: A cookbook is a collection of recipes, attributes, and templates that Chef uses to package, distribute, and share configuration details. A chef repository can have many cookbooks and typically a cookbook configures only one service.
  • Roles: Roles are a way to group nodes by the function. Each role is associated with a run_list i.e. a set of cookbook/recipies that need to execute in given sequence for configuring the node. Nodes can have multiple roles.
  • Environments: In chef different nodes could belong to different environments like dev, stage, prod, etc. Like roles environments also have a run_list.
  • Data Bags: Data bags are like cookbook attributes but are used to store sensitive information like passwords, api keys, secrets, etc.

Configuring a Vagrant Vm as Chef Workstation Part 1

| Comments

Vagrant is a powerful tool as it allows us to create “lightweight, reproducible, and portable” Virtual Machines (VM) on the developer machine using provisioning tools like chef and puppet. If you are using chef as the provisioning tool then you would already know that vagrant VM already has chef-client tool installed along with the version of ruby. Since the vagrant VM already has chef-client and ruby it should be straightforward to use any vagrant VM as a workstation for working the Hosted Chef server for provisioning and maintaining VMs in cloud services like AWS and Rackspace. However, I found this not to be the case and I realized that the process of configuring a chef workstation is rather convoluted as both the version of chef-client and its pre-requisite ruby are really old versions of the software that result in all sorts of errors on trying to use the latest chef plug-ins and services. In the end after a lot of trial and error I came to realize that before you can Vagrant VM as chef workstation you need to configure latest version of chef and ruby.

Scripting Google Analytics: Part 1 - Tracking Pages and Events

| Comments

Google Analytics is a free web analytics tool from Google that you can use for tracking website statistics like page views, traffic sources, audience information, goals, funnels, etc. While a lot of the stuff is tracked automatically, it becomes overwhelming pretty quickly if you want to track customize analytics or want to track or create custom metrics. In this post, I will detail things I learned by experimenting with Google Analytics.

Introduction to LDAP

| Comments

LDAP is definitely not a buzz word technology these days, however a lot of organizations are still using LDAP. So, at some point in time you may be required to develop or maintain projects using LDAP. But since LDAP is an archaic technology, it is tough to discover right information about it on the web. Whenever I searched for it on the web, I found the right information filled with technical jargon and scattered across various articles. This post is my attempt at explaining everything you need to know to understand how LDAP protocol works.

Why I Love Git

| Comments

Recently I was in a discussion with couple of friends who still have to migrate on to the Git version control system. My friends had a lot of questions and showed hesitation in moving from SVN to Git. This post articulates my thoughts on why you should use Git and contains links to some excellent resources on Git that you can use to understand Git quickly.

NPM Features and Options Demystified

| Comments

In the previous post, NPM and package.json, I discussed how NPM and package.json could be used for managing the project and its dependencies. In this post I will discuss some of the overlooked features of NPM that help you in achieving more out of this tool

npm install and package versions

npm install {package} by default installs the package version tagged as “latest” in the npm registry. If you do not want the latest version of the package then you have few options. You can execute commands in the following way to control which package should be installed and from where to fetch the package.

Package with Specific Version: npm install {package}@{version}

1
npm install express@3.0.0

This command will install version 3.0.0 of express package form npm registry.

Package in a Version Range: npm install {package}@"{version range}"

1
npm install sax@">=0.1.0 <0.2.0"

This command will install sax package between version range 0.1.0 and 0.2.0

Why Memento Moved From Java to CouchApps to Node.js Technology Stack

| Comments

Memento, the app that I launched recently has already seen three technology stack changes. I started working on memento to be able to keep what I find on web with me as a personal memento. Being a Java architect I kicked off memento using Java. Since I was a solo developer on this project I wanted to keep everything lean in order to iterate quickly. This meant having an automatic code generation for the boilerplate code, using simple and powerful frameworks, following best practices, and tons of unit tests for making changes quickly and verifying the health of the app.

Spring Roo

With my lean strategy in mind I quickly used Spring Roo, a rapid application development tool for Java developers to generate the complete app with front-end, back-end, authentication, persistence, logging, and unit tests within couple of hours. So far I was happy.

Bootstraping a Node.js App for Dev/Prod Environment

| Comments

Setting up a web server in node is really simple. A basic hello world http server can be written in under 10 lines. However, if you want to write a production grade app then you are better of by using any framework that provides foundation and structure to your logic. When choosing frameworks there are no right or wrong answers. Important thing is to select a framework that is being actively developed, has community support and most of important of all you love the way it works.

Bootstrap a Node.js App with Express Application

Express is a web application framework for Node.js. It is simple to use and can be configured to work with popular technologies. To understand how Express works you can follow the Getting Started page on the express web site. This guide also explains how to use the express global executable for generating a skeleton web app.

Once you have generated a skeleton web application. You need to understand how to structure the skeleton app for the Dev/Prod parity as well as making few changes to the app for making your app modular.

Dev/Prod parity

You will notice following snippet in the skeleton app

1
2
3
app.configure('development', function(){
  app.use(express.errorHandler());
});

Introducing Memento

| Comments

Here is a wonderful application that allows you to save any web page that you like. It is your personal space with all that you like on the web. Some space that you can access whenver you like. You can create an account at www.mementodb.com

What are mementos?

Mementos are anything that you save using this application. You can think of a memento as a copy of the entire web page saved into your account for you to “use” later. When we say “use” we really mean you should be able to read, edit or print the mementos. For creating mementos we convert web pages that you want to collect into a text format that any one can edit without understanding the techonolgies of the web.

Why Use Memento?

Web is constantly changing, pages that you bookmark today may vanish tomorrow. But what if you found something on web that you want to keep as a personal memento. With Memento you can Save, Collect and Use your web.

How it Works?

Memento provides a bookmarklet that converts the web page you want to keep into Markdown and saves it to your account.