My Code book

Archive for June 2009

Pune to Alibaug Trip

Posted by: Purab on: June 24, 2009

Pune to Alibag distance :115Km.
Route : Pune->Lonawala->Khopoli->Pen->Alibaug
Nagaon Beach:
This is the one of the cleanest, enjoyable Beach. Friends, Couples can freely enjoy. Very open cultured place. You can drink on the Beach also. Fun…

Do you remember “Sagar Kinare Dil Ye Pukare” from film Sagar ? That is Nagaon..approximately 7 Km from Alibag, on Alibag-Revdanda road. Famous [...]

Install Apatana Studio on Fedora 9

Posted by: Purab on: June 23, 2009

Installation of Apatana in Detail
1. Download zip file from this location(http://www.aptana.com/studio/download)
File name:Aptana_Studio_Setup_Linux_1.2.7.zip
2. Then uncompress the .zip file. and copy the resulting ‘aptana’ folder under ‘/home/purab’.(purab is my username for fedora, you have replace your username)
3. Install xulrunner (for install xulrunner user following command, Became root first)
yum install xulrunner
or follow this step
Down load xulrunner from this [...]

Memcached Server with Rails

Posted by: Purab on: June 16, 2009

To install memcached server on linux/fedora box
yum install memcached
Find help for memcached commands and option
memcached -help
Start memcached server(11211 is default port Number for memcached server)
memcached -m 500 -l 192.168.2.4 -p 11211 -vv
(192.168.2.4 this is my local ip address you can cahnge that)
Stop the Memcached server
ps -ef|grep memcached
kill PROCESS_ID
start memcached server with
memcached -m 500 -l 192.168.2.4 [...]

Easy Steps for setting up nginx with php on Linux

Posted by: Purab on: June 16, 2009

I am using Fedora 10 so for that linux version i used these commands for setting up my server.
Installing Nginx:
yum install nginx
Then we create the system startup links for nginx:
/sbin/chkconfig –level 35 nginx on
We can make PHP5 work in nginx through FastCGI.For that install all this packages:
yum install lighttpd-fastcgi php-cli php-mysql php-gd php-imap php-ldap php-odbc [...]

deconstructing date_select in rails

Posted by: Purab on: June 16, 2009

// Reconstruct a date object from date_select helper form params
// place this code into your application.rb file
def build_date_from_params(field_name, params)
Date.new(params["#{field_name.to_s}(1i)"].to_i,
params["#{field_name.to_s}(2i)"].to_i,
params["#{field_name.to_s}(3i)"].to_i)
end
//You can changes order of displaying into view
<%= date_select ‘from’, ‘date’ ,:order => [:day, :month, :year] %>
<%= date_select ‘to’, ‘date’,:order => [:day, :month, :year]  %>
//goes into controller — add your own error handling/defaults, please!
@from = build_date_from_params(:date, params[:from])
@to [...]


Add This page

Bookmark and Share

Blog Stats

  • 13,797 hits

Purab’s Twittes