Archive

Archive for March, 2008

Design-o-Logics: Today’s market is the market of Design

March 24th, 2008

Today’s market is the market of the Design but the technology. Not only related to the web applications but in a very generic sense. The greatly designed application basecamp turned Rails into a favorite framework of numerous programmers all over the globe. But the non-tech end users who are using basecamp don’t even think on which tech it has been built. Its all design and usability that matters. If you are in product business, the technology matters when it comes to scalability. A lots of frameworks offers good scalability… Rails applications are now even much more scalable. The great thing, which certainly adds up much a +ve biasing to select Rails as a framework of choice is the boost it adds to the development speed for a product business. But, for a services and consultancy most people opt for whats in demand in the market. I really like working on rails, naturally in consultancy it gives good business and in product it adds up a speed which second to none.
But the only thing which is mandatory to be on top with any tech you select for your product is the design and the vice-versa doesn’t stand here.

Great words from great design enginners…

With the market being ultra-competitive and high on style, it is not enough to just have a good product — it has to score good on looks too.

Design gives the consumer an experience and not just a product, which, in turn, leads to a loyal customer base. This is one area where investments are small when compared to the benefits a company can get out of it.

It takes time fort a startup to realize the worth of design. A startup is also, more often than not, cash strapped and thus does not have funds to invest in designing, which is an area that requires huge investments.

sur design

Nginx: Set up error pages

March 22nd, 2008

Setting up custom error pages are needed whenever the app goes in maintenance or when the code gets crashed :P … In Nginx, its fairly simple but once when you know it.

Say your app example.com is residing in /var/www/apps/example

Nginx configurations

say your existing configuration looks like…

  server{
      listen 80;
      server_name .example.com;
      location / {
           proxy_set_header  X-Forwarded-For $proxy_add_x_forwarded_for;
           proxy_set_header Host $http_host;
           proxy_redirect false;
           proxy_pass http://127.0.0.1:9002;
      }
  }

add the error page configurations

  server{
      listen 80;
      server_name .example.com;
      location / {
           proxy_set_header  X-Forwarded-For $proxy_add_x_forwarded_for;
           proxy_set_header Host $http_host;
           proxy_redirect false;
           proxy_pass http://127.0.0.1:9002;
      }
      error_page 500 502 503 504  /500.html;
      location = /500.html {
          root  /var/www/maintenance/example;
      }
  }

Create the required html error page at /var/www/maintenance/example/500.html.
Now, restart the nginx to reload the configurations by issuing /etc/init.d/nginx restart.
And you are done!

sur nginx

New in Ruby 1.9: Block Scoping

March 16th, 2008

Ruby 1.9 provides the block scoping of the local variables. It shadows the outside local variable in the block and allocates a new object_id in the memory to the block variable, which essentially means much more flexibility in using the lambdas without worrying about the name of the block variable. Remember that instance, class and global variables are still the same and can be used outside and inside the block as usual.

ruby <= 1.8

a = 9
p a # => 9
[1, 2, 3].each{|a|}
p a # => 3

ruby 1.9 (shadows the local variable a)

a = 9
p a # => 9
[1, 2, 3].each{|a|}
p a # => 9

sur ruby, ruby1.9

Ruby interface for OpenSSL

March 4th, 2008

If you have installed ruby using apt-get or if you have not mentioned the configuration option for openssl while installing from source, you can expect openssl will not work with ruby.

Here is the solution for the same…

Step 1

Install gcc and make(if you don’t have already on your box)

  sudo apt-get install gcc make

Step 2

Install the system level OpenSSL and dev libraries

  sudo apt-get install openssl libssl-dev

Step 3

Install the ruby’s openssl interface to the system’s openssl

switch the directory to the ruby’s source code’s openssl

  cd /usr/local/src/ruby1.8.6/ext/openssl

install the ruby’s openssl interface

  sudo ruby extconf.rb
  make
  make install

try requiring the openssl in irb

  require 'openssl'

if returns true, installed successfully!

sur openssl, ruby, ubuntu

Setup locales in Ubuntu

March 4th, 2008

In a fresh Ubuntu, not having the locales setup, it shows warning every time while installing any software/library and while stopping/restarting as well.
You can setup the required locales easily.
The following example shows the simple steps to setup the en_IN UTF-8 locale.

Step 1

Edit or Create the file /var/lib/locales/supported.d/local and add the required local in the file as follows

  en_IN UTF-8

you can add more locales in new lines.

Step 2

reconfigure your system’s locales by issuing the command

  dpkg-reconfigure locales

Thats done!

sur locales, ubuntu