Cruisemaniac Dad, Husband, Geek, Cyclist!

Get Vagrant running with berkshelf on Mavericks

So, here I was trying to setup Vagrant on my Mac. Everything went fine till the vagrant up command and boom:

myfirstvagrantproject $ vagrant up
Bringing machine 'projectname' up with 'virtualbox' provider...
==> projectname: The cookbook path '/Users/cruisemaniac/.berkshelf/projectname/vagrant/berkshelf-20140909-37664-1gf5t34-projectname' doesn't exist. Ignoring...
Updating Vagrant's berkshelf: '/Users/cruisemaniac/.berkshelf/projectname/vagrant/berkshelf-20140909-37664-1gf5t34-projectname'
RuntimeError: Couldn't determine Berks version: #<Buff::ShellOut::Response:0x00000101040360 @exitstatus=1, @stdout="", @stderr="/Users/cruisemaniac/.rbenv/versions/2.1.2/lib/ruby/2.1.0/rubygems/dependency.rb:298:in `to_specs': Could not find 'berkshelf' (>= 0) among 56 total gem(s) (Gem::LoadError)\n\tfrom /Users/cruisemaniac/.rbenv/versions/2.1.2/lib/ruby/2.1.0/rubygems/dependency.rb:309:in `to_spec'\n\tfrom /Users/cruisemaniac/.rbenv/versions/2.1.2/lib/ruby/2.1.0/rubygems/core_ext/kernel_gem.rb:53:in `gem'\n\tfrom /Users/cruisemaniac/.rbenv/versions/2.1.2/bin/berks:22:in `<main>'\n">

I knew vagrant liked chef_solo and berkshelf to assist in the scripts that handle provisioning the VM. So I went ahead and installed the gems before starting out with the vagrant install.

What I could not understand was how berkshelf which was installed under my rbenv (via homebrew) was not found while the gem was being picked up right! « I know, shitty!

My local setup gave me this:

myfirstvagrantproject $ vagrant version
Installed Version: 1.6.5
Latest Version: 1.6.5
You're running an up-to-date version of Vagrant!

myfirstvagrantproject $ berks --version
myfirstvagrantproject $ which berks

All is well right? Well, No!

Apparently, the berkshelf gem used by vagrant requries chefdk, the chef development kit and wont work hanky panky without that.

Remove any berkshelf AND chef gems from your ruby installationbefore you start off with the chefdk installation.

Install chefdk into your /opt folder - again a requirement. Add this to the .bash_profile before your gems are loaded.

export PATH=/opt/chefdk/bin

Reload your .bash_profile and you must be good to go.

The other option is that you dont use berkshelf with chef OR you use puppet.

If you dont want to use berkshelf, open the Vagrantfile and set the following to false:

Vagrant.configure("2") do |config|
  config.berkshelf.enabled = false
  # other configuration code

You would also have to remove the Berkshelf file sitting in your vagrant directory to prevent Vagrant from complaining about an existing Berkshelf file that its not using!

Hope this helps.

Homebrew and MySQL

I was recently trying to setup MySQL with Homebrew and noticed that the mysql server that brew installed was not playing nice with the existing setups.

The solution is to wipe out any existing MySQL installs you’ve got on your mac and redo everything from scratch with brew. This makes the mysql installed from Brew your main installation.

Read up on this blogpost that details the sequence. 5 minutes, a few commands and all is hanky-panky in mysql land :-)

Credits to Cory Simmons for the original blog post!

People Forget

The most important offering at a restaurant is not the food. Its the experience while at the restaurant that makes a person go visiting again. Or swoon about it on social media! Good food is just, “so to speak”, the icing on the cake!

Thats why I pay you a premium for the experience!

When you forget something as essential as a customer’s order, the tastiest of dishes at your establishment takes a back seat over a spoilt evening for the people at the table!

Apologize genuinely, Make quick amends and move on.

In the days of social media and instant feedback, its as easy to keep a good face as it is to tumble and fall.

Buon Appétit!

I Love Jekyll I Hate Jekyll

Bad title for a post but thats how my relationship with the jekyll static site generator stands.

I love it:

  • It just lets me blog - no shitty admin console, no extra jazz, just keyboard noise –> blog post with some very simple magic in between.
  • it serves static html - no wordpress security headaches, no server load problems, instant load times given that i load off an SSD on my host1.
  • no db - that much more faster, that much less software to setup and get going
  • markdown - the new posterchild of content creation. plain text with intelligence!

I hate it:

  • it wont let me just blog - I need to be in front of my system with my git repo setup, with my keys in place or i cannot even access the content. Geek = 1, Blogger = 0, -1 even!
  • im not a laptop toting geek all the time.. sometimes, i’d want to just post an idea or a eureka moment on my blog - nope, cant do! pull up my laptop, type it in, check, commit, push, take a deep breadth, go hungry!
  • plugins - partially, wordpress has us all spoiled with plugins - most plugins and widgets are noise, some are needed - throwing in a google map for example, or a post this link to twitter button or some shit - there’s waay too much html involved with jekyll for any non-textual tasks. No, I dont have a problem with HTML, thats my bread and butter - but when its blogging, and I want to support my post with data, I dont want to make mistakes with HTML. I just want a way some things work!
  • Jekyll is too simple! Its ONE config file, a bunch of folders where you’re expected to throw some files into and bam - your blog on the world wide interwebs! Take your blog beyond this and you’re doomed - external HTML for a form, external HTML for a subscribe to rss thingy, external HTML for getting a visitor’s email - thats more work than blogging!

I’m not going to make the change away from Jekyll - not any time soon… Just a bunch of thoughts that I wanted to get off of my chest!

And oh! While extremely useful, I hate having to copy paste file names and yaml metadata for every blog post! That sucks!

  1. This blog is hosted on Digital Ocean - an amazing SSD cloud server. If you click on the link and buy yourself a hosting package on digitalocean, I will get a few credits to help run this blog for that much longer without burning a hole in my pocket!

Six Essential Tips for App Developers

An interesting infographic from google. Simple tips, interesting numbers.