msgbartop
Useful MOSS 2007 and Ruby and Rails stuff
msgbarbottom

25 Nov 08 Installing Ruby on Rails on Fedora 9 with Nginx, Thin and Git">Installing Ruby on Rails on Fedora 9 with Nginx, Thin and Git

Setting up fedora first
rpm –import /etc/pki/rpm-gpg/RPM-GPG-KEY*
sudo yum update
sudo yum install fetchmail wget bzip2 unzip zip nmap openssl lynx fileutils ncftp gcc gcc-c++

Install Ruby
sudo yum install ruby ruby-devel rdoc irb

Install rubygems
Download from http://rubyforge.org/frs/?group_id=126
tar xzvf rubygems*.tgz
cd rubygems*
sudo ruby setup.rb

Install Rails
sudo gem install rails

Install postfix and svn
sudo yum install postfix subversion

Install MySQL
sudo yum install mysql mysql-devel mysql-server
chkconfig –levels 235 mysqld on
sudo /etc/init.d/mysqld start
sudo /sbin/service mysqld start
sudo mysqladmin -u root password ‘new-password’
sudo yum install libmysql-ruby1.8
sudo gem install mysql

Install Nginx
sudo yum install nginx
sudo /etc/init.d/nginx start

Install Thin
sudo gem install eventmachine
sudo gem install thin
sudo thin install
sudo /sbin/chkconfig –level 345 thin on

Install Git
sudo yum install git

19 Nov 08 Installing Webmin / Virtualmin on Slicehost Ubuntu 8.04">Installing Webmin / Virtualmin on Slicehost Ubuntu 8.04

After trying out various web control panels, I finally settled on webmin.

I was looking for an open source / free web control panel that would allow users easily set up websites via virtual hosts and ftp accounts

Here are the steps to get it up and running quickly. This has to be done on a fresh new slice and not one that is already hosting other websites.

  1. This assumes you have created a Ubuntu 8.04 slice 
  2. Set it up as per instructions here: 
    http://articles.slicehost.com/2008/4/25/ubuntu-hardy-setup-page-1
    http://articles.slicehost.com/2008/4/25/ubuntu-hardy-setup-page-2 
  3. The fastest way to set up Virtualmin using the install script:
    http://www.webmin.com/vinstall.html

    $ wget http://software.virtualmin.com/gpl/scripts/install.sh
    $ chmod +x install.sh
    $ sudo ./install.sh 

    That’s all! You’ll be able to view your site via https://xxx.xxx.xxx.xxx:10000
     

  4. I’ve managed to set it up with rails too following the instructions here:
    http://articles.slicehost.com/2008/5/6/ubuntu-hardy-apache-rails-and-thin

Tags: ,

23 Sep 08 Restful_authentication Internet explorer cannot logout http_basic problem">Restful_authentication Internet explorer cannot logout http_basic problem

If you’re getting a security box popup like I did, here’s the link to the solution

http://groups.google.com/group/rubyonrails-talk/browse_thread/thread/97981fedc00d98fa/3e435bd3e66952c7?lnk=raot

Basically, just edit /lib/authenticated_system.rb, and add ‘(:xml, :json)’

def access_denied
      respond_to do |format|
        format.html do
          store_location
          redirect_to new_session_path
        end
        format.any(:xml, :json) do
          request_http_basic_authentication ‘Web Password’
        end
      end
    end

 

Make sure your <head> tag has this too:

<META HTTP-EQUIV=”Pragma” CONTENT=”no-cache”> 
<META HTTP-EQUIV=”Expires” CONTENT=”-1″>

Tags:

21 Sep 08 Rails Pagination">Rails Pagination

From :

http://github.com/mislav/will_paginate/tree/master

Installation

script/plugin install git://github.com/mislav/will_paginate.git

Usage

@posts = Post.paginate :page => params[:page], :o rder => 'created_at DESC'

In the view, page links can be rendered with a single view helper:
<%= will_paginate @posts %>

Technorati Tags:

Tags: , ,

11 Sep 08 Ruby strftime Reference">Ruby strftime Reference

%a  weekday name.
%A  weekday name (full).
%b  month name.
%B  month name (full).
%c  date and time (locale)
%d  day of month [01,31].
%H  hour [00,23].
%I  hour [01,12].
%j  day of year [001,366].
%m  month [01,12].
%M  minute [00,59].
%p  AM or PM
%S  Second [00,61]
%U  week of year (Sunday)[00,53].
w  weekday [0(Sunday),6].
W  week of year (Monday)[00,53].
x  date (locale).
%X  time (locale).
%y  year [00,99].
%Y  year [2000].
%Z  timezone name.

http://snippets.dzone.com/tag/strftime#post1643

http://sg.php.net/strftime

Tags: , ,

13 Aug 08 Rails Ajax Overlays">Rails Ajax Overlays

http://blogs.ericmethot.com/modal-overlay/

and lowpro

http://jlaine.net/2007/8/3/from-rails-ajax-helpers-to-low-pro-part-i

13 Aug 08 RESTful authentication on Rails 2.1 with roles">RESTful authentication on Rails 2.1 with roles

http://crazyrails.com/how-to-install-restful-authentication/

More… this one has “forget password”

http://www.aidanf.net/rails_user_authentication_tutorial

Tags:

07 Aug 08 Rails 2.1 Checkbox list">Rails 2.1 Checkbox list

http://www.justinball.com/2008/07/03/checkbox-list-in-ruby-on-rails-using-habtm/

Tags:

This blog is multi language by p.osting.it's Babel