Avoiding the Distractions

I was reading something about how to avoid the distractions and the article exemplified it using a scene from the Indian mythology ‘Mahabharata’ where the Guru Dronacharya asked all the students to aim at the bird’s eye sitting at a branch of the tree, then he asked what you can see… most students replied they can clearly see the branch, tree and the bird… only Arjuna said he can only see the bird’s eye… At that very young age he had learned the willingness of how to avoid the distractions which are joyful to you.

Here in this post I admit that gaming, especially playing ‘Tekken3′ is one of the biggest distraction for me. As whenever I spend continuous hours on work, I get the time out and start playing ‘Tekken3′ which surely very much joyful. But, actually I know I make reason to myself to play that game and not actually to take some time off to have rest. Playing game certainly gives some enjoyment but not exactly the rest, I still be in the same position on my desk, sitting on my chair, and playing the game instead of doing the work… so its almost that I am doing work and not giving rest to my body. So, basically I was not willing enough to say that the game is a distraction for me… instead I kept on saying that I am playing it to take a time out of the work, But its for sure a wastage of time. And now I am sure enough to say its purely a wastage of time as I have made a resolution to say NO TO GAMES. I am in my 20s and need to conquer many of my dreams and need to work really hard to do so… which will certainly require killing of all these distractions in my life. And I’ve started very well by signing off from games… Though its true that I have a dream to run a Gaming company… and if I would be able to do so… the Gaming will also be my work ;)

So, to take time out from my work I would rather now read my newspaper and I can now allocate the time I used to spend in reading newspaper back to work. Reading newspaper is a required task to be accomplished and would not be a reason to take a forced time out from the work… moreover I can relax while reading newspaper that I couldn’t do while gaming. I must say I have dumped a biggest distraction of mine.

April 21st, 2008   No Comments

Acts as solr: Logical Search

There are a couple of ways described in acts_as_solr documentation for the logical search, with AND or OR operations. But I needed to dig a bit into the code as the documentation is not complete and doesn’t suggest all the possible implementations of making the complex Logic Gates for searching.
Here I am consolidating various possibilities of Logical Search…

Find all blogs with category ruby or rails

another way

Find all blogs with categories ruby and rails

another way

Grouping for more precision

NOTE: mind the grouping using parenthesis, you might get unexpected results without proper grouping.

Find all blogs with categories ruby or rails with author Sur

Find all blogs with categories ruby AND rails with author Sur

Find all blogs with categories ruby or rails with author Sur or David

Find all blogs with categories ruby and rails with author Sur or David

April 15th, 2008   No Comments

Mongrel to THIN

For Rails applications I am using THIN on my local machine since a couple of weeks and found it better than Mongrel. I’ve started replacing mongrel with THIN on servers as well. THIN leverages the best of the available resources… It uses mongrel’s parser along with the Eventmachine and the Rack Ruby libraries which together provide better speed, greater requests/sec and certainly consumes lesser memory.

Install THIN by issuing

THIN accepts more or less similar switches as that of mongrel. You start THIN by issuing

-p — port, defaults to 3000
-e — environment, defaults to development
-d — daemonize mode

THIN provides an in built support for clustering and running multiple servers for the same applications. You can start say 3 servers for the single application by providing the -s switch as…

And similar to mongrel it will start three servers on the ports 9090, 9091 and 9092.

April 15th, 2008   No Comments

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

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.

March 25th, 2008   No Comments

Nginx: Set up error pages

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…

add the error page configurations

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!

March 23rd, 2008   No Comments