Archive for May, 2009

Check the variable an integer

Check the variable is a integer or others.


read Nau
if [ “${Nau//[^0-9]/}” == “$Nau” ]; then
echo “$Nau Is a number”;
echo “$Nau is not a number”


No Comments

Install versioned_urls plugin

Install versioned_urls plugin via
script/plugin install

Add appropriate rewriting and cache-header-pushing configuration to your web servers, e.g., for lightty:
url.rewrite-once = ( “^/(.*.(css|js|gif|png|jpg)).v[0-9.]+$” => “/$1” )
expire.url = ( “/stylesheets/” => “access 10 years” ,
“/javascripts/” => “access 10 years”,
“/images/” => “access 10 years” )

More details

, ,

No Comments

we are back

we are back, for some reason, the account is locked.
Earn more money, we can setup our own server.


make a backup firstly!

No Comments

Problem: Upgrading from a previous version

Upgrading from a previous version of Rails to the latest 2.3.2, you get an error:

NameError: uninitialized constant ApplicationController

both in the web browser and in console.

Since the introduction of Rails 2.3 the application.rb file has been renamed to application_controller.rb.
So in order to solve the problem just rename your file application.rb to application_controller.rb.


No Comments

I read the following book this weekend

I read the following book this weekend

and do the exam it mentions, but there is a problem.

Q: NoMethodError (undefined method `scaffold’ for AdminController:Class):
A: my rails version is 2.3.2
the “scaffold” method was removed in Rails 2.0.
in order to resolve it , just run the following commands in the app directory
script/plugin install scaffolding
script/plugin install svn://

when u want to practice with the examples, just install the lower version
gem install rails –version 1.2.6 –include-dependencies


No Comments

Install my wireless card driver

I have just install my wireless card driver ( bcm4312) on opensuse 11.1 (64bit)
my laptop is dell 1310

I use the most simple way
sudo zypper ar pack_man
sudo zypper install broadcom-wl
sudo reboot
the wireless card works.

install flash player x86_64 for firefox
sudo mkdir /usr/lib64/firefox/plugins
sudo cp /usr/lib64/firefox/plugins/

ref links

, ,

1 Comment

I am sorry to mongrel !

I am sorry to mongrel ! What are we focuse on, Mongrel ?

Mongrel V.S. Passenger

just forget about Mongrel, and to know why ?
Read the rest of this entry »


No Comments

Besides the Mongrel_Rail for RoR app

Besides the Mongrel_Rail for RoR app, I found a new server modules:
Phusion Passenger
It is easy to deploy with Apache

I have tried it, it works well, maybe more test on it in the future.

my ruby.conf for my app in Apache

“<"VirtualHost *:80">”
ServerName myip
DocumentRoot /path/to/app/public/ # the RoR app’s public directory

AddOutputFilterByType DEFLATE text/html text/plain text/xml application/xml application/xhtml+xml text/javascript text/css application/x-javascript
BrowserMatch ^Mozilla/4 gzip-only-text/html
BrowserMatch ^Mozilla/4.0[678] no-gzip
BrowserMatch bMSIE !no-gzip !gzip-only-text/html

ExpiresActive On
ExpiresByType image/gif A2592000
ExpiresByType application/x-javascript A2592000
ExpiresByType text/css A2592000
ExpiresByType text/html M604800

, ,

No Comments

Install Ruby On Rails on MacOS as common user

Install Ruby On Rails on MacOS ( not as admin user )

1. install ruby

get the ruby sources from the, we take ruby-1.8.6-p368.tar.bz2 for e.g.
tar xvf ruby-1.8.6-p368.tar.bz2 && cd ruby-1.8.6-p368
./configure –prefix=/User/yourname/ruby && make && make install

2.set the enviorment
edit the ~/.bash_profile, change the PATH=/User/yourname/ruby/bin:$PATH
source ~/.bash_profile and u can check by command: ruby -v

3. install gems
get the gems from , we take rubygems-1.3.3.tgz for e.g.
tar xvf rubygems-1.3.3.tgz && cd rubygems
ruby setup.rb
Read the rest of this entry »


No Comments

I will focus on Ruby on Rails this one week

I will focus on Ruby on Rails this one week or two …(server side of course)

get some links to remember:
Rails Performance Testing Tools

good articles to scaling the ruby apps.

Memcached Integration in Rails

No Comments