Just one damn thing after another

yatender.com


Deploying php projects with capistrano

written by yatender
at 6:03 pm
on July 14, 2010
in Life
no comments

Using Ruby conventions have gotten quite popular to many web developmet environment across many languages . Sun have created a whole language to imitate the programming practices that were being in use for many years in Ruby On Rails they have called it groovy on grails.

One of the unique practices in Ruby on rails is the cool migration scripts and another is the use of capistrano for automated deployment.

Capistrano is though build for the deployment of Ruby on Rails application but it can be used to almost any other web development language and framework.

I have created such a deployment script to automate deployment for a Ecommerce site built in magento.The number of servers currently are two, one is the staging server and another is production.

so begin with install capistrano like this

sudo gem install capistrano

create a small rails application using

rails myapp

cd to get in this directory and now type.

capify

For the new version of capistrano you can define the number of server environment by using line like this in the deploy.rb

require ‘capistrano/ext/multistage’

for this you will need capistrano multistage gem. so install it like this

sudo gem install capistrano-ext

the staging and production server scripts can be defined like this

set :stages, %w(staging production)
set :default_stage, “staging”

create a folder named deploy in config directory.

Now define your staging and production setting by creating files like this

staging.rb and production.rb

The staging.rb from inside will look like this

set :repository, “svn or git repository url”
set :deploy_to, “folder name where to put deployed releases”
role :web, ‘ip name of the server’
role :app, ‘ip name of the server’

now define the task in deploy.rb for before and after deployment and things you want to do at the time of deployment.

I have defined the command to clear the var folders like cache and session, after the main deployment process is finished.Also i kept the var and media folder in a static location and created symlinks just after deployment to point to these folders.

Now in command line go to myapp

cd myapp

cap staging deploy

the deployment will try to do the default tasks for Ruby on Rails application , but it will not anyway impact the php application that you deployed.

Myisam or innodb which one to use where

written by yatender
at 4:45 pm
on September 22, 2009
in technology
no comments

There are no clear guidelines to follow when you have to decide which one is better the old Myisam or the transaction based innodb.  In my experience the choice will differ from application to application and  database operations that are frequently used. 

Innodb comes with all the transactional database goodies and it is the choice if the database will be used as the OLTP with good number of reads and writes on it, It needs foreign key constraints . The table sizes aren’t big and the joins in the queries aren’t many.

But if the number of operations have to read most of the time and the application don’t require transaction control you must not overlook Myisam because it can give the kind of  boost to your databse performance no other DBMS can compete with. Suppose if number of writes are more then every time a table is updated it will be locked for other operation this is not a problem with innodb which is row based.

nnoDB is a largely ACID (Atomicity, Consistency, Isolation, Durability) engine, built to guarantee consistency and durability. It does this through a transaction log (with the option of a two-phase commit if you have the binary log enabled), a double-write buffer and automatic checksumming and checksum validation of database pages.Myisam isn’t crash safe and  if things go wrong getting db from the backup is the only choice.

Never think of mixed engine tables  unless it is absolutely necessary. The mixed type table will give trouble at replication and at the time of backup.Performance analyzing and balancing will be difficult and slow. If a crash happens then  to recover it wont be easy either.

kaminey must watch for bollywood fans

written by yatender
at 12:23 am
on August 17, 2009
in Life
3 comments

Kaminey is a hatke masala movie first of its kind in bollywood history. While the critics are putting it in the tarantino style movies but there are many differences. You must watch it twice to have a opinion about it.  Other than the title of movie and glimpses of the past in between there is nothing else common with pulp fiction  or reservoir dogs. Vishal bhardwaj have his own style while all his previous movies are slow and spontaneous kaminey progresses too fast there are too many stories mingling with each other and central characters are twin brothers who hate each other. unlike of all the twin characters of bollywood they have a same accent and have a common problem with speech but they lives separately and when the need arises they are willing to sacrifice life of each other. The cinematography is best of the bollywood and the credit goes to tassaduq hussain who have earlier worked in omkara. I liked the go charlie scene which is filmed in a five star mumbai hotel. Producers presents it like a action movie of the 70s with all the guns , goons and dishum dishum. But the dhen te nan is more in the first half of drama then the final climax. The movie might not be popular with the naive indian movie goers but the urban class and the young generation will certainly like it. The movie should be watched by all the cinema goers as one critic have rightly put “like it or leave it you can not ignore it”. Other than the lead pair shahid and priyanka almost every character in the movie have a experience in stage acting. But shahid and priyanka are too good with acting particularly shahid is brilliant with most part of the movie the camera is on him. Amole gupta is great as a mee marathi manus politician of mumbai who hate all the outsiders coming to bombay. Though the movie is not yet opened in bombay because of swine flu there are many dialogs which are not understandable to non marathi peoples and the subtitles are in english for the part where african smugglers are conversing and also there were dialogs which are in english and bengali too. The creator are not at all taking the vast audience of bollywood in consideration. Earlier the language problem have hit the star studded omkara which have so many of its dialogs in the west U.P  dialects that was not understandable to vast indian audience who have missed their share of laughs because they cannot understand the words being sad. But that did not discouraged the director to do a similar thing in his next movie. The dialogs were pretty good and my favorite of all is when charlie says

waat iffey nahin lagti ki tu konfa rafta chunta hai.waat lagti hai iffe ki tu konfa rafta chodta hai.

The music is really good as in all the director’s movies and the songs and dance are in the sync with the story. Like both omkara and maqbool kaminey have one fast beat song, one public gathering song, one intimate romantic song and one is a slow song. Sung and picturised in the way with vishal bhardwaj stamp all over them.


about this

fineprint
yatender.com uses Wordpress.
"GothamNights" theme brought to you by EvanEckard