The Non-Microsoft Realm, Collecting Rubies Part II

Just a quick Friday night entry with helpful tidbits… cheers!

Part I of the Collecting Rubies Series.

RVM Gemsets

A few steps when setting up Gemsets with RVM. With a few other commands that can often be helpful.

Functionality by line:

  1. Get a list of the current available gemsets.
  2. Creates a gemset called theNameOfTheSiteToCreate.
  3. Lists the name of the current gemset.
  4. Delete the gemset named theNameOfTheSiteToCreate.
  5. This lists the current Ruby Version selected.

[sourcecode language=”bash”]
rvm gemset list
rvm gemset create theNameOfTheSiteToCreate
rvm gemset name
rvm gemset delete theNameOfTheSiteToCreate
rvm list
[/sourcecode]

Git-flow

Check out the git-flow github account.

To install:

[sourcecode language=”bash”]
wget –no-check-certificate -q -O – https://github.com/nvie/gitflow/raw/develop/contrib/gitflow-installer.sh | sudo sh
[/sourcecode]

…then just type git flow and you’ll see this prompt, which provides some functionality that is usable right away…

[sourcecode language=”bash”]
usage: git flow

Available subcommands are:
init Initialize a new git repo with support for the branching model.
feature Manage your feature branches.
release Manage your release branches.
hotfix Manage your hotfix branches.
support Manage your support branches.
version Shows version information.
[/sourcecode]

SQL Lite 3

Check out the sqlite3 site.

To install:

[sourcecode language=”bash”]
sudo apt-get install sqlite3 libsqlite3-dev
[/sourcecode]

The Non-Microsoft Realm, Collecting Rubies Part I

Years ago I worked with Linux (Redhat 3.2, SUSE, Gentoo, and Slackware among others) and also played around with PHP.  I’ve never really gotten too keen in PHP, mainly because it just seemed sort of a mess.  But when I needed something to get the job done and didn’t want to wait on the bureaucratic nonsense of corporate governance, PHP was there for me, albeit with a headache to follow.

However my interest in Linux and alternate development stacks, being in Southern Mississippi left me pretty much one option if I wanted to get into software development:  Microsoft’s .NET Framework.

So I learned that, and work with it regularly, and I dig it.  Most of the time.  It serves its purpose.  I have however wanted more, so I’ve started digging into other things again.  This is something I do frequently, and in my not so humble opinion think any serious developer should also dive into regularly.  Step outside of your comfort zone and try other things out, often this helps expand both options (such as .NET and Java, or Ruby on Rails, or whatever).

Recently I’ve decided I’m diving head long straight into Ruby on Rails.  I’m working on a new personal project and have determined I’m not going to use one lick of Microsoft Software (you can read in other motivations if you want to).  This project will be 100% Linux (maybe some Apple Gear & Bits) and Ruby on Rails.  I’ve not determined much beyond that.  Database or data store, TBD, graphics, TBD, and other such are all TBD.

Ubuntu Download
Ubuntu Download

With that, this is how & where I started from the ground up.

  1. I snagged Ubuntu and loaded it (yes, it does dual boot on my machine that runs Windows 7).  http://www.ubuntu.com/
  2. Next I went straight to TekPub and started downloading some of the Ruby on Rails Video Tutorials the crew over there has put together.  I purchased a membership because they’ve put out a lot of great material on everything from .NET, Entity Framework, NHibernate, Good SOLID Code, to Linux and Ruby on Rails.  I like the efforts, the teaching style, and they’re rather entertaining.  If you really don’t want to shell out any cash, there are other videos available on the Ruby on Rails Site.
  3. I hit a few snags on working with Ubuntu, mainly because I had not touched a Linux UI System in years.  The first two issues were;  1) How do I change the screen settings to not duplicate my dual monitors and 2) How do I take screenshots.  < Click on the respective issue to see what page I found to resolve the issue.  Yes, they were both that easy to resolve.  Literally first click links of Google results.  Very cool.  🙂
  4. The next issue I ran into was related to playing the TekPub Videos.  Using the Synaptic Package Manager however I was able to download all the additional codecs I needed.  I have to say, since the UX was vastly superior to Microsoft’s Windows Media Player (or whatever it’s called these days) I was able to get the codecs without much manual searching.  I just clicked ok, the package manager popped up, found what I needed, and I clicked OK.  This experience reminds me more of Apple’s OS-X than Windows strangely enough.
  5. With the TekPub Videos now viewable I downloaded the first Rails 3 Video.

While watching the video, which includes great coverage of what Rails 3 is all about, I worked through the following bits.  For these I also left the GUI Synaptic Package Manager and went with the command line, simply, it is just easier and faster.

Git

This was stupid simple.

[sourcecode language=”bash”]
sudo apt-get install git git-gui git-doc gitk
[/sourcecode]

Build Bits

Some important parts for building Ruby.  Yeah, this is kind of a kicker, super long, crazy command, best to copy and paste.  😉

[sourcecode language=”bash”]
sudo apt-get install build-essential bison openssl libreadline6 libreadline6-dev curl git-core zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-0 libsqlite3-dev sqlite3 libxml2-dev libxslt-dev autoconf libc6-dev ncurses-dev
[/sourcecode]

Curl

Reached out and got some curl.

[sourcecode language=”bash”]
sudo apt-get install curl git-core
[/sourcecode]

RVM (Ruby Version Manager)

Bash some Ruby Version Manager.  Note I put in “cd~” just as a reminder to get to your user directory.  Most likely, after installing RVM you’d already be in that directory.

[sourcecode language=”bash”]
bash < <(curl -s https://rvm.beginrescueend.com/install/rvm)
cd ~
gedit .bashrc
[/sourcecode]

At the very bottom of the .bashrc file add the following text.

[sourcecode language=”bash”]
[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm"
[/sourcecode]

Once you’ve done that, close the terminal down and then reopen it so that all the paths and such can load.

[sourcecode language=”bash”]
sudo apt-get install libruby1.9 zlib1g-dev libssl-dev libreadline5-dev build-essential
[/sourcecode]

Ruby 1.9.2 Bits

Now comes the exciting part, getting Ruby loaded up good and proper.

[sourcecode language=”bash”]
rvm install 1.9.2 –with-zlib-dir=~/.rvm/usr
rvm use 1.9.2 –default
[/sourcecode]

Now if you check with “ruby -v” the ruby 1.9.2p0 version will be default.

Setting Ruby 1.9.2 as Default
Setting Ruby 1.9.2 as Default

Collecting Gems

Now you’ll need some bits, in this case, called gems.  This is one of the very powerful parts of Ruby on Rails.  Beware, these bits have glorious AWESOME all over em’.

[sourcecode language=”bash”]
gem list
gem install rails
[/sourcecode]

The gem list command should list what is currently installed. Initially, only the rake gem is installed.  Once you execute gem install rails, then do another gem list, you’ll have a whole set of gems installed.

Checkup On Your Software

These are just a few of the commands that are helpful in identifying what is installed now. Try em’ out to get a view of what is available.

[sourcecode language=”bash”]
rvm gemset name
gem list
[/sourcecode]

Deploying ASP.NET MVC 3 Razor Web App to AppHarbor < 4 Minutes

Of all the cloud providers out there, AppHarbor easily provides the smoothest deployment experience for .NET available today. I did this in one shot, including a few mistypes, and still deployed an ASP.NET MVC 3 Web Application to AppHarbor in 3 minutes and 50 seconds.  (Be sure to hit the HD button in the top right corner to get the higher definition video)

 

Also cross posted on Youtube.

Git Rid of Windows Azure and Amazon Web Services (AWS) SDKs with .NET + Git + AppHarbor Deployment Revolution

I’ve been wanting to do a quick write up on the state of cloud apps from my perspective.  What’s my perspective?  Well I’m keeping up with  the SDKs from the big players; AWS and Windows Azure.  I’m also working on several cloud applications and providing consulting for some people and companies when approached related to which stack to go with, how to apply their current stacks (such as Ruby on Rails or .NET) in migrating to a cloud service provider.  Cloud services, or really more accurately utility computing has my personal and professional interest.  Above all, I keep trying to stay informed and know what the best path is for anyone that seeks my advice for moving into hosting & working in the SaaS, PaaS, or IaaS Space.  Feel free to contact me in regards to cloud questions:  adronhall at the famous gmail dot com.  🙂

Now on to the good tidbits that have been released lately.

The latest Microsoft goodies area available.  For the Windows Azure SDK go check out the Microsoft MSDN Site.

For the latest awesome from AWS (Amazon Web Services) SDK check out the AWS .NET Site.

These two SDKs are great for customers who want to build on the bare bones X platform.  Now whatever language & stack one builds in they are tied to that.  Ruby on Rails, .NET, Java, PHP, or whatever.  But getting tied to the stack is kind of like breathing air, one has to live with what air they have.  You can’t exactly get a refund very easily on that.

The Cloud SDKs though for Azure & AWS provide a certain amount of lock in, in addition to the stack lock in you’re using.  One of the easiest ways to prevent this lock in is to use a general deployment method backed by source control on something like Git or Mercurial.  So far though, .NET has been left out the cold.  There has been almost zero support for pushing .NET via Git or Mercurial into a cloud.

Heroku
Heroku

Ruby on Rails however has had support for this since…  well since the idea popped into the minds of the people at Heroku, EngineYard, and the other companies that are pushing this absolutely amazing and powerful technology pairing.

Engine Yard
Engine Yard

Again, for .NET, the problem is it has been left in the dust.  Smoked.  It has left a lot of .NET Developers moving to Ruby on Rails (which isn’t new, this is just one more thing that has pulled more developers away from the .NET stack).

 

Well, that’s changed a bit.  FINALLY someone has gotten the Git + .NET Pairing in the Cloud put together!  FINALLY you can get a cloud application running in a minute or two, instead of the absolutely inane amount of time it takes on Windows Azure (15+ minutes most of the time).  So who has done something about this?

AppHarbor is the first fully deployable solution for the cloud that allows Git + .NET to get going FAST!  I don’t work for these guys at all, so don’t think I’m shilling for them.  I’m just THAT happy that .NET has been pulled out of the dust bins and the community has this option.  I am flippin’ stoked matter of fact.

Currently, because of pricing and ease of deployment, I’ve been solely using AWS.  I can have a .NET MVC app running in AWS in about 5-10 minutes.  Between that speed of setup and the pricing, I pay 2/3 as much as Azure would be and can deploy much fast with a completely traditional .NET deployment.  No special project type needed, no extra configs, just a straight deployment with full control over the server (i.e. I can RDP in with no problem).  Anyway, the list of reasons I went with AWS over Azure really deserve an entire blog entry unto themselves.

AppHarbor
AppHarbor

With AppHarbor though I can step into the realm of doing exactly the same thing a Ruby on Rails Developer would do with Heroku or EngineYard.  Fully PaaS Capable with the scalability and features without needing to port or migrate to an entirely new stack!  I’ll probably keep a number of things running on AWS (such as the pending WordPress Websites I am about to push up to AWS), but will absolutely be starting up some applications to run in AppHarbor.

If you’re a .NET Developer and you’ve been wanting, looking for, and frustrated that the .NET Community didn’t have a Git + Cloud Deployment option for .NET, wait no longer.  Give AppHarbor a look ASAP!

Anyway… off to do a little work on my infrastructure project.  Cheers!

Git Updates

Here’s my latest Git Ignore file for .NET Development.

#Begin .ignore file
#OS junk files
[Tt]humbs.db
*.DS_Store

#Visual Studio files
*.[Oo]bj
*.dat
*.crc
*.exe
*.pdb
*.user
*.aps
*.pch
*.vspscc
*.vssscc
*_i.c
*_p.c
*.ncb
*.suo
*.tlb
*.tlh
*.bak
*.[Cc]ache
*.ilk
*.log
*.lib
*.sbr
*.sdf
ipch/
obj/
[Bb]in
[Dd]ebug*/
[Rr]elease*/
Ankh.NoLoad

#Tooling
_ReSharper*/
*.resharper
[Tt]est[Rr]esult*

#Project files
[Bb]uild/

#Subversion files
.svn

# Office Temp Files
~$*

#End .ignore file

I added a starting Git workflow on my domain here: http://www.adronbhall.com/Home/GitWorkflow