In the past I've usually chose to run the early releases and install from scratch but, both because I'm busy and because my Laptop is so well supported out of the box these days I decided to do an upgrade this time around.
Here's a decent how-to if anyone is looking for directions.
The upgrade nearly went perfect. There was just one problem. There seems to be a bug in the Gnome upgrade that changes the way the bookmarks in the Places menu behave.
Here's the bug in Launchpad and here's the specific post that provided me with the fix.
Nov 8, 2008
Upgrading to Ubuntu 8.10 (Intrepid Ibex)
Aug 10, 2008
Multiple Versions of Ruby On Ubuntu #2
This post is from a time before RVM or rbenv you should check out those instead..
I recently changed how I'm handling multiple simultaneous Ruby installations and I'd like to share.
What I needed was to make it convenient to switch between the system provided packages and specific, from source, installations. After some experiments I decided to use 'update-alternatives' to do it.
Here's a quick walk through...
First I removed all of my Ruby and RubyGem environment variables, they're not needed.
Then I installed Ubuntu's default Ruby packages via apt-get.
$ sudo apt-get install ruby irb ri rdoc libruby-extras rubygems ruby1.8-dev
Next I downloaded and installed alternate versions of Ruby from source. In this example I'm going to use two additional versions; the newest stable release and the newest development release.
$ cd /tmp $ wget -c ftp://ftp.ruby-lang.org/pub/ruby/1.8/ruby-1.8.7-p71.tar.gz $ tar -xvzf ruby-1.8.7-p71.tar.gz $ cd ruby-1.8.7-p71 $ ./configure --prefix=/opt/ruby-1.8.7-p71 $ make $ sudo make install $ wget -c ftp://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.0-3.tar.gz $ tar -xvzf ruby-1.9.0-3.tar.gz $ ./configure --prefix=/opt/ruby-ruby-1.9.0-3 $ make $ sudo make install
At this point I have three versions of Ruby installed and each can be accessed through it's full path.
$ /usr/bin/ruby --version # ruby 1.8.6 (2007-09-24 patchlevel 111) [i486-linux] $ /opt/ruby-1.8.7-p71/bin/ruby --version # ruby 1.8.7 (2008-08-08 patchlevel 71) [i686-linux] $ /opt/ruby-1.9.0-r18217/bin/ruby --version # ruby 1.9.0 (2008-07-25 revision 18217) [i686-linux]
You'll also notice that the default installation is the one provided by Ubuntu.
$ ruby --version # ruby 1.8.6 (2007-09-24 patchlevel 111) [i486-linux]
Next we'll use 'update-alternatives' to make it a bit easier to switch between them. You could do this on the command line but it becomes a fairly long nasty command so I found it easier to write a quick shell script and run it. The script:
update-alternatives --install \ /usr/local/bin/ruby ruby /usr/bin/ruby 100 \ --slave /usr/local/bin/erb erb /usr/bin/erb \ --slave /usr/local/bin/gem gem /usr/bin/gem \ --slave /usr/local/bin/irb irb /usr/bin/irb \ --slave /usr/local/bin/rdoc rdoc /usr/bin/rdoc \ --slave /usr/local/bin/ri ri /usr/bin/ri \ --slave /usr/local/bin/testrb testrb /usr/bin/testrb update-alternatives --install \ /usr/local/bin/ruby ruby /opt/ruby-1.8.7-p71/bin/ruby 50 \ --slave /usr/local/bin/erb erb /opt/ruby-1.8.7-p71/bin/erb \ --slave /usr/local/bin/gem gem /opt/ruby-1.8.7-p71/bin/gem \ --slave /usr/local/bin/irb irb /opt/ruby-1.8.7-p71/bin/irb \ --slave /usr/local/bin/rdoc rdoc /opt/ruby-1.8.7-p71/bin/rdoc \ --slave /usr/local/bin/ri ri /opt/ruby-1.8.7-p71/bin/ri \ --slave /usr/local/bin/testrb testrb /opt/ruby-1.8.7-p71/bin/testrb update-alternatives --install \ /usr/local/bin/ruby ruby /opt/ruby-1.9.0-r18217/bin/ruby 25 \ --slave /usr/local/bin/erb erb /opt/ruby-1.9.0-r18217/bin/erb \ --slave /usr/local/bin/gem gem /opt/ruby-1.9.0-r18217/bin/gem \ --slave /usr/local/bin/irb irb /opt/ruby-1.9.0-r18217//bin/irb \ --slave /usr/local/bin/rdoc rdoc /opt/ruby-1.9.0-r18217/bin/rdoc \ --slave /usr/local/bin/ri ri /opt/ruby-1.9.0-r18217/bin/ri \ --slave /usr/local/bin/testrb testrb /opt/ruby-1.9.0-r18217/bin/testrb
What that does is create a group of applications under the generic name Ruby. In addition each application has several slave applications tied to it; erb, irb, etc... In defining each application we specify what symbolic link it will be accessed through and where the application is actually installed. In my case Ubuntu installed Ruby in /usr/bin and the source installed versions are in /opt. All of the installations will be accessed through the generic name Ruby and will have there symbolic links created in /usr/local/bin. I choose /usr/local/bin because it supercedes /usr/bin in the default path.
Before moving on make sure that 'update-alternatives' sees all of our Ruby installations:
$ update-alternatives --list ruby # /opt/ruby-1.9.0-r18217/bin/ruby # /opt/ruby-1.8.7-p71/bin/ruby # /usr/bin/ruby
Now switching between them is as easy as running the 'update-alternatives' command and selecting the number of the installation you'd like to use. Example:
$ sudo update-alternatives --config ruby
It's important to keep in mind that each installation is separate. So for example if you install RubyGems while using /usr/bin/ruby it will not be available to /opt/ruby-1.9.0-r18217/bin/ruby, or /opt/ruby-1.8.7-p71/bin/ruby, etc....
While it's probably possible to use a shared repository for RubyGems across multiple installations I haven't tried it and instead have choosen to use multiple separate RubyGem installs, one for each Ruby installation.
Also RubyGem's bindir will most likely not be in your path. To get around this I created a short script called 'gemexec' in /usr/local/bin
#!/usr/bin/env ruby require 'rubygems' if ARGV.size > 1 exec "#{Gem.bindir}/#{ARGV.shift}",ARGV.join(" ") else exec "#{Gem.bindir}/#{ARGV.shift}" end
This script uses the RubyGems installation of the currently selected Ruby to determine where the executable gem should be found, then runs it with any additional command line arguments provided. example:
$ gemexec rake --version # rake, version 0.8.1
With all that in place the only thing to watch out for is other peoples scripts that hardcode the shebang line with something like "#!/usr/bin/ruby". What I do myself, and prefer in general, is to use "#!/usr/bin/env ruby".
The previous 'multiple versions of ruby on ubuntu'.
Setting CFLAGS #2
It turns out that with GCC 4.2.1 and later there is a new 'native' architecture flag for '-march' and '-mtune' that simplifies the setting of 'CFLAGS' greatly. Now instead of having to manually determine the exact architecture you can let GCC do it for you. If you trust it. Example:
CFLAGS="-march=native"
CXXFLAGS="${CFLAGS}"
export CFLAGS CXXFLAGS
previous post: 'Setting CFLAGS'
Jun 28, 2008
Determine What Version of Ubuntu You're Running?
The best way to determine the version of an Ubuntu (or any LSB compliant distribution) is to use the lsb-release command:
$ sudo apt-get install lsb-release
$ lsb_release -a
# Distributor ID: Ubuntu
# Description: Ubuntu 8.04
# Release: 8.04
# Codename: hardy
May 3, 2008
Gemified S3Sync on GitHub
I created a shallow fork of the S3Sync project specifically to wrap it as a gem. My intention is most likely to hack on it but I haven't done that yet. The code is at http://github.com/mgreenly and can be installed via rubygems (gem install mgreenly-s3sync) but first you'll need to check out the instructions at http://gems.github.com/.
Apr 5, 2008
NetBeans on Ubuntu
I'm usually a hardcore Vim fan but I've started to use NetBeans for my Ruby work. It's a fairly typical install but the one quirk is that $JAVAHOME has to be defined for the installer and Ubuntu's JDK package doesn't set it.
That's easily remedied though; download NetBeans, install the JDK and pass --javahome to the installer as a command line option.
#> netbeans-6.0.1-ml-linux.sh --java-home /usr/lib/jvm/java-6-sun
Ubuntu 8.04 "Hardy Heron"
The new Ubuntu release, 8.04 "Hardy Heron", is nearly out so I thought I'd take a few minutes to do a fresh 'from scratch' install on to my laptop, a Dell Latitude D830, this weekend. I was pleasently suprised that almost everything worked exactly as expected out of the box, including; wireless networking, dual head monitor support, suspend, hibernate, compiz, etc....
There was one small but very critical change I had to make. It appears that the ACPI hard drive load/unload bug has still not been fixed. It's critically important that you apply this work around unless you want your hard drive to die prematurely.
There was one other non-critical change I made. I didn't dig into the issue to understand it but for what ever reason the default ALSA settings don't support the audio pass through in the docking station. Fortunately the fix is extremely simple. You just need to install the "Gnome Alsa Mixer" and select the IEC958 check box.
#> sudo apt-get install gnome-alsamixer

Setting CFLAGS
It turns out the gento-wiki has a great page indicating which GCC -march flag should be set for which CPUs. To determine which CPU you have, run the following at a command prompt:
#> cat /proc/cpuinfo
It will yield a page of output. The first few lines of output from my laptop are below:
processor : 0
vendor_id : GenuineIntel
cpu family : 6
model : 15
model name : Intel(R) Core(TM)2 Duo CPU T7500 @ 2.20GHz
stepping : 10
The part you're interested in is the 'cpu family' and 'model'. Once you know those find the corresponding entries on http://gentoo-wiki.com/Safe_Cflags. Then create an entry in $HOME/.bashrc file that looks something like this:
CFLAGS="-march=prescott -O3"
CXXFLAGS="${CFLAGS}"
export CFLAGS CXXFLAGS
Of course substitute the -march value for the one you found on the wiki.
Mar 30, 2008
Cleaning Up Revision Histories
A post in the the bazaar email group described a better approach (than I had been using) to manage merges from personal working branches. For example; If I wanted to commit a change to the project 'Foo', according to the post, I'd do something like this...
$> bzr init-repo foo-branchesWhat I've done above is to first create a shared repository. I do this because I'm going to be working with multiple branches of the same project. Then I branch Foo's trunk into my new shared repository. Next I branch the trunk (that's in the repository) to my personal working branch, make all the changes and as many commits as I want. When I'm done I go back to the trunk. Pull it to make sure it's up to date. Then merge in my changes. Once I've done that I commit them and push them up to the server.
$> cd foo-branches
$> bzr branch http://example.com/foo-trunk trunk
$> bzr branch trunk workbranch
$> cd mybranch
$> # hack, commit, hack commit, repeat as necessary
$> cd ../trunk
$> bzr pull
$> bzr merge ../workbranch
$> bzr commit
$> bzr push
If you're worried about disk space you can remove the working trees for any branch you're not currently working in.
Labels: Bazaar, programming
Inspirational Speeches
My feeds contained a blog post from Sean Tierney in which he links to a couple of excellent speeches, both very much worth taking the time to watch. He also mentions an older post of his about publicly sharing your goals. Which I agree is an excellent idea and easily done with 43Things.com. You can find my recently started list here.
Labels: personal