I totally read it on Some Guy’s Blog

It must be true!

Archive for May, 2007

RailsConf Writeups: Day 1

without comments

I got into Portland with relatively little trouble, although I had actually booked a stay at my Wednesday hotel for the wrong night because I am a brainiac. I got on the road in relatively short order the following morning, even though I ended up getting very little sleep. Also, since I was changing hotels, I got to hoss my luggage with me around.

Although I was tempted, I did not actually catch up on any sleep during the first tutorial session, which was Your First Day on JRuby on Rails

My travel schedule ended up squeezing out meals because I spent what would have been my layover at JFK on the tarmac instead, because of rain. As a result, I was hungry as I get on Thursday afternoon, and you can easily verify from people who actually know me what that means. Let’s just say that eating was a top priority. I walked over to McMenamin’s which had the best food I had in Portland, but I paid dearly for it the rest of the weekend. My feet ended up hurting very badly for the rest of the weekend. And, yes, I was still carrying my luggage around.

I got back for my afternoon session, the awesome When V is for Vexing: Patterns to DRY up Your Views.

I had gotten together with Jon Maddox, my gracious host for the weekend, and confirmed where he was staying. That meant I got to drop off my bags finally. I then set a course for the Joyent Happy Hour. When I got there, it looked like this. I was shocked, because I started this thread on the normally chatty TextDrive forum and got zippo response before hand. I ended up finding one of the last beers, but it wasn’t cold. So I constantly had the beer in my hand, trying to cool it down in an ice bucket while everyone was asking me if I knew where to find more beer. I didn’t, and there were some real mega-watt folks that I embarrased myself in front of as a result of holding one of the last beers at the first day’s happy hour.

Apart from that, I had a ridiculously good time, as I talked to David for more than just a minute as he gave me a T-shirt. I also ran into the two Joyent Scotts—Scott Burton (nice website!) and Scott Barron. Presumably they picked those names just to confuse us. It was a great meeting, though, because Scott Burton was able to get my straightened right out with the problem that I ran into that ended my first work session on Getting Things Slung as I detailed on my blog

I called Megan on my way back to the hotel, where I hooked up with Jon. We then headed down into the city to grab dinner and some brews. The brew was excellent, the food less so. Especially not cool was the creepiest old lady that I have ever seen telling me that I smelled like shampoo and conditioner. At least, I know she said shampoo and conditioner, and also referenced me. Our waitress chased her away, but then she came right back to me! What did I do? I’ll mention Portland more during the complete wrap-up at the end of my RailsConf Writeup series.

Written by bigfleet

May 24th, 2007 at 3:57 pm

Posted in Uncategorized

RailsConf Writeups: Your First Day With JRuby on Rails

without comments

InfoQ has a JRuby talk that really doesn’t share that much with the talk that they gave during the tutorial session at RailsConf, and that does the presenters a disservice. Even though they were not the most engaging speakers on the bill for the weekend, they had great slides and a great plan to present their material effectively. As Glenn Vanderburg says Boring is great for JRuby Unfortunately, it is still hard when someone audibly falls asleep twice during your presentation.

For those of you who don’t know about JRuby, please click on a few of the links from this post to inform yourself. I don’t have very much to add besides my impression that JRuby is already a very big deal and they announced that they will go 1.0 within a month. That seems impressive to me with the outstanding bug list, but, of course, we’ll see. As exciting as Ruby is, it’s important that the entire community remembers that not only is our favorite language still very young on the scene. By any factor that you’d care to conjure (developers who know the language, book sales, installed base, project count, etc.), Ruby is still much smaller than Java. By building the bridge so that these two great languages can live together on the JVM (an amazing technology itself), both languages will be far the better for it.

I will update this post if the slides become available and their availability attracts my attention.

Links: Session Description | JRuby home page | JRuby Wiki | NetBeans | NetBeans and Ruby | JRuby Extras | Charlie’s Blog | Tom’s blog

Written by bigfleet

May 24th, 2007 at 3:51 pm

Posted in Uncategorized

RailsConf Writeups: When V is for Vexing

without comments

Put on by Bruce Williams and an uncredited Marcel Molina, Jr., this session proved to be one of the highlights of the conference for me personally. My experience up to this point has led to a lot of time spent with HTML and CSS education—thus I spend a lot of time working with those two technologies. As a result, I’ve seen a lot of view code, and produce a lot of the code smells that they covered in the talk.

I want to specifically give voice on my own forum to echo one of their own observations. So much focus has been given in the Rails community toward getting the right balance of responsibility between the model and the controller. Between them, the model and the data just make data available to the controller. That’s a lot of work to do in the view, to create the sort of dynamic interfaces that end users expect us in this day and age. HTML, JavaScript, and CSS are complicated enough that there are many professionals who operate only on that level. At least to this point, the view has not gotten the same sort of attention that the other levels have gotten from the developer community, even though it’s very important and difficult to get view code written cleanly and correctly. The two speakers then gave a dynamic walkthrough of several problems that manifest in view code, along with examples of “smelly” and “fixed” code. In the session, they went into greater depth for some of the examples.

If you deal with Rails views at all, I recommend as strongly as possible that you download the slides and read through their presentation. You won’t have a chance to ask them questions directly, but I’m quite sure that the two of them would be happy to engage with a reader.

One particular technique that received quite a bit of attention, and which I plan on following up on as soon as I can is the block helper. It was used twice for the smells that I put out quite frequently, as well as getting some discussion as an alternative for partials. Seeing how I use partials in my own code, this is a very big deal. Anticipate more posts from me on this topic in the future.

Written by bigfleet

May 24th, 2007 at 3:49 pm

Posted in Uncategorized

Kurt Vonnegut, RIP

without comments

I haven’t started reading his books because of his death, but I read Cat’s Cradle during my sister’s graduation. I fell in love all over again with his content and his style. I hadn’t read any of his work since I was in middle school (Harrison Bergeron, with the predictable effects).

I’ve read the first few pages of Slaughterhouse Five, and I am quite certain that he will become one of my favorite authors. At the same time, it becomes clear to me that I should begin some library transfer from my father.

Written by bigfleet

May 21st, 2007 at 5:10 am

Posted in Uncategorized

A Note From Ze

without comments

It seems like the underpinnings of everything are at stake.

—Ze Frank

Even though it’s over, he put on the best Show since Slick Rick and Doug E. Fresh. I can’t link to it because I am posting from my fricking phone. It’s called Google , people.

Written by bigfleet

May 19th, 2007 at 3:49 am

Posted in Uncategorized

Getting Started with Getting Things Slung

with 2 comments

Insipired by a chance to win one year of a large accelerator, I started Getting Things Slung. I am working on a Java application that is designed to sync contacts from MS Outlook, so I’m somewhat interested in the off-line/on-line client space. Also, the prize is pretty enticing, and the screenshot sure was pretty! So that’s all it took for me to decide to spend the plane ride over working on getting an entry ready.

I’m doing a Mac OS X version, and I really have no interest in the Windows side of things.

Briefing

The pair of Joyent web pages have generally good information. I’m intending this blog post to supplement that material. Also, even though at one point I was using it all the time, there’s now nothing I hate worse than Trac markup syntax, so I’m not going to use it.

I also recommend reading this through once before you go through it and try to follow it.

Basecamp (not that one)

We’re trying to simulate a server-side and client-side sync process. There’s no reason that we can’t set that up on the same computer. Ultimately, in addition, we’ll want the trunk directory in the Slingshot.app file to be the same as the server-side code.

Set up Subversion

I set up a Subversion repository on my own machine just for these purposes. I checked in the most recent release of Tracks into my repository, then checked it out to a working directory in my typical Rails workspace, and also checked it in from within the .app file. (You can cd into them using the terminal—go ahead!)

Getting TextMate open

You’ll end up with TWO TextMate windows open. One is for the client-side, and that will have extra directories in it. The other is for the server-side.

Getting Terminals in position

You’ll need terminal windows open to have a window to start mongrel_rails (for the server side) and for running svn up inside the Slingshot VM.

Head Above Water

The first place to go after getting yourself in position is to work on getting the client side in position to do the first downward sync. The wiki docs can walk you through that. For me, the process involved editing the start.sh, sync_up.sh, and sync_down.sh, while making sure that Tracks itself was running and passing tests. Let’s just say that some parts of the code are a little brittle.

As an example, the operative line from the sync_up.sh file looked like this for me:


ruby ../bin/rake joyent_slingshot:sync_up SYNC_CONTROLLER=http://localhost:4000/sync/up

Monday Night RAW on your adopted application.

I had to write migrations and fix not-exactly-bugs in Tracks to get it ready to run in the Slingshot environment. This will happen to you if you didn’t write the code, so get ready to “stand on the shoulders of giants” as Adam Keys might say.

You’ll also have to follow the instructions for the Slingshot plugin which, by virtue of being installed on the server-side, is ALSO installed on the client side, because you set them to be to same with Subversion. RIGHT?

The existing examples include… let’s call it a non-granular approach to preparing the set of information to be synchronized. This is OK for now, go ahead and do that. We’ll make things a little better before it’s all over.

Check XML from the server

I had a problem with having the first request to my server-side sync action completing successfully. After catching (by accident) the Joyent Scotts out on the balcony, Scott Burton told me that he had the same problem and it had to do with a different version of Rails running in vendor/rails than I had mentioned in config/environment.rb so watch for that. That brought my first work session to a halt.

Don’t stop until you’re pulling XML down. You’re more than half way done at this point.

You know, this is enough for one post.

Written by bigfleet

May 18th, 2007 at 10:54 pm

Posted in Uncategorized

The Way She Goes

with 2 comments

I am on the tarmac at JFK. We’re on hour two of just sitting here and now it is really raining. I wonder if we’ll get a letter from Delta?

Written by bigfleet

May 16th, 2007 at 10:21 pm

Posted in Uncategorized

En Route!

without comments

