Archive for December, 02005

PGOR - In-Place Description Editing

Thursday, December 29th, 02005

I’ve added in-place photo description editing to the Rails photo gallery software I’m working on. I’m tentatively calling the app PGOR (Photo Gallery on Rails). Adding this kind of advanced AJAX functionality is fairly easy with Rails and Script.aculo.us’ In Place Editor.

There’s still no user login, so anyone can edit descriptions, but it’s a throw away copy of the database, so it’s not too important.

A Screencast of the functionality.

Luminarias

Sunday, December 25th, 02005
2005 Luminarias near Peralta, New Mexico 2005 Luminarias near Peralta, New Mexico 2005 Luminarias near Peralta, New Mexico
2005 Luminarias near Peralta, New Mexico 2005 Luminarias near Peralta, New Mexico

Luminaria photos from this and past years:

Merry Christmas

Saturday, December 24th, 02005



Fall 2005 Grades

Friday, December 23rd, 02005

I got an A in this semester’s Advanced Computer Architecture class. The pressure to maintain my 4.0 grade point average mounts:



Try Ruby!

Thursday, December 22nd, 02005

What to try out Ruby without the fuss of getting stuff installed on you computer? Check out Try Ruby!. It gives you a hands-on Ruby tutorial right in your web browser.

Highly recommended.

Porting Photo App to Rails

Wednesday, December 21st, 02005

I’ve started porting my photo gallery app to Ruby on Rails. The idea is to use my huge existing database (14 MB SQL / 46 GB jpg) as a base and build a rails application around it.

I developed the software I’m using now with Perl/HTML::Mason (code). It has some pretty cool features, but I want it to do a lot more - especially on the administrative side. I considered slogging out some new Perl to add the features I need, but a port to Rails’ rich framework holds the promise of a more productive environment, once completed. That, and playing with Ruby and Rails is simply more exciting!

You can view the work in progress at http://bohnsack.com/rails/photos/list, though the URL will probably change in the future.

I hope to get a lot of work done over Christmas break and code checked into RubyForge in a week or so. This will also get me the opportunity to learn SVN.

We Shall Move in This Direction

Wednesday, December 21st, 02005

SCGI and Rails on Apache 1.3.x

Tuesday, December 20th, 02005

Some notes on setting up a rails app with Apache 1.3.x and SCGI on Linux. The following allows a rails app to be setup as a single directory (/rails) underneath a webserver that might be running other non-Rails stuff (PHP, HTML::Mason, etc.) underneath other directories.

The SCGI protocol is a replacement for the Common Gateway Interface (CGI) protocol. It is a standard for applications to interface with HTTP servers. It is similar to FastCGI but is designed to be easier to implement.

  1. Download and install SCGI Rails Runner:
    $ wget http://www.zedshaw.com/downloads/scgi_rails/scgi_rails-0.4.3.gem
    $ gem install scgi_rails-0.4.3.gem
    
  2. Install other required gems:
    $ gem install cmdparse
    $ gem install highline
    
  3. Make sure your Apache has DSO support
  4. Download SCGI v1.9
  5. Build SCGI as a DSO Apache module:
    $ tar -xzvf scgi-1.9.tar.gz
    $ cd scgi-1.9
    $ cd apache1
    $ /path/to/apxs -i -c mod_scgi.c
    
  6. Add directives to httpd.conf to load the DSO and connect to a SCGI process running on localhost:9999:
    # At the end of the LoadModule list...
    LoadModule scgi_module        libexec/mod_scgi.so
    
    # At the end of the AddModule list...
    AddModule mod_scgi.c
    
    # Inside of the correct virtual server context...
    Alias /rails "/toplevel/directory/where/your/rails/app/lives/public"
    SCGIMount /rails 127.0.0.1:9999
    # matches locations with a dot following at least one more characters, that is,
    # things like   *,html, *.css, *.js, which should be delivered directly from
    # the filesystem
    <locationmatch \..+$>
      # don't handle those with SCGI
      SCGIHandler Off
    </locationmatch>
    <directory "/toplevel/directory/where/your/rails/app/lives/public">
      Options +FollowSymLinks
      Order allow,deny
     allow from all
    </directory>
    
  7. Setup your Rails project to run with SCGI and start SCGI server:
    $ cd /toplevel/directory/where/your/rails/app/lives
    $ scgi_ctrl config
       What password do you want? foobar
    # consult config/scgi.yaml for default configuration
    
    $ scgi_ctrl start
    $ scgi_ctrl status
    $ scgi_ctrl stop
    
  8. Enjoy your SCGI-servered Rails app at http://yourhost.com/rails/

The Chronic (what?) nles of Narnia

Monday, December 19th, 02005

The Chronic (what?) nles of Narnia - The Pib + Red Vines = Crazy Delicious!

Update: Available for free on iTunes

Christmas Lights

Monday, December 19th, 02005

I put up some Christmas lights tonight, but I ran out of 1/2 off Hobby Lobby strands and the shelves were bare when I returned to get more. As a result it’s kind of 9/10 complete.

Better than nothing I guess…

I may attempt an adjustment tomorrow.

Update: