January 2013 Meetups: TypeScript, Riak, .NET, JavaScript… re: Calagator

Here’s a few of the meetups I’m going to aim to attend this month. Hope to see some fellow coders there.

PADNUG…

…is having a TypeScript Introduction. There’s a lot of those made up marketing words thrown around in the description such as “Application-Scale JavaScript Development”. Maybe TypeScript is magic, but overall it seems to be suspicious. Also, this talk is about how TypeScript will help you write Windows 8 Apps, so you’ve been warned. The kool-aid will be in effect. If you want to learn more about it, go check out the PADNUG meetup on January the 8th at 6:00pm. Intel Hawthorn Farms 3 (HF3) Campus, 5200 NE Elam Young Parkway, Hillsobor, OR 97124.

Portland Ruby Brigade…

…is having their regular monthly meetup at Crowd Compass. If you want to know more about the topic, material or other information about the user group jump into the Google Group to get started. This is a very fluid and flexible group, sometimes having an open discussion, a presentation or some other type of event. Crowd Compass, 2505 SE 11th Ave, #300, Portland, OR 97202. The location is in the Ford Building, with the easiest access straight in to the Ford Food & Drink.

Portland Riak Users Group…

…will meet at AppFog (as of this time) at 6:30pm on January 28th, more info & address on the meetup page. We have a coder/hacker/databaser by the name of Jeremiah Peschka @peschkaj coming in to tell us about the open source project he and OJ @TheColonial have been working on called Corrugated Iron. Corrugated Iron is a .NET Client for Riak, so holds a lot of potential for .NET shops to get into the distributed database world. So come check out the meetup, we’ll be having pizza and likely a bucket full of beer!

There are others, but these are the events that caught my eye. Check them out, I might see you there and if not, let me know how they go. If you’re looking into some other meetups or events, check out Calagator, the Portland Tech Scene Calendar of events.  🙂

My Year of Coding, Messaging, Learning, Leading, Reconoitering, and Hacking in Photos

Hope you have a little patience, this blog entry is going to be pretty long. There was a multitude of conferences, more than a hundred pair coding sessions, more cities, hotels and other things as I criss crossed the country helping to knock out projects, code, fire off some open source projects and generally get some technology implemented. It has been a spectacular year. I also could add, it has thoroughly kicked my ass and I’ve loved it.

2012 Coding Projects

In 2012 I’ve taken the healm of the Iron Foundry Project which led to the creation of Tier 3 Web Fabric PaaS. A Cloud Foundry & Iron Foundry .NET based PaaS. From there the project led to an expansion of leading the efforts on the Thor Project, which is a Cloud Foundry User Interface for OS-X and Windows 7. Beyond that I’ve contributed to and participated in dozens of different projects in various ways over the year. I finished up this year by joining Basho in December and thus, joined the Riak & related Basho Projects.

Coding Project Aims For 2013

Some of the projects I’ve started, will join or hope to otherwise continue participation in include the following. Here’s to hoping 2013 is a hard core coding and contributing year of excellence!

  • Many of the Basho Organization’s Projects I’ll be diving into, including work around Rebar, Riak, Docs & a number of others.
  • Name Factory – a project I’ve started a while back of Riak + JavaScript around creating massive test data with JavaScript and also using Riak for the storage & searching on that data created.
  • Criollo – Criollo is one of the most common forms of cocoa, is a native OS-X Cocoa User Interface for distributed systems built on or using Riak.
  • SpikeOp – This I’ve dubbed the name of the iOS interface for distributed systems built on or using Riak.
  • I want to use and possibly contribute to Corrugated Iron, the .NET Client for Riak. Prospectively to use for a Windows 8 User Interface for distributed systems built on or using Riak.
  • I’ll continue to maintain and provide support for the Iron Foundry vcap-client Library currently available via Nuget for .NET.
  • Thor Project for Cocoa & Thor .NET for Cloud Foundry & Iron Foundry.
  • Expand on prospective services for Cloud Foundry, either I or efforts I may lead to do this.

…there are others, but they’ll have to be figured out during the course of events. Also, there are an easy dozen other projects I’ll be working that don’t particularly have to do with coding, two are listed below. For an easy way to keep up with the projects I’m coding on, leading, participating in or otherwise hit me up on Twitter @adron or ADN @adron.

Big Project Aims for 2013

Thrashing Code Project – This is sort of, kind of secret. It’s going to happen soon, I have a personal schedule for it and I’ll be releasing information accordingly when the site and twitter account goes live.

