Thursday, November 30, 2006

Implement: Installing Rails on Edgy

Just got my new System76 laptop (I will do a review once I play with it for a while) and one of the first things I did was get my Ruby on Rails environment up and running. It came pre-installed with Ubuntu 6.10 Edgy Eft.

Since Gems do not adhere to the upgrade path of Debian or Ubuntu, we will get around the package manager for this one component.

Ensure restricted and universe repositories are enabled.

I prefer a terminal:

sudo apt-get update
sudo apt-get install ruby rake ri rdoc irb
wget http://rubyforge.org/frs/download.php/11289/rubygems-0.9.0.tgz
tar xvzf rubygems-0.9.0.tgz
cd rubygems-0.9.0
sudo ruby setup.rb
sudo gem install rails --include-dependencies


Ruby on Rails is setup!

You will need a database, PostgreSQL or MySQL are both excellent. Lets setup the latter:

sudo apt-get install mysql-client mysql-server libmysql-ruby


Don't forget to configure your database - particularily setting the root MySQL password.

If you want to edit with Emacs, then continue:

sudo apt-get install emacs ruby-elisp


That is really it. You should be ready to create your first RoR project simply by entering:

rails myproject

Monday, November 27, 2006

Code: Ruby - Fun With ActiveSupport

If you have discovered the joy of coding in Ruby you will understand my enthusiasm! Not for years have I stayed up all night to learn a new programming language - excited at each new aspect, anxious to try what I have learned in a project. Ruby is simply a joy to use!

I am a newbie to Ruby but perhaps you will find something useful from my chaotic thoughts here.

One of these things is ActiveSupport - which many of you may know is a dependency within Rails. Yet you don't need to code a Rails project to enjoy this great library. For those of you not in the know, ActiveSupport is a collection of utility classes and standard library extensions.

Lets take a look at some of what you can do with ActiveSupport.

Inflections
>> "job".pluralize              #=> "jobs"
>> "job".singular #=> "job"
>> 23.ordinalize #=> "23rd"
>> 10.ordinalize #=> "10th"
>> "readers_best_work".humanize #=> "Readers best work"


Numeric
>> 10.bytes             #=> 10
>> 10.megabytes #=> 10485760
>> 10.terabytes #=> 10995116277760
>> 20.seconds #=> 20
>> 20.hours #=> 72000
>> 20.fortnights #=> 24192000
>> 20.months #=> 51840000
>> 20.minutes.ago #=> Mon Nov 27 11:53:23 Pacific Standard Time 2006
>> 20.minutes.from_now #=> Mon Nov 27 12:37:39 Pacific Standard Time 2006


Time
>> now = Time.now       #=> Mon Nov 27 12:19:21 Pacific Standard Time 2006
>> now.at_midnight #=> Mon Nov 27 00:00:00 Pacific Standard Time 2006
>> now.next_week #=> Mon Dec 04 00:00:00 Pacific Standard Time 2006
>> now.seconds_since_midnight #=> 44361.859
>> now.to_s #=> "Mon Nov 27 12:19:21 Pacific Standard Time 2006"
>> now.to_s(:short) #=> "27 Nov 12:19"
>> now.to_s(:rfc822) #=> "Mon, 27 Nov 2006 12:19:21 Pacific Standard Time"

Friday, November 17, 2006

My Linux Journey

My Linux journey started at the tail end of 1995 when I wanted to try something besides MS Windows and IBM OS/2. A few of us were talking and one suggested Linux - which was still pretty low on the radar. I sat in the basement of a friends house and watched him use X Window and CSH scripts and my life hasn't been the same since!

I can't remember where I got my first CD - or maybe it was a bundle of floppies - but I remember that it was the Slackware distribution. How many times had I installed this new OS onto my system - how many hours had I lost trying to learn what all these esoteric names meant and how or why I should install them? I was in geek-heaven! Getting X Window XFree86 up and running was a multi-day affair and when I finally got it to work, I was nearly in tears I was so happy. I purchased Motif and moved between that and FVWM. But the GUI was just the workspace to hold, literally, dozens of xterm or rvxt terminals. I discovered the command line through sh and then bash, and was delighted that I could do more in a single line than any MS Windows user could do with expensive applications.

I was addicted and delighted.

My journey would take me to most of the large-name distributions - but I became a long term Debian user. I just loved dpkg and then apt-get. Sure I tried rpm but back then it was the same old frustrating operating system upgrade circle that I hated from MS Windows and IBM OS/2.

