Passenger support for Vlad

I’ve written a tiny module for Vlad to deploy to Passenger (mod_rails). It’s available from http://github.com/aussiegeek/vlad

To use it, just update your Rakefile where Vlad.load is called, and update it like so:

Vlad.load :app => 'phusion'
Jun 20 2008 08:42 | Tags: rails vlad passenger mod_rails | 0 comments

Rails 2.1 migration

I’ve hacked together a simple script for converting timezones from the local timezone to utc for Rails 2.1

        #!env ruby
        class DummyTable
          def initialize(tablename)
            @@tablename=tablename
          end
          def self.method_missing(m, *args); end
        
          def self.datetime(name,options={})
            puts "execute \"UPDATE #{@@tablename} SET #{name}=CONVERT_TZ(#{name},'SYSTEM','+00:00');\"" 
          end
        end
        
        def create_table(tablename,options,*block)
          dummy_table=DummyTable.new(tablename)
          yield DummyTable
        end
        
        def add_index(name,fields,options={}); end
        
        class ActiveRecord;end
        
        class ActiveRecord::Schema
          def self.define(options={}, *block)
            yield
          end
        end
        
        require 'db/schema.rb'
        

Drop this file in the root of your project and just run it with plain Ruby. I wrote it this way so I could avoid ActiveRecord, it will spit out a bunch of execute commands ready for plugging in to a migration

Jun 17 2008 14:23 | Tags: rails timezone migration | 0 comments

New Position

I’m moving on two greener pastures, and starting a new position on Monday. I’m doubling the team with another Mac based rails guy, I think I’ll be right at home

May 16 2008 21:29 | Tags: stuff | 0 comments

Haml/Sass talk at Brisbane.rb

I’ll be giving an intro to Haml & Sass at the Brisbane Ruby & Rails Brigage on monday night, if anybody is interested

May 14 2008 08:57 | Tags: rails haml sass brisbane-rb | 1 comment

SSH keys on Debian/Ubuntu

I seen today a twit that there was a vulnerability in the way that Debian & Ubuntu generate ssh keys. On the surface it would seem I’m ok because of old keys, there are numberous ways they could have become comprisied, so lucky me, time for a new set of ssh keys!

May 14 2008 07:57 | Tags: ssh debian ubuntu | 0 comments

Github Badge

My plan a few weeks ago was to write a badge for GitHub but I see Dr Nic has beaten me to it

The plan was to add his version to my site today but looks like some bugs involving prototype.js that I need to look at

May 06 2008 09:17 | Tags: git github javascript drnic | 0 comments

mod_rails

I’ve just migrated the server that runs my blog, and some internal apps to mod_rails.

It is extremely simple to deploy compared to apache+mongrel like I was using previously, and more memory effecient for the seldom used apps I keep on this server.
I was warned of some potential gotchas in regards to rewrite rules, but no issues here, altough I am only using rewrites to redirect feed requests to FeedBurner.
My config for this virtual host in all its gory detail:
              <VirtualHost *>
              ServerName aussiegeek.net
              DocumentRoot /srv/www/alanblog/current/public
        
              RewriteEngine On
        
              RewriteCond %{HTTP_USER_AGENT} !FeedBurner
        
              RewriteRule ^/posts\.xml$ http://feeds.feedburner.com/alanharper [R=301,L]
              </VirtualHost>
              
Yes, thats all. Good work guys!
Apr 22 2008 10:42 | Tags: rails mod_rails feedburner | 2 comments

Snippets for Sass Bundle

I use Sass (& Haml), where its an option for producing sites, as I like the ‘cleanliness’ of it. I have been missing being able to use the snippets of the TextMate CSS bundle, so I have ported them over to a Sass bundle, with the syntax from http://sporkmonger.com/2007/12/24/sass-textmate-bundle.

I have published it at http://github.com/aussiegeek/ruby-sass-tmbundle/tree/from-css-bundle
Mar 23 2008 01:06 | Tags: git rails sass | 4 comments

Home Directory

I log on to a lot of various unix like machines (mainly Mac & Linux), and I have setup my environment for things such as autotest, vim, and my bash prompt in my own useful way.

I used to store this in a private subversion repository, but I figured in the process of converting it to git, that I should share it. It is on github for all to see.

Recent addition was adding the current git branch to the bash prompt as mentioned on Simplistic Complexity

Mar 20 2008 10:10 | Tags: unix git mac | 1 comment

Git for Rails

Last night I ran a presentation on using Git, and very briefly how to start a rails project in git for the Brisbane Ruby & Rails Brigade

Mar 18 2008 08:17 | Tags: git rails | 0 comments