Tour Triumvirate – I intend to plan, and hopefully will take at least 2 of the three tech tours I setup. More information will be forthcoming, but the original notion is outlined in the blog entry I wrote titled “The Adron Code Tour, Let’s Hack, Bike and Talk Hard Core Technology“.

Books I’ve Read in 2012

All of these I’ve either read or re-read in 2012. I set a goal at the beginning of last year to get my ass in gear when it comes to reading. A focused, get it read, understood and learn approach. I think I did pretty good overall. Not a book a week, but I’m getting back in gear. Considering my best year of reading was 100+ books, it might be a difficult to reach that again since I’m a working citizen, versus a child with plenty of time on their hands. But, it’s good to have goals.  😉

  • The Clean Coder: A Code of Conduct for Professional Programmers
  • The Rails 3 Way
  • Eloquent Ruby
  • The Economics of Freedom: What Your Professors Won’t Tell You, Selected Works of Frederic Bastiat
  • The Myth of the Robber Barons
  • Excellence Without a Soul: Does Liberal Education Have a Future?
  • Seven Databases in Seven Weeks: A Guide to Modern Databases and the NoSQL Movement
  • Surely You’re Joking, Mr. Feynman!
  • The Innovator’s Dilemma: The Revolutionary Book That Will Change the Way You Do Business
  • The Lean Startup: How Today’s Entrepreneurs Use Continuous Innovation to Create Radically Successful Businesses
  • 8 Things We Hate About IT: How to Move Beyond the Frustrations to Form a New Partnership with IT
  • Smart and Gets Things Done: Joel Spolsky’s Concise Guide to Finding the Best Technical Talent
  • Rework
  • Steve Jobs
  • Eloquent JavaScript: A Modern Introduction to Programming
  • JavaScript: The Good Parts
  • Node for Front-End Developers
  • First Contact (In Her Name: The Last War, #1)
  • Cloudonomics: The Business Value of Cloud Computing
  • The REST API Design Handbook
  • HTML5 Canvas
  • HTML5: Up and Running
  • Triumph of the City: How Our Greatest Invention Makes Us Richer, Smarter, Greener, Healthier, and Happier
  • Traffic

Book Reading Aims for 2013

  • Natural Capitalism
  • How God Changes Your Brain: Breakthrough Findings from a Leading Neuroscientist
  • Discourse on the Method of Rightly Conducting One’s Reason and of Seeking Truth in the Sciences
  • Political Ideals
  • The Autobiography of Benjamin Franklin
  • Wrestling with Moses: How Jane Jacobs Took On New York’s Master Builder and Transformed the American City
  • Bikenomics: An Introduction to the Bicycle Economy
  • Everyday Bicycling: How to Ride a Bike for Transportation (Whatever Your Lifestyle)
  • Just Ride: A Radically Practical Guide to Riding Your Bike
  • Continuous Delivery: Reliable Software Releases through Build, Test, and Deployment Automation
  • Erlang Programming
  • Building Web Applications with Erlang: Working with REST and Web Sockets on Yaws
  • Think Complexity: Complexity Science and Computational Modeling
  • Async JavaScript
  • Smashing Node.js: JavaScript Everywhere (Smashing Magazine Book Series)
  • Windows PowerShell for Developers
  • How to Use the Unix-Linux vi Text Editor
  • Sketching User Experiences: The Workbook
  • Designing Interfaces
  • Information Architecture for the World Wide Web: Designing Large-Scale Web Sites
  • Consider Phlebas
  • Snow Crash
  • How to Change the World: Social Entrepreneurs and the Power of New Ideas
  • Mission, Inc.: The Practitioner’s Guide to Social Enterprise
  • Simply Complexity
  • Complex Adaptive Systems: An Introduction to Computational Models of Social Life (Princeton Studies in Complexity)
  • Thinking In Systems: A Primer
  • Thinking, Fast and Slow
  • Programming in Objective-C
  • Learning iPad Programming: A Hands-on Guide to Building iPad Apps with iOS 5
  • Cocoa Programming for Mac OS X
  • Getting Started with GEO, CouchDB, and Node.js
  • JavaScript Web Applications
  • Suburban Nation: The Rise of Sprawl and the Decline of the American Dream
  • Design Patterns in Ruby

…and the two books I’d like to re-read this year because they’re just absurdly entertaining and I’d like a refresher of the stories.

  • A Confederacy of Dunces (I’ll be reading this for the 2nd time)
  • The Hitchhiker’s Guide to the Galaxy (Yup, just want to read it again)

My 2012 Coder’s Year in Photos

What I’ve put together here is a photo story of the year, hopefully it’s entertaining in some way. With that, here’s a review of the year, cheers and happy new year! 2012 started with one of my last hack sessions as a Seattle Resident at Ruby at Racer weekly meetup.

Ruby at Racer Meetup

Ruby at Racer Meetup

Meanwhile some of my last views from Russell Investments. Absolutely beautiful, epic and awe inspiring views of the Puget Sound from the Emerald City of Seattle.

View from Russell Investments Seattle Headquarters, stunning!

View from Russell Investments Seattle Headquarters, stunning!

Then a fitting image, from the business meeting floor of the same building, the settings sun for my departure.

Overlooking the Puget Sound, Japanese Garden in the forefront from the Russell Investments Building in Seattle.

Overlooking the Puget Sound, Japanese Garden in the forefront from the Russell Investments Building in Seattle.

February of 2012 kicked of with my return to Portland, Oregon. Stumptown regularly welcomed me back more than a few moments.

Stumptown Morning Brew

Stumptown Morning Brew

One of the first meetups I attended back in Portland was the DevOps Meetup.

DevOps DevOpers Hanging around pre-meeting at PuppetLabs in Portland.

DevOps DevOpers Hanging around pre-meeting at PuppetLabs in Portland.

That DevOps meetup just happened to have a session on one of the code bases I was working with, Cloud Foundry.

Cloud Foundry preso on how the pull requests and such where going to be built into a process, which still today is rather cumbersome for community involvement. However, it's still moving forward, albeit at a slower pace than it could if it was streamlined around github instead of github being an

Cloud Foundry preso on how the pull requests and such where going to be built into a process, which still today is rather cumbersome for community involvement. However, it’s still moving forward, albeit at a slower pace than it could if it was streamlined around github instead of github being an “end point” read only repository…

While my move consisted of many a couch, as I just couch surfed for the first 45 or so days I was back in Portland, I finally moved into a place at the Indigo in downtown.

My New Place, priorities as they are my system sits in the corner ready for use.

My New Place, priorities as they are my system sits in the corner ready for use.

The new system, albeit a great Christmas present from 2011, became the defacto work system of 2012 and remains one of my top machines. Mac Book Air w/ 4GB RAM, i5 Proc, 256 GB SSD. Not a bad machine.

2011 Mac Book Air, settled into it's workspace cradle.

2011 Mac Book Air, settled into it’s workspace cradle.

A view from on high, looking down upon the streets of San Francisco from the New Relic Offices. Thanks for the invite and the visit, it was great meeting the great team at New Relic San Francisco!

New Relic San Francisco View

New Relic San Francisco View

Getting around on my first trip to San Francisco of 2012. Thanks to John, Bjorn, Bill, John and the whole team in Portland and San Francisco for the invite. Great talking to you guys.

MUNI Streetcar FTW!

MUNI Streetcar FTW!

On the same trip it began pouring rain as I’d never seen before in San Francisco. I sat by Duboche Park, staying warm and away from drowning! Arriving outside was one of the MUNIs that eventually I was rescued by from the torrential floods and returned to downtown, dry and intact!

MUNI to the rescue on the torrential downpour of the year in San Francisco.

MUNI to the rescue on the torrential downpour of the year in San Francisco.

…and Julia thanks for the tour around San Francisco and the extra tasty lunch at EAT!! Good times!

Eating at the EAT sign!

Eating at the EAT sign!

Amidst all these images, I threw together some into a collage. There are a number of awesome coders & hackers of all sorts in these images. Shout out to Jerry Sievert, Eric Sterling,

Snikies, a collage I made!!!! (This one you can click on for a full size image)

Snikies, a collage I made!!!! (This one you can click on for a full size image)

…and alas I’ll have another zillion images and such as we all roll into 2013 and onward. Cheers! For some more new years posts I’ve found useful check out this list, which I’ll be adding to over the next few days.

Basho – First Week Coding & Research Adventures…

The First Things

This week, the first thing I did was give a solid read to Mark Phillip’s Blog “themarkphillips” (@pharkmillups). Here’s a break down of some entries I found really interesting and helpful in getting kick started here at Basho (or just really a good read in and of itself):

  • Using Open Source to Promote Sustainable Farming – Mark got to interview Chris Villalobos @frostbytten a long while back, but ended up getting a good interview and also got Chris to write an article on the Basho Blog “Riak in Production – A Distributed Event Registration System Written in Erlang”. Chris was working on Open AgroClimate Project a climate information and decision support system for managing agricultural and natural resources in the Southeastern US. Pretty interesting articles, the whole lot of them.
  • Two Anecdotes About Community From JSConf and NodeConf – This is a great one, two anecdotes that I’m all “hell yeah” about. The entry caught my eye for the obvious reasons that the whole great team behind JSConf & NodeConf, I always have to read about. Mikael, Chris and the whole lot of Noders are a great crew of people, throwing absolutely great conferences. The two anecdotes; “You Want Your Users To Hug You” andMeeting People In Real Life Never Gets Old And Is Incredibly Valuable”.
  • Another great entry revolved around putting together RICON 2012. See my other entries “RICON2012 Shreds the House!” and “RICON 2012 Photos” for more on RICON. This entry really lays out ground work for the mission Mark Phillips, Tom Santera and the rest of the team I’ve joined at Basho have to grow the community that works with, around and building distributed databases and systems.
  • The latest entry, the entry key to what I’m tackling, is the “Month One for Technical Evangelists at Basho“. This leads me to the next blog & entries and material I needed to dive into.

The next blog I gave a good review of was the Basho Blog.

  • Riak Cloud Storage with Multi-Datacenter Replication – this blog entry outlines the release of, well, what the title says. This release though, is a pretty big deal. The storage is already S3 compliant, a huge benefit in the first place. The entry goes into some detail about the full and realtime sync capabilities of the system. However if you’re really interested in this there’s more to dive into – so ping me or jump on the Basho mailing list and strike up a conversation. We love talking about this stuff at Basho, so don’t shy away from throwing some conversation our way.
  • The next blog entry that caught my attention, since some of my first demoes are going to be JavaScript, Node.js and Riak, the project around Riak.js getting a fresh start was a relief to read. I’ll admit, I read it when the blog entry was published. 😉
  • One last entry I read, then dived into the content that it links to is the “Building Apps on Riak” content and use cases blog entry. It links to the Basho Docs (see below) and use cases page.

The last two major things that I read, which are really important in the field of distributed databases and also having a work culture that seriously rocks. These two papers are the Amazon Dynamo Paper and the Valve Handbook.

amazon-dynamo-sosp2007 & Valve Handbook

The second thing I wanted to do was get Riak setup on my local machine to play with. I’d setup Riak a few times before in a multi-node cluster using Tier 3′ s Blueprint Technology to automate the process. This time however I’m taking the vantage of installing it locally for use. So what’s the steps? Well, it’s pretty straight forward. First however, I wanted to synch up my first install experience with the Basho Docs. Since the documentation is actually available via your standard open source repository on github, the Basho way, I wanted to get a local running copy of it.

Basho Documentation

I wanted to business, not just to read but also to contribute back to the basho_docs. This isn’t just some filler docs either, they’re actually really useful and well written. In other words, it’s solid, updated and well maintained documentation.

I forked the basho_docs to my own repo and went to work setting it up. Everything was going great until I stumbled into blockenspiel, or so I thought it was blockenspiel. Thus, the adventure of crazy new machine forgetfulness begins.

Breaking blockenspiel

I’ve spent a couple hours trying to get middleman working for the basho_docs project. Why did I spend a few hours working on this? Well the obvious one is I wanted to get the docs up and running locally, ya see, I intend to contribute back (want to jump into them too, hit up the github repo). While I was getting these installed I made a few mistakes and ran into a few issues. Here’s the story.

The first thing I forgot was to install rvm. The basho_docs project uses rvm and I highly suggest you use it, or something like it. In this case the project has specific settings you definitely want. The simple reason I didn’t have it is that I’d forgotten that I hadn’t installed it on my new Mac Book Air! Doh! Easily fixed via https://rvm.io/. While there I also installed the Jewelry Box App, it’s pretty decent, but you’ll still want to dive into the command line where the real power is.

So with that all good I got through the next few steps.

$ gem install bundler
ERROR: While executing gem ... (Gem::FilePermissionError)
You don't have write permissions into the /Library/Ruby/Gems/1.8 directory.
Adrons-MacBook-Air-2:basho_docs Adron$ sudo gem install bundler
Password:
Successfully installed bundler-1.2.3
1 gem installed
Installing ri documentation for bundler-1.2.3...
Installing RDoc documentation for bundler-1.2.3...
Adrons-MacBook-Air-2:basho_docs Adron$ bundle install
Fetching gem metadata from http://rubygems.org/.......
Fetching gem metadata from http://rubygems.org/..
Enter your password to install the bundled RubyGems to your system:
Using rake (0.9.2.2)
Using i18n (0.6.1)
Using multi_json (1.3.6)
Using activesupport (3.2.8)
Using builder (3.1.3)
Using mime-types (1.19)
Using xml-simple (1.1.1)
Using aws-s3 (0.6.3)

At this point, the install seemed to be going great, and then BOOM, this happened!

Installing blockenspiel (0.4.5) with native extensions
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.

/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby extconf.rb
mkmf.rb can't find header files for ruby at /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/ruby.h

Gem files will remain installed in /Users/Adron/.bundler/tmp/13504/gems/blockenspiel-0.4.5 for inspection.
Results logged to /Users/Adron/.bundler/tmp/13504/gems/blockenspiel-0.4.5/ext/unmixer_mri/gem_make.out
An error occurred while installing blockenspiel (0.4.5), and Bundler cannot continue.
Make sure that `gem install blockenspiel -v '0.4.5'` succeeds before bundling.
Adrons-MacBook-Air-2:basho_docs Adron$ gem install blockenspiel
ERROR: While executing gem ... (Gem::FilePermissionError)
You don't have write permissions into the /Library/Ruby/Gems/1.8 directory.
Adrons-MacBook-Air-2:basho_docs Adron$ sudo gem install blockenspiel -v '0.4.5'
Building native extensions. This could take a while...
ERROR: Error installing blockenspiel:
ERROR: Failed to build gem native extension.

/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby extconf.rb
mkmf.rb can't find header files for ruby at /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/ruby.h

Gem files will remain installed in /Library/Ruby/Gems/1.8/gems/blockenspiel-0.4.5 for inspection.
Results logged to /Library/Ruby/Gems/1.8/gems/blockenspiel-0.4.5/ext/unmixer_mri/gem_make.out

Ok, so maybe I shouldn’t have used sudo, but wasn’t sure what the permissions issue was in the first place. Yeah, that’s a bad idea just to barge ahead, but sometimes you gotta just move on things. Maybe that was or wasn’t the issue. I didn’t know at this point so started to do some research.

The first thing I realized, was barely anyone had run into this issue. I did however find two things that seemed like they may be the root cause of this blockenspiel problem.

https://github.com/dazuma/blockenspiel/issues/4 which shows the native extension not building and a bug is issued here http://bugs.ruby-lang.org/issues/4803. Ugh, how frustrating. Then I also noticed something else, the build is not passing per the README.md file displaying the Travis CI status.

That sux, but I kept digging at that point.

So which native extension did I need to install? I was missing it for some reason. Then I dug around a little more and discovered this in one of the logs.

[2012-12-07 09:50:07] ./configure --prefix=/Users/Adron/.rvm/usr
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... config/install-sh -c -d
checking for gawk... no
checking for mawk... no
checking for nawk... no
checking for awk... awk
checking whether make sets $(MAKE)... no
checking for gcc... no
checking for cc... no
checking for cl.exe... no
configure: error: in `/Users/Adron/.rvm/src/yaml-0.1.4':
configure: error: no acceptable C compiler found in $PATH
See `config.log' for more details

Hmmm, dammit, new machine mistake again. I needed a C compiler ASAP! Opening up XCode I immediately got this fixed by installing the CLI tools. These tools include about a zillion things I obviously needed, including the LLVM Compiler, Linker and the universally needed Make.

XCode CLI Tools Installation, for full size image click.

XCode CLI Tools Installation, for full size image click.

Ok, I finally got that installed and moved forward again. Pulled down the bits, and ran smack into the problem again. The blockenspiel lib can’t build the native extension. Ugh! However this time I got a slightly more useful error message at least.

/Users/Adron/.rvm/rubies/ruby-1.9.3-p327/bin/ruby extconf.rb
checking for ruby/backward/classext.h... *** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers.  Check the mkmf.log file for more
details.  You may need configuration options.

Provided configuration options:
	--with-opt-dir
	--without-opt-dir
	--with-opt-include
	--without-opt-include=${opt-dir}/include
	--with-opt-lib
	--without-opt-lib=${opt-dir}/lib
	--with-make-prog
	--without-make-prog
	--srcdir=.
	--curdir
	--ruby=/Users/Adron/.rvm/rubies/ruby-1.9.3-p327/bin/ruby
/Users/Adron/.rvm/rubies/ruby-1.9.3-p327/lib/ruby/1.9.1/mkmf.rb:369:in `try_do': The compiler failed to generate an executable file. (RuntimeError)
You have to install development tools first.
	from /Users/Adron/.rvm/rubies/ruby-1.9.3-p327/lib/ruby/1.9.1/mkmf.rb:494:in `try_cpp'
	from /Users/Adron/.rvm/rubies/ruby-1.9.3-p327/lib/ruby/1.9.1/mkmf.rb:919:in `block in have_header'
	from /Users/Adron/.rvm/rubies/ruby-1.9.3-p327/lib/ruby/1.9.1/mkmf.rb:778:in `block in checking_for'
	from /Users/Adron/.rvm/rubies/ruby-1.9.3-p327/lib/ruby/1.9.1/mkmf.rb:272:in `block (2 levels) in postpone'
	from /Users/Adron/.rvm/rubies/ruby-1.9.3-p327/lib/ruby/1.9.1/mkmf.rb:242:in `open'
	from /Users/Adron/.rvm/rubies/ruby-1.9.3-p327/lib/ruby/1.9.1/mkmf.rb:272:in `block in postpone'
	from /Users/Adron/.rvm/rubies/ruby-1.9.3-p327/lib/ruby/1.9.1/mkmf.rb:242:in `open'
	from /Users/Adron/.rvm/rubies/ruby-1.9.3-p327/lib/ruby/1.9.1/mkmf.rb:268:in `postpone'
	from /Users/Adron/.rvm/rubies/ruby-1.9.3-p327/lib/ruby/1.9.1/mkmf.rb:777:in `checking_for'
	from /Users/Adron/.rvm/rubies/ruby-1.9.3-p327/lib/ruby/1.9.1/mkmf.rb:918:in `have_header'
	from extconf.rb:44:in `'

My first thought was, WTF didn’t I just install the developer tools?

Went digging for this problem and found this interesting and likely related Stackoverflow Entry “”. One of the suggested solutions would be found in executing the following commands. As I read this I realized it wasn’t the marked answer, but I needed MacPorts so I downloaded MacPorts! A quick few seconds later I grabbed it and tried out these commands just to at least get things updated.

sudo xcodebuild -license
sudo port upgrade outdated
sudo port install apple-gcc42
sudo rvm reinstall 1.9.3

At this point, still no go. I was getting pretty pissed. At least I was getting all these things setup on my machine, but seriously, this should NOT be this hard. The next thing I did was also update my Ruby Gems, as another place on the web suggested doing that. I tried installing middleman again.

gem install middleman

At this point I was a bit frustrated, sat back and figured, I’ll give it a go in a while. Well after a few hours to let things sort out in my head, I picked up a completely different laptop. My Mac Book Air I’ve had and been using for over a year now. I opened up iTerm2 and through these commands in bash:

git clone https://github.com/basho/basho_docs.git
gem install bundler
bundle install
middleman

…and the server started right up on port 4567. I opened up a browser and navigated to http://localhost:4567. Right there before my eyes loaded the Basho Riak Documentation!

After all that, it boils down to some stupid machine load issue. So I’ll come back to fixing that machine some other time. For now, it was finally time to move on to other things. But that’s a gist of week one, and week two will be starting in just about 47 minutes. Next week I’ll be diving in a bit more to all of these things plus some actual installation, setup and related skill with Riak. Until then, cheers.

Deploy a Framework Friday #1 with Ruby and Sinatra

Alright, just for fun I’m kicking off a new blog series. I’m going to publish a new “Deploy a Framework Friday” each week for about the next, well, bunch of weeks. There are a TON of frameworks that are available on PaaS Technologies.

This first entry I’m going to implement a simple Sinatra app with Ruby. Nothing fancy, simply a hello world and the respective deployment to a Cloud Foundry PaaS.

First, let’s whip out the super complex code (right, this isn’t complex, I just like sarcasm). The hello.rb file I created.

require 'sinatra'

get '/' do
  "Hello World!"
end

get '/route' do
  "Hello from a route URI!"
end

Next add a Gemfile & respective Gemfile.lock as such.

Gemfile

source "http://rubygems.org"
gem 'sinatra'

Gemfile.lock

GEM
  remote: http://rubygems.org/
  specs:
    rack (1.4.1)
    rack-protection (1.2.0)
      rack
    sinatra (1.3.2)
      rack (~> 1.3, >= 1.3.6)
      rack-protection (~> 1.2)
      tilt (~> 1.3, >= 1.3.3)
    tilt (1.3.3)

PLATFORMS
  ruby

DEPENDENCIES
  sinatra

Then deploy using the Cloud Foundry VMC.

vmc push

If you’ve forgotten, be sure to target and login first.

vmc target api.ironfoundry.me
vmc login

That does it. Yeah, not a whole lot to get started working on a Sinatra Project. For more information on Sinatra check out the main web presence here http://www.sinatrarb.com/.

For more information on Cloud Foundry or Iron Foundry click on the respective link.

For the code sample, check out the working “paasIt” code repo on Github.

Next week I’ll do a baseline ASP.NET MVC 4 Application and get it deployed.

AppFog, Fort of Awesome & Node PDX Updated!

Time for the secret to be out of the bag. I’m currently working on contract with the awesome company of AppFog in the Fort of Awesome. Let me tell you, it is indeed awesome too! You might ask why I am working with them? How do I align with them? What is it they do?

Well you’re in luck, I’ll tell you all about it.

A few months ago, I started really digging into PaaS more. Not that I needed a reason, because I’m one of those “PaaS is the future” guys. I see this as a huge shift, kind of like when the developer world moved on from Assembly and punch cards to C & C++. It’s a big deal, and it is shifting the way companies build apps, the way they stay competitive, and stand out and above the herd with better process, better capabilities, and more efficient operations. PaaS, is the path to tomorrow.

What is AppFog building? Currently if you’re fortunate enough to have beta access, you may be able to play with the amazing PaaS offering that they’re putting together, and I’ve stepped forward to help put even more awesome into it with their kick ass team! So what will AppFog be aiming for? Well, it is an impressive list, check it out!

Help us out, take the poll and get your favorite technology added to the list! There’s a whole list of other things that will be coming too, this is just the basic big hitters list.  🙂

In other news, Node PDX has just finished the list of speakers, we’re finalizing the rest of the sponsors and related things, and just waiting (ok, we’re really busting our butts over here running around to make sure this is a cool event for all you node coders!)

Some of the cool things you’ll be able to look forward to is…

…and awesome Saturday “open drinks” party w/ New Relic! So be sure to be there for that…

We’ve aimed to get everyone a Node PDX t-shirt…

…and more. So go get RSVPed already, time is running out.

Steaming Up The Engine for The Rails

I’ve been digging through and playing with the Rails Framework now for about 4 months with intent (I guess I’ve read about it, learned about, but not played with it for well over 4 years). I’ve gained a pretty good familiarity with the parts of the framework. Below, I’ve laid out some of the key things that I’ve done over and over just to become familiar with the commands, organization, and other elements within the framework. These also, in this specific order, is what I’ve found works best for getting a Ruby on Rails Application Project kick started (on a *nix based machine, the rvm commands will however not work on Windows, you’ll need to find a respective replacement).

$ mkdir steaming_up_the_engine
$ cd steaming_up_the_engine
$ rvm --rvmrc --create 1.9.2@steaming_up_the_engine
$ cd ..
$ cd steaming_up_the_engine
$ cd ..
$ rails new steaming_up_the_engine -T
$ open .
$ cd steaming_up_the_engine
$ git init
$ mate .gitignore

…edit and save the .gitignore file with whatever additions you may need or want…

$ git -A
$ git commit -m 'first commit.'
$ rm public/index.html
$ rails generate rspec:install

…edit your Gemfile(See below Gemfile for contents)…

$ rails generate controller home index contact about
$ git rm -r spec/views
$ git rm -r spec/helpers
$ mate config/routes.rb

…edit the routes.rb so there is the index page handling the root page…

Gemfile (Located in ~/projectRoot/Gemfile)

source 'http://rubygems.org'

gem 'rails'
gem 'sqlite3'

group :development do
  gem 'rspec-rails'
end

group :test do
  gem 'rspec-rails'
  gem 'webrat'
end

group :assets do
  gem 'sass-rails',   '~> 3.1.4'
  gem 'coffee-rails', '~> 3.1.1'
  gem 'uglifier', '>= 1.0.3'
end

gem 'jquery-rails'

route.rb file.

SteamingUpTheEngine::Application.routes.draw do
  get "home/index"
  get "home/about"
  get "home/contact"
  root :to => 'home#index'
end

mkdir creates a new directory called steaming_up_the_engine.

cd steaming_up_the_engine moves the active working directory of the terminal/bash to steaming_up_the_engine (i.e. cd stands for change directory).

rvm is the rvm application command, –rvmrc is the feature being created, –create is the command to issue on the feature.  1.9.2 is the version of Ruby that will be used for the project and the name after the @ is the name of the project itself. For more information about the rvmrc script check out my previous entry or the rvm site on rvmrc.

The action to cd .. moves out of the directory and then cd steaming_up_the_engine moves back in to initiate the script that the rvm command created for us. After that, the working directory is moved back outside of the application folder.

rails is simply the rails framework application command, new tells the application to create a new rails application based on the framework, and -T is a switch to prevent any tests from being generated.

open . actually opens the Finder to view the just created project in the working directory. The screenshot below is the Finder with the newly created rails app.

Finder showing the newly created Rails Application in a column display.

Finder showing the newly created Rails Application in a column display.

Again move back into the application working directory.

git init initializes a local git repository for the project.

mate .gitignore opens up the .gitignore file that was created by the rails command for editing.  mate is the command for the TextMate Application. If you don’t have TextMate, then you would have to change mate to a command that relates to whatever you use to edit your code files. Check out my previous blog entry for a sample .gitignore file.

git -A adds all new files for commit to the local git repository.

git commit -m ‘first commit’ actually commits the new project to the git repository.

rm public/index.html removes the default static page that displays if the application is run at this point. I never need it, but it does come in handy sometimes if you’re troubleshooting if a server runs and just want to deploy something to verify you’re doing it right (such as to EngineYard or Heroku).

rspec can be setup and configured to run in your Rails project with the rails command rails generate rspec:install. If the rspec gem isn’t already in your project, remember to gem install rspec or add it to the gemfile and run bundle install.

The first of these commands that actually starts building the site is the rails generator command. rails generate controller Pages home contact creates the pages, controllers, and routes for the pages. Because the rspec has been configured for the project, when rails generates the controller and pages tests will be created in the spec directory.

After the creation of those pages remove the unnecessary test files in helpers and views under spec. git rm -r spec/views and git rm -r spec/helpers will get rid of these files.

Now you’re ready to really get started actually building something in those pages. Enjoy!

Your Bus Is NOT Here! But We’re Working On It…

But myself and fellow hacker & Geoloqi Crew put something together to figure out where the bus is. Nothing super fancy, but the idea is solid. We wanted to get a simple mobile application put together that would identify where it is, what the closest bus stop is, and pull up the next arriving bus(es) for that stop. We were throwing in a few other ideas, such as pulling up specific stops based on your favorites or even specific buses at that route based on your preferred routes.

Pat (@patrickarlt) & I (@adron) started out by pulling in the GTFS data from TriMet. I setup a basic import to turn all the stop locations in the GTFS data into a Place within a layer within Geoloqi. Pat setup a URL that could be used to call down the latest X arriving buses. Then we combined forces figuring out how to efficiently get all of the 7000+ bus stops into Geoloqi. That proved a little bit more of an issue than we thought. Not a huge issue, but one that got Kyle (@kyledrake) and Aaron (@aaronpk) Coding some fast batch solutions to get it all into Geoloqi while Pat & I handled the application.

On Sunday we’re lined up to get the application into a MVP (Minimally Viable Product) state. We’re hoping to be able to maybe even use it tomorrow in at least a simple way. From that point forward we’ll hopefully move past the MVP into other functionality! 🙂

Another thing to note, is that with our basic implementation we’re using GTFS data. This is a data format that is standardized and used by many of the agencies around the country. So technically any transit agency, as long as they have a way to return their route arrivals, can be setup to use our application we’re building. Some of the other GTFS data can be retrieved here;

To check out more, hit up Google’s page on GTFS data sources:  http://code.google.com/p/googletransitdatafeed/wiki/PublicFeeds

Day one of the hackathon has been seriously kick ass! I’ve had a blast and heard some great ideas, seen some great code, even working demo results, and seen amazing skills applied all around! At this juncture, I’m exhausted, got a little more to code, and ready for day 2 of hacking!