Being a database geek in a corporate world I soon found that I had to live within MS Windows for a desktop, options were very limited. There was no Postgresql or Mysql, at least not at a comfortable enterprise level to use for small projects. Oracle RDBMS was my database of choice but that would not run on Linux for some years, but my servers ran a wide rang e of un*x environments. The client side tools were native MS Windows code - no Java yet.

This just allowed me to use Linux in various server-specific installations but rarely on the desktop. A file server here a firewall there - Linux excelled.

Jump ahead to present and you can see a different world. Linux is not only accepted but posted as the poster child of many companies - enterprise products either work on Linux or don't have a place. What IT shop doesn't have a single Linux server (or dozens)? My addiction is catching on it seems.

At my present work environment we made a choice early on - no exposed MS product outside the firewall. This means only hardened Linux boxes or appliances. It was an easy and comfortable choice. We are porting our database to Oracle RDBMS on a Linux operating system - my decision, one that I have a proven track record for success as well as financial incentives. There is even an initiative to move the whole office to Linux - now shit like that excites me!

My laptop is now running Ubuntu Linux - and I'm still using apt-get and xterms but on top of GNOME.

This addiction of mine has not slowed down and I don't expect it too.

Saturday, November 11, 2006

Review: Edge-Core Skype Phone


I wanted something separate from one of my machines while still giving me access to my Skype calls. Doing some searching online I found a handful - but reading the statistics, I settled on the Edge-Core Skype Phone.

Wherever there is an available wireless connection, including WPA/WPA2 encryption, this wireless device gives me access to all things that I need with Skype. This includes the following services:
With a wide screen, easy to access buttons (perfect for my large fingers), light in weight and small in size - this device is perfect for throwing in my bag to go where I want to go. I can manage my account, my contacts and even do my frequent conference calls.

At home I leave this phone on, using my personal wireless network, so that I can phone out or access calls. As a road warrior, sitting at a tea shop, I just search for a strong open network to attach too and then I am available for calls again. All this without turning on one of my machines.

If there are any negatives with this product is that the receiver is poor and it can be hard to hear in a loud environment. When this is a problem I just plug in a headset and I'm good to go.

This is the only Skype phone I've tried but I think I picked a winner my first time out!

Wednesday, November 01, 2006

Linux Podcasts Worth Listening To

Three days a week I commute to the office, a 45 minute trip each way. During this time I normally listen to a handful of regular Linux podcasts. My choices range from the informational to the fun – most often involving both. Give any or all of these a try if interested!

JaK Attack

Join Jon and Kelly as they give us a mixture of Linux, music and fun. Normally a 45 minute show posted weekly. This show has few guests and rarely a single agenda - but seems to follow the personal lives of the two hosts as they use (and attempt to use) Linux. This can be a fun show but it can also be more than a little irritating. More than once I have stopped listening to a show less than half-ways through - something I rarely do with others on this list. Yet I keep coming back.

Linux Action Show

Chris and Bryan, ex-Mac geeks, that bring us a high mixture of technical news along with informative opinions. This is approximately a 45 minute show per week. I listen to this show for the news highlights and their informative opinions and am never disappointed. They do specific reviews of tools and hardware that I find very useful. I purchased my System76 laptop as well as Real Basic because of these guys. Great quality podcast and I await each show anxiously.

Linux Link Tech Show

One of the longest running Linux show - Pat, Linc, Allan and Dan bring us a wild mixture of technical talk, opinions, humor and some great guests. The podcast is taped from the weekly live show and runs about 2 hours each week. This is one of my favorites. I find the quality of the taping very poor and the discussions can have long periods of (near) dead air that can take away from the fantastic show. Yet I have been in danger of getting into a car accident more than once as I laugh uncontrollably while listening to these guys.

Linux Reality

A very informative show for newbies and geeks alike. Chess brings a very informational show one-man show, with a half hour podcast with a specific topic each week. I don't listen to each of his shows - but choose a topic (last weeks was on SSH) and listen. I can usually catch something new from a tool or service that I have been using for over a decade. Every person just new to Linux should listen.

LUG Radio


Another long running show, already in their 4th season - Jono, Ade, Stuart and Matthew bring us an on-topic mixture of information, fun, opinions and great guests. This podcast is taped every two weeks and is about 90 minutes long. Easily my favorite. These guys create an agenda for discussion, mix in some great interviews (last week had
Eric Raymond), some crazy Brit humor, with a high mix of knowledgeable presenters and you have this show. This is an online Linux User Group at its best!