Tuesday, January 27, 2009

Vim Settings for Ruby

syntax on " Enable syntax highlighting
filetype on " Enable filetype detection
filetype indent on " Enable filetype-specific indenting
filetype plugin on " Enable filetype-specific plugins
set ic " Case insensitive search
set hls " Highlight search
set showmatch " Show matching brackets
set expandtab
set autoindent
set tabstop=2
set shiftwidth=2
set softtabstop=2

Sunday, January 25, 2009

Rails on Ubuntu Intrepid Ibex


Got Rails working with a local copy of ruby, gems, and rails, so I can have independent accounts with different versions.  I haven't gone back to a clean ubuntu install to verify, and I'm not sure that all these are needed, but I think these are the required packages:
  • zlib1g-dev
  • libzlib-ruby
  • libssl0.9.8
  • libssl-dev
  • libopenssl-ruby
After building ruby, from the top directory in the source:
  • cd ext/openssl
  • ruby extconf.rb
  • make
  • make install
Without that last set of steps, I was getting a "no such file to load -- openssl" error when trying to start rails.

After that, install rubygems (download and extract the source, then "ruby setup.rb") and install the rails gem.

References (with thanks to the contributors):

Wednesday, January 14, 2009

Ubuntu Package List: Available vs. Installed

apt-cache pkgnames : lists all available packages
dpkg -l : lists all installed packages (Can apt-cache do it?)

Also useful:

apt-get update : updates the local list of available packages
apt-cache search : lists all available packages matching


Reference: http://www.debian.org/doc/manuals/apt-howto/index.en.html

Tuesday, January 13, 2009

Ruby Gem Repository Setup

To have a linux account with an independent ruby gem repository, follow this basic process.  (Note the part about setting the RUBYLIB environment variable.)

MD5 Checksums (Ubuntu)

Create a new file containing the expected checksum, followed by 2 spaces, then the name of the file to be checked. The checksum file can contain multiple lines (multiple md5/filename pairs).

Then the md5 command is:

md5sum -c checksum_file

Monday, January 12, 2009

Building Ruby

To build ruby (an old version, for example) for a specific linux account:
  • download the source
  • tar xvzf ruby-1.8.5.tar.gz
  • cd ruby-1.8.5
  • ./configure --prefix=$HOME/ruby
  • make
  • make install

Thursday, January 1, 2009

Synergy: One keyboard to rule them all...


Moved my linux box / monitor next to my windows box, and set up Synergy (http://synergy2.sourceforge.net) so I only need a single keyboard and mouse.

The install went fine on both machines, including the quicksynergy install on the linux box, but ran into a problem connecting.

With the windows machine in running a Synergy test in server mode, with Logging Level set to Debug1, these messages appear when the mouse got to the right side of the screen (where it should have gone to the linux box):

DEBUG1: try to leave "" on right
DEBUG1: no neighbor right

With the windows machine in running a Synergy test in client mode, this was the error:

ERROR: failed to connect to server: The attempt to connect was forcefully rejected

On the "Using Synergy" page (http://synergy2.sourceforge.net/running.html), under the "Step 5 - Test" section, it has a list of common errors, including the "forcefully rejected" error, which correctly pointed to a firewall issue.  With the firewall off, it worked fine.

To take care of it, added a firewall exception:  
  • Settings > Windows Firewall > Advanced (tab)
  • Select connection, hit Settings button
  • On that window, hit Add...
  • Give it a name, add the IP for the linux box, and put in the synergy port (24800)