I sit at the gate. This plane will take me to JFK. The plane after that one will take me to Portland, Oregon for RailsConf 2007. I am an hour ahead of time. I have mostly conquered my cough and runny nose. I have an exit row window seat on the flight from JFK to Portland—hallelujah!

I began my journey with a great deal of personal and professional self-assurance. That won’t last long! But I am eager to see what the next few days have in store.

Written by bigfleet

May 16th, 2007 at 6:44 pm

Posted in Uncategorized

Feeling Feisty

without comments

Development

subversion
ruby irb rdoc ri ruby1.8-dev
RubyGems
sudo gem install rails mysql mongrel_cluster

Server

apt-get install openssh-server

Java

apt-get install sun-java-jdk6

Media

apt-get install flac gstreamer0.10-plugins-ugly libxine-extracodecs amarok k3b libmad vlc

MySQL / Apache / PHP

apt-get install apache2 mysql-server phpmyadmin php5-mcrypt mcrypt libmysqlclient15dev
a2enmod proxy
a2enmod proxy_ftp
a2enmod proxy_http
a2enmod proxy_connect

Misc

apt-get install smbfs

smbpasswd

apt-get install ddclient

Written by bigfleet

May 10th, 2007 at 1:57 am

Posted in Uncategorized

My OpenSolaris Experience

without comments

Thanks to the work of the Joyent team, through their podcast and working with top-level Rails sites on Solaris with DTrace, I am sold on the OpenSolaris operating system. I am pretty rusty with my Solaris admin skills, since most of the ones that I used the most often at Rice were written by senior IT engineers. We really didn’t do a lot of software installation and maintenance. I don’t even know how much has changed for Solaris in the past 2 or 3 versions. I started out with the intent to just build a Ruby deployment stack, but the journey ended up further down the road! I’ll walk you through what I did.

Download the Parallels instance from Sun.

Sun has recently made available their Solaris Express for Parallels instance, and that’s where my journey started. Sun, get an easier to use website.

Hit up Blastwave

A word on package management

My experience with Ubuntu and apt-get has changed my expectations in terms of package management. The only time that apt-get has not given me exactly what I have expected has been when I’m trying some experiment that later turns out to be completely boneheaded. Ubuntu, particularly, has a very large space of packages. Blastwave is the OpenSolaris equivalent, although Nexenta attempts to bring the whole of apt-get to OpenSolaris, boasting currently of more than 12,000 packages available. For your own purposes, you may wish to evaluate Nexenta, but with their most recent release being Nexenta Alpha 6, I was more interested in something that I could feel comfortable using in production right away. That’s right, calling your software alpha does scare me off.

Now on with our regularly scheduled program

An ugly fact: I am completely useless with vi. So for me, Blastwave is the next step. Blastwave’s HOWTO was no problem to follow. Don’t miss the last line of Step 7, which you will definitely want to do as you install more software.

Next step:


# pkg-get -i nano

Install MySQL

Sun has a BigAdmin article that’s a great walkthrough for setting up MySQL on OpenSolaris using Blastwave.

I completed through step 5I (Yikes!), the one about installing the MySQL SMF service. It ends with this:


# svcs -a | grep mysql
online 15:12:43 svc:/network/cswmysql5:default

Perhaps I’ll write a post specifically on SMF on some point, but suffice to say, that I really really liked it. It beats the Linux equivalent (/etc/init.d/) without breaking a sweat.

Also note that it’s probably time to revisit your path, as when I followed the Blastwave instructions followed by these, I ended up with the wrong version of mysql coming first.

Get familiar with your Apache

Be sure that you work with the version of Apache httpd that you intend to. /etc/apache and /etc/apache2 are both present. This is a good time to familiarize yourself with benr’s SMF cheatsheet and the SMF FAQ from Sun. (That’s on a mailing list archive? From last year? Seriously?)

Install Ruby and Subversion

Prepare yourself.


# pkg-get -i ruby

* …coffee break… *

# pkg-get -i subversion

That gets you Ruby 1.8.5 and Subversion 1.4.3. Not bad!

Download and install RubyGems and needed gems

To get started with RubyGems, there’s nothing different from the regular installation process.

After that, try this command:


# gem install rails mysql mongrel_cluster -y

It might work right off.

If it fails, try installing some packages like autoconf, automake, and gcc3. Try again ad see if the errors match those mentioned in this discussion. If so, benr’s rbconfig.rb file will solve the problem. I didn’t have this problem when I worked with the OpenSolaris VMWare image, but I did when I installed b62 on a real physical machine.

Enjoy your Ruby stack!

The particulars of how you might want to set up a mongrel_cluster SMF may vary, but this should be enough to get you in the ballpark.

Postscript

My experiments with OpenSolaris were so successful that I took an installation on a physical machine at work and prepared it to be our extranet hub. The best part is that all of our most critical corporate data can get packaged up and sent off to Amazon’s S3 service by a Ruby script that I whipped up in conjunction. That beats the pants off what we had before, and now we’ve got a solid backup strategy on a solid system. Very nice!

Written by bigfleet

May 8th, 2007 at 3:33 pm

Posted in Uncategorized