Tuesday, May 6, 2014

Ruby Newbie Guide to Getting Started with Ubuntu for Software Development

This is a reference guide for how to get started using Ubuntu as a development environment.  I use OS X at work and I use Windows 8.1 at home on my beefy gaming desktop.  I wanted to find an ideal development environment at home to make developing a smooth experience.  The languages I currently use most are Ruby and Golang.  This makes using Windows less than ideal for development.  I know there are some tools and support for getting this done, but without getting into a holy war, I humbly choose Ubuntu instead.  To make good use of my gaming PC hardware, I decided to dual boot it and share a set of instructions and tips that helped me along the way on this journey.

Ubuntu Setup

Download the Ubuntu 14.04 image and burn it to a DVD or some other bootable media.

Prepare the drive

Since I was starting with a Windows 8 computer, I created a bootable Partition Magic disc and partitioned the hard drive in half.  I then formatted the new half of the drive.

Install Ubuntu!

Reboot and use the bootable Ubuntu disc your made earlier and install to the freshly formatted partition.   When installing Ubuntu I chose to use the EXT4 file system.

Get your dev environment setup

You can run this script as sudo to install some of the basics like git, curl and vim.  

Code & Text Editor

VIM is my linux/osx editor of choice.  But if you haven't learned VIM yet, consider using an editor that has a lower learning curve like Sublime Text for now.  We'll revisit the topic of using vim in a later blog post.

Setup ssh keys

Hopefully you have a backup of your private .ssh key.  You’ll want to copy that file to either ~/.ssh/keys or a subfolder inside of that directory.  When they are in the base folder every key gets added by default by some kind of ssh keyring manager.  I’m a bit more interested in choosing which keys I’d like to add and when.  So I keep mine in ~/.ssh/keys/users

Bash profile

Setup your bash profile however you like it best. I have a list of aliases I like to have available, and also making sure that VI mode is on.

Virtualization

Many of the applications my team develops now use Vagrant because we want to develop in the same environment that we deploy and to eliminate questions about tool chains to get the application built.  Skip these steps if you don't plan on using Vagrant or Virtual Machines.

Download Virtualbox and install.  
Download Vagrant and install. Vagrant Up's getting started guides are very good if you haven’t used vagrant before.

Make running spinning up vagrant boxes with vagrant actually work.  
There is currently a bug provisioning custom vagrant boxes for the first time with the latest versions described in this guide.  This Ubuntu First VM dance link will fix you up.

If you need Cisco VPN

Run this huge Cisco VPN setup script.  This is a HUGE .sh file.  Looks like it contains enough binary in it to produce their client from scratch.  This should be posted somewhere public on the Cisco site.. but I sometimes have a hard time finding it.  Use the link above for one I know works.

Another option that many linux users may prefer is using OpenConnect with Gnome's network manager (via network-manager-openconnect-gnome).

If you need Oracle SQL Developer

Then first off… I’m sorry.  It’s a pain in the neck to get installed, but worth it.  At least it was when I did this with Linux Mint.  It looks easier to do on Ubuntu, you could try following this oracle noob guide.

Making Windows and Ubuntu play nicely together

Download Virtualbox for windows

Download an Ubuntu image to be used as a shared VM between OSes.  If you download this while on Windows..make sure to just run the .ova file.  You can’t mount or create the VM from within the VirtualBox manager.  The ova file is a package that has everything you need by just running it.  You do also need to download Oracle VM Extension Pack if you want USB 2.0 support.

Credentials for Ubuntu base virtual image -  ubuntu/reverse  You may consider changing these later.

Enable file sharing between the Windows 8.1 and Ubuntu so you can share your VMs and use them anywhere.

Closing Notes

Thanks to @jesse_szwedko for reviewing this article and providing some suggestions.


No comments:

Post a Comment