<?xml version='1.0' encoding='UTF-8'?><rss xmlns:atom='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0' version='2.0'><channel><atom:id>tag:blogger.com,1999:blog-1770001802890288716</atom:id><lastBuildDate>Sun, 13 May 2012 14:05:12 +0000</lastBuildDate><category>PHP</category><category>Web Development</category><category>Mailer</category><category>TDD</category><category>Css</category><category>scrum</category><category>Git</category><category>General</category><category>Agile</category><category>Resources</category><category>log</category><category>Server</category><category>MySql</category><category>Error</category><category>.htaccess</category><category>Ruby on Rails</category><category>Security</category><category>JavaScript</category><category>Html</category><category>Facebook</category><title>Morshed Alam</title><description>My activities, thoughts, inspiration, ideas, and everything else on Rails and PHP</description><link>http://www.morshed-alam.com/</link><managingEditor>noreply@blogger.com (Morshed Alam)</managingEditor><generator>Blogger</generator><openSearch:totalResults>48</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-1770001802890288716.post-5062878110922997287</guid><pubDate>Wed, 04 Apr 2012 10:55:00 +0000</pubDate><atom:updated>2012-04-09T01:38:08.758+06:00</atom:updated><category domain='http://www.blogger.com/atom/ns#'>Ruby on Rails</category><title>How to rename Rails3 application</title><description>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;A Rails3 &lt;b&gt;application name&lt;/b&gt; are using as a Ruby name space for entire application and throughout the project tree as well. So, If anyone later decide to change the project name, then have to replace the name in the following files:  &lt;br /&gt;&lt;pre class="brush: js; toolbar: true;"&gt;Rakefile&lt;br /&gt;config.ru&lt;br /&gt;config/routes.rb&lt;br /&gt;config/application.rb&lt;br /&gt;config/environment.rb&lt;br /&gt;config/environments/development.rb&lt;br /&gt;config/environments/test.rb&lt;br /&gt;config/environments/production.rb&lt;br /&gt;initializers/secret_token.rb&lt;br /&gt;initializers/session_store.rb&lt;/pre&gt;&lt;br /&gt;You can run following command in your project root, to find out the list of files containing project name(assume you are using linux): &lt;br /&gt;&lt;pre class="brush: js; toolbar: true;"&gt;grep -Ri 'AppName' * | cut -f1 -d':' | sort | uniq&lt;/pre&gt;&lt;br /&gt;You can use following gem to rename rails3 application without any hassle: &lt;br /&gt;&lt;div&gt;&lt;a href="https://github.com/morshedalam/rename"&gt;https://github.com/morshedalam/rename&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1770001802890288716-5062878110922997287?l=www.morshed-alam.com' alt='' /&gt;&lt;/div&gt;</description><link>http://www.morshed-alam.com/2012/04/how-to-rename-rails-3-application.html</link><author>noreply@blogger.com (Morshed Alam)</author><thr:total>0</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-1770001802890288716.post-3510707024727806912</guid><pubDate>Tue, 10 Jan 2012 08:07:00 +0000</pubDate><atom:updated>2012-01-10T14:07:00.037+06:00</atom:updated><category domain='http://www.blogger.com/atom/ns#'>General</category><title>Multiple login in google talk</title><description>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;Most of us have multiple google talk IDs and used third party software to login at a time. But, anyone can do multiple login to gtalk by using a simple trick below:&lt;br /&gt;&lt;br /&gt;&lt;ul style="text-align: left;"&gt;&lt;li&gt;Right click gtalk icon and select properties&lt;/li&gt;&lt;li&gt;Add &lt;b&gt;/nomutex&lt;/b&gt; at the end of target property like following way&lt;pre class="brush: js; toolbar: true;"&gt;"C:\Users\Morshed\AppData\Roaming\Google\Google Talk\googletalk.exe" /startmenu /nomutex&lt;/pre&gt;&lt;/li&gt;&lt;li&gt;Click to &lt;b&gt;Apply&lt;/b&gt; and Ok&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;Done! Now click on gtalk icon and open as many as gtalk windows you want. Cheers!! &lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1770001802890288716-3510707024727806912?l=www.morshed-alam.com' alt='' /&gt;&lt;/div&gt;</description><link>http://www.morshed-alam.com/2012/01/multiple-login-in-google-talk.html</link><author>noreply@blogger.com (Morshed Alam)</author><thr:total>0</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-1770001802890288716.post-7818507623597112343</guid><pubDate>Sat, 31 Dec 2011 08:18:00 +0000</pubDate><atom:updated>2011-12-31T15:20:49.956+06:00</atom:updated><category domain='http://www.blogger.com/atom/ns#'>Security</category><category domain='http://www.blogger.com/atom/ns#'>Web Development</category><category domain='http://www.blogger.com/atom/ns#'>Ruby on Rails</category><title>HTTP basic authentication using email address</title><description>In my previous article, I have written about &lt;a href="http://www.morshed-alam.com/2011/12/http-basic-authentication-in-rails-to.html"&gt;HTTP basic authentication in rails&lt;/a&gt; using a plain user access YML. &lt;br /&gt;&lt;br /&gt;Last few days ago, I have modified the logic to log-in using email address and password. So that anyone don't need to remember another new password. Hope it might help you... &lt;br /&gt;&lt;br /&gt;Written a news private method &lt;pre class="brush: js; toolbar: true; highlight: [3];"&gt;def login_by_email(user_name, password)&lt;br /&gt;    is_logged_in = false&lt;br /&gt;    if (user_name.match(/.+\b@yourdomain.com$\b/i))&lt;br /&gt;      require 'net/imap'&lt;br /&gt;      require 'openssl'&lt;br /&gt;      client = Net::IMAP.new(host, port, true, nil, false)&lt;br /&gt;      begin&lt;br /&gt;        client.login(user_name, password)&lt;br /&gt;        client.logout&lt;br /&gt;        is_logged_in = true&lt;br /&gt;      rescue Exception =&gt; error&lt;br /&gt;        logger.error "Unable to log-in :: #{error.message}"&lt;br /&gt;      end&lt;br /&gt;      client.disconnect&lt;br /&gt;    end&lt;br /&gt;    return is_logged_in&lt;br /&gt;  end&lt;/pre&gt; On line#3 I have checked the domain name to provide access for a specific domain.   After that modified the authentication method following way: &lt;pre class="brush: js; toolbar: true; highlight: [3]"&gt;def authenticate_for_staging_server&lt;br /&gt;    authenticate_or_request_with_http_basic do |user_name, password|&lt;br /&gt;      login_by_email(user_name, password) == true&lt;br /&gt;    end&lt;br /&gt;  end&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1770001802890288716-7818507623597112343?l=www.morshed-alam.com' alt='' /&gt;&lt;/div&gt;</description><link>http://www.morshed-alam.com/2011/12/http-basic-authentication-using-email.html</link><author>noreply@blogger.com (Morshed Alam)</author><thr:total>0</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-1770001802890288716.post-482204149357130000</guid><pubDate>Sun, 04 Dec 2011 04:59:00 +0000</pubDate><atom:updated>2011-12-30T01:30:04.036+06:00</atom:updated><category domain='http://www.blogger.com/atom/ns#'>Server</category><category domain='http://www.blogger.com/atom/ns#'>Security</category><category domain='http://www.blogger.com/atom/ns#'>Web Development</category><category domain='http://www.blogger.com/atom/ns#'>Ruby on Rails</category><title>HTTP basic authentication in rails to protect staging server</title><description>Sometimes, you may need to protect your staging server from outside world. It can be done easily by using http basic authentication in rails3.&lt;br /&gt;&lt;br /&gt; I did following things to use HTTP basic authentication to protect my staging server:&lt;br /&gt;&lt;br /&gt; &lt;b&gt;YML file with username and password pair:&lt;/b&gt;  &lt;pre class="brush: js; toolbar: true;"&gt;devuser: devpass&lt;br /&gt;testuser: testuserpass&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;b&gt;Loaded YML data from application initializer:&lt;/b&gt;  &lt;pre class="brush: js; toolbar: true;"&gt;HTTP_AUTH_USERS = YAML.load_file("#{Rails.root.to_s}/config/staging_server_users.yml")&lt;/pre&gt;&lt;br /&gt;&lt;b&gt;Callback and authentication in the application controller:&lt;/b&gt;&lt;pre class="brush: js; toolbar: true;"&gt;before_filter :authenticate_for_staging_server, :if =&gt; lambda { Rails.env.development? }&lt;br /&gt;&lt;br /&gt;private&lt;br /&gt;def authenticate_for_staging_server&lt;br /&gt;  authenticate_or_request_with_http_basic do |user_name, password|&lt;br /&gt;    password == HTTP_AUTH_USERS[user_name]&lt;br /&gt;  end&lt;br /&gt;end&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Hope it will help a lot who wants to protect their staging server.&lt;br /&gt;&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1770001802890288716-482204149357130000?l=www.morshed-alam.com' alt='' /&gt;&lt;/div&gt;</description><link>http://www.morshed-alam.com/2011/12/http-basic-authentication-in-rails-to.html</link><author>noreply@blogger.com (Morshed Alam)</author><thr:total>0</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-1770001802890288716.post-7693387473795475864</guid><pubDate>Sat, 19 Nov 2011 18:00:00 +0000</pubDate><atom:updated>2011-11-20T00:00:04.742+06:00</atom:updated><title>XForms in PHP</title><description>The next generation of HTML form is XForms which is more flexible than the HTML forms and saves a lot of time and effort. It enables the separation of data and logic from presentation as well.  &lt;br /&gt;&lt;br /&gt;In the XForms, XML used to define forms data, stores and transports data in the XML documents and has two different parts: &lt;ul&gt;&lt;li&gt;&lt;b&gt;XForm model&lt;/b&gt; - defines the form, what it should do, what data it contains&lt;/li&gt;&lt;li&gt;&lt;b&gt;XForm user interface&lt;/b&gt; - defines the input fields and how it will displayed&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;You can see a basic hello world example here - &lt;a href="http://en.wikibooks.org/wiki/XForms/HelloWorld"&gt;XForms/HelloWorld&lt;/a&gt;. You must have to install XForms extension for your Firefox version. &lt;br /&gt;&lt;br /&gt;Some more resources are given below: &lt;ul&gt;&lt;li&gt;&lt;a href="http://webdevelopment.bzupages.com/xforms/default.asp.htm"&gt;XForms Tutorial&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://en.wikibooks.org/wiki/XForms"&gt;XForms - Wiki&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.w3.org/MarkUp/Forms/2010/xforms11-for-html-authors/"&gt;XForms for HTML Authors (DRAFT)&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.ibm.com/developerworks/xml/library/x-xformstipphp/"&gt;Accepting XForms data in PHP&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.phpclasses.org/package/3378-PHP-Validate-XML-documents-using-XML-Schema.html"&gt;Class: PHP Xforms&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1770001802890288716-7693387473795475864?l=www.morshed-alam.com' alt='' /&gt;&lt;/div&gt;</description><link>http://www.morshed-alam.com/2011/11/xforms-in-php.html</link><author>noreply@blogger.com (Morshed Alam)</author><thr:total>0</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-1770001802890288716.post-1142930183821648265</guid><pubDate>Sat, 19 Nov 2011 12:57:00 +0000</pubDate><atom:updated>2011-11-19T20:14:27.244+06:00</atom:updated><category domain='http://www.blogger.com/atom/ns#'>Security</category><category domain='http://www.blogger.com/atom/ns#'>Facebook</category><category domain='http://www.blogger.com/atom/ns#'>General</category><title>How to deactivate facebook account</title><description>Now a days &lt;a href="http://facebook.com"&gt;Facebook&lt;/a&gt; became part of our busy life and couldn't think without it. But, if you need to deactivate your account then can do that by following steps below: &lt;br /&gt;&lt;br /&gt;Once, you deactivate your account, your profile and information will be instantly inactivated. But, information will not be lost however, and will be available to recover whenever you want within 14 days. &lt;br /&gt;&lt;br /&gt;Steps are given below to deactivate the Facebook account: &lt;ul&gt;&lt;li&gt;Go to &lt;b&gt;Account&lt;/b&gt; menu on top right corner of the page and select &lt;a href="http://www.facebook.com/settings"&gt;&lt;b&gt;Account Settings&lt;/b&gt;&lt;/a&gt;.&lt;/li&gt;&lt;li&gt;Click to &lt;a href="https://www.facebook.com/settings?tab=security"&gt;&lt;b&gt;Security&lt;/b&gt;&lt;/a&gt; from right side menu&lt;/li&gt;&lt;li&gt;Click to &lt;a href="https://www.facebook.com/deactivate.php"&gt;&lt;b&gt;Deactivate your account&lt;/b&gt;&lt;/a&gt; link from bottom&lt;/li&gt;&lt;li&gt;And, then select reason and click to &lt;b&gt;Confirm&lt;/b&gt; button&lt;/li&gt;&lt;li&gt;System will open a pop-up box for your password and captcha text. Enter those and click on the confirm button.&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;After confirmation system will redirect to Facebook's home page, where you will see a message confirming that your account has been deactivated. &lt;br /&gt;&lt;br /&gt;To cancel deactivation, log-in again and choose cancel deactivation within 14 days.&lt;br /&gt;&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1770001802890288716-1142930183821648265?l=www.morshed-alam.com' alt='' /&gt;&lt;/div&gt;</description><link>http://www.morshed-alam.com/2011/11/how-to-deactivate-facebook-account.html</link><author>noreply@blogger.com (Morshed Alam)</author><thr:total>0</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-1770001802890288716.post-3754675634425971970</guid><pubDate>Mon, 31 Oct 2011 06:51:00 +0000</pubDate><atom:updated>2011-12-30T01:43:45.536+06:00</atom:updated><category domain='http://www.blogger.com/atom/ns#'>Server</category><category domain='http://www.blogger.com/atom/ns#'>Ruby on Rails</category><category domain='http://www.blogger.com/atom/ns#'>Resources</category><title>Rails application deployment using shell script</title><description>I have used following shell script to deploy one of my Ruby on Rails applications:  &lt;pre class="brush: js; toolbar: true;"&gt;DATES=`date +%Y%m%d%H%I%S`&lt;br /&gt;service apache2 stop &amp;&amp;&lt;br /&gt;mysqldump -u[user] -p[pass] [yourdbname] &gt; "your backup directory"[yourdbname]_${DATES}.sql&lt;br /&gt;git pull &amp;&amp;&lt;br /&gt;bundle install --path [your bundle path] &amp;&amp;&lt;br /&gt;bundle exec rake db:migrate RAILS_ENV=production &amp;&amp;&lt;br /&gt;mv [your application's production log file] [your application's production log backup path]/production_${DATES}.log &amp;&amp;&lt;br /&gt;touch [your application's production log path]/production.log &amp;&amp;&lt;br /&gt;chown [user]:[group] [your application's production log file] &amp;&amp;&lt;br /&gt;service apache2 start&lt;/pre&gt; In the above code snippet, &lt;ul style="font-size:90%"&gt;&lt;li&gt;&lt;b&gt;Line 01:&lt;/b&gt; Used to get the current date time&lt;/li&gt;&lt;li&gt;&lt;b&gt;Line 02:&lt;/b&gt; Stopped the Apache server&lt;/li&gt;&lt;li&gt;&lt;b&gt;Line 03:&lt;/b&gt; Used to take database backup in the backup directory&lt;/li&gt;&lt;li&gt;&lt;b&gt;Line 04:&lt;/b&gt; Getting update source from repository&lt;/li&gt;&lt;li&gt;&lt;b&gt;Line 05:&lt;/b&gt; Bundle install to update gem list&lt;/li&gt;&lt;li&gt;&lt;b&gt;Line 06:&lt;/b&gt; Run database migration to migrate latest script if any&lt;/li&gt;&lt;li&gt;&lt;b&gt;Line 07:&lt;/b&gt; Rotating log in every deployment&lt;/li&gt;&lt;li&gt;&lt;b&gt;Line 08:&lt;/b&gt; Creating new production log file&lt;/li&gt;&lt;li&gt;&lt;b&gt;Line 09:&lt;/b&gt; Providing proper user access to write log&lt;/li&gt;&lt;li&gt;&lt;b&gt;Line 10:&lt;/b&gt; And, then start the server again&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;That's all. Your application should run without any issue if you configure third bracket's([]) information perfectly. &lt;br /&gt;&lt;br /&gt;But, now a days - Capistrano allows you to deploy a Rails applications easily. You can try that and can customize if you need to. &lt;br /&gt;&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1770001802890288716-3754675634425971970?l=www.morshed-alam.com' alt='' /&gt;&lt;/div&gt;</description><link>http://www.morshed-alam.com/2011/10/rails-application-deployment-using.html</link><author>noreply@blogger.com (Morshed Alam)</author><thr:total>0</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-1770001802890288716.post-5421742029897455552</guid><pubDate>Mon, 17 Oct 2011 04:48:00 +0000</pubDate><atom:updated>2011-12-30T01:44:53.457+06:00</atom:updated><category domain='http://www.blogger.com/atom/ns#'>Ruby on Rails</category><category domain='http://www.blogger.com/atom/ns#'>Mailer</category><title>Using helper method from action mailer views</title><description>Action Mailer of Ruby on Rails(RoR) allows you to send emails from application using a mailer model and views. Sometimes you may need to use any helper method though it does not allow by default. In that case you have to include helper(module) in the Mailer class. &lt;br /&gt;&lt;br /&gt;Say, you may need to use method(s) from ProductsHelper module, then you need to write following line in the Mailer file which will provide accessibility to use all methods written in  ProductsHelper &lt;pre class="brush: js; toolbar: false;"&gt;add_template_helper(ProductsHelper)&lt;/pre&gt;&lt;br /&gt;Cheers!! &lt;br /&gt;&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1770001802890288716-5421742029897455552?l=www.morshed-alam.com' alt='' /&gt;&lt;/div&gt;</description><link>http://www.morshed-alam.com/2011/10/using-helper-method-from-action-mailer.html</link><author>noreply@blogger.com (Morshed Alam)</author><thr:total>0</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-1770001802890288716.post-3782510218435721325</guid><pubDate>Thu, 29 Sep 2011 06:46:00 +0000</pubDate><atom:updated>2011-12-30T01:49:27.237+06:00</atom:updated><category domain='http://www.blogger.com/atom/ns#'>Server</category><category domain='http://www.blogger.com/atom/ns#'>Security</category><title>Disable a user account in Linux</title><description>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;There are some different approaches to do that. The easy way to disable a user account is to alter stored password which is stored to /etc/shadow. In that case password will be lost unless you save save the password in different file. &lt;br /&gt;&lt;br /&gt;You can alter the password by using following command:&lt;br /&gt;&lt;pre class="brush: js; toolbar: false;"&gt;passwd {username} {new password}&lt;/pre&gt;&lt;br /&gt;It might better to lock a account rather than change password if you need to re-activate again. By following command a user account can be lock easily: &lt;br /&gt;&lt;pre class="brush: js; toolbar: false;"&gt;passwd {username} -l&lt;/pre&gt;&lt;br /&gt;If you will ever need to re-enable the account just unlock using following command:&lt;br /&gt;&lt;pre class="brush: js; toolbar: false;"&gt;passwd {username} -u&lt;/pre&gt;&lt;br /&gt;If you don't need to keep the account anymore then use following command to delete a user permanently.&lt;br /&gt;&lt;pre class="brush: js; toolbar: false;"&gt;userdel {username}&lt;/pre&gt;&lt;br /&gt;The above operation will keep his home directory, mails, etc.&amp;nbsp; Use following command to delete all his files on the system.&lt;br /&gt;&lt;pre class="brush: js; toolbar: false;"&gt;userdel -r {username}&lt;/pre&gt;&lt;br /&gt;&lt;div style="color: #e69138;"&gt;&lt;i&gt;Be careful to do that, your mistake may destroy all files of the server&lt;/i&gt;.&lt;/div&gt;&lt;br /&gt;Note: User still will be able to connect using ssh via key-based auth on changing the user password or locking. If this is used, then the user’s authorized_keys must me moved to a different location.&lt;br /&gt;&lt;br /&gt; &lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1770001802890288716-3782510218435721325?l=www.morshed-alam.com' alt='' /&gt;&lt;/div&gt;</description><link>http://www.morshed-alam.com/2011/09/disable-user-account-in-linux.html</link><author>noreply@blogger.com (Morshed Alam)</author><thr:total>0</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-1770001802890288716.post-5747288424985027596</guid><pubDate>Mon, 26 Sep 2011 06:54:00 +0000</pubDate><atom:updated>2011-12-30T01:49:48.776+06:00</atom:updated><category domain='http://www.blogger.com/atom/ns#'>Facebook</category><category domain='http://www.blogger.com/atom/ns#'>Resources</category><title>How to resize Facebook UI dialog</title><description>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;Once, I had to re-size the facebook UI dialog while working on friends invitation widget for greenarrow.com The widget was loaded under a popup which was wrapped up by an iframe as well.   In this case it was not showing properly, the widget was not accommodate in that popup. That's why had to re-size the widget.  I did that by following way.. &lt;br /&gt;&lt;pre class="brush: js; toolbar: false;"&gt;var old_size = FB.UIServer.Methods["apprequests"].size;&lt;br /&gt;FB.UIServer.Methods["apprequests"].size = {&lt;br /&gt; width:320,&lt;br /&gt; height:430&lt;br /&gt;};&lt;br /&gt;FB.ui({&lt;br /&gt; method: 'apprequests',&lt;br /&gt; message: 'A nice customizable first page application, visit - http://www.greearrow.com'&lt;br /&gt;}, function() { });&lt;br /&gt;FB.UIServer.Methods["apprequests"].size = old_size;&lt;br /&gt;&lt;/pre&gt;I have stored the old size first and then assign the size which i was needed. After that re-assign the old size again so that it does not broke my another UI dialog. Because in other case i have used default size.&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1770001802890288716-5747288424985027596?l=www.morshed-alam.com' alt='' /&gt;&lt;/div&gt;</description><link>http://www.morshed-alam.com/2011/09/how-to-resize-facebook-ui-dialog.html</link><author>noreply@blogger.com (Morshed Alam)</author><thr:total>0</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-1770001802890288716.post-9219056432278520636</guid><pubDate>Sat, 24 Sep 2011 03:27:00 +0000</pubDate><atom:updated>2011-09-29T12:12:55.535+06:00</atom:updated><category domain='http://www.blogger.com/atom/ns#'>Ruby on Rails</category><title>Ruby interpreter has stopped working</title><description>From last couple of days, I was facing a problem with my ruby interpreter. It was crashing continuously after few page requests and getting message: &lt;br /&gt;&lt;br /&gt;&lt;i&gt;Ruby interpreter (CUI) 1.9.2p180 [i386-mingw32] has stopped working&lt;/i&gt;&lt;br /&gt;&lt;br /&gt;I have tried to find out the reason and frequency to stopped but couldn't find the actual reason. After googling got a suggestion about css media link. But it does not solved the problem as well.&lt;br /&gt;&lt;br /&gt;Finally, I have identified that it happens for missing file. The ruby interpreter was crashed after two request for me if the file missing exists, it may differ for others. &lt;br /&gt;&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1770001802890288716-9219056432278520636?l=www.morshed-alam.com' alt='' /&gt;&lt;/div&gt;</description><link>http://www.morshed-alam.com/2011/09/ruby-interpreter-has-stopped-working.html</link><author>noreply@blogger.com (Morshed Alam)</author><thr:total>0</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-1770001802890288716.post-6921817504089879012</guid><pubDate>Tue, 26 Jul 2011 14:22:00 +0000</pubDate><atom:updated>2011-12-30T01:53:31.136+06:00</atom:updated><category domain='http://www.blogger.com/atom/ns#'>MySql</category><category domain='http://www.blogger.com/atom/ns#'>Ruby on Rails</category><title>Install mysql2 gem on Windows 7</title><description>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;Last couple of days ago, I was stuck to install mysql2 gem on windows7 for rails3 and tried lots of instructions by googling. Unfortunately, those were not worked for me.&lt;br /&gt;&lt;br /&gt;Finally, I have specified a older version of mysql2 during installation which worked for me. Following are the steps which i did:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Install Mysql 5.5&lt;/li&gt;&lt;li&gt;Open command prompt and run following command &lt;pre class="brush: js; toolbar: true;"&gt;gem install mysql2 --version=0.2.6 --platform=ruby -- '--with-mysql-include="C:\Program Files\MySQL\MySQL Server 5.5\include" --with-mysql-lib="C:\Program Files\MySQL\MySQL Server 5.5\lib"'&lt;/pre&gt;&lt;/li&gt;&lt;li&gt; Copy &lt;span style="font-weight: bold;"&gt;libmysql.dll&lt;/span&gt; from &lt;span style="font-style: italic;"&gt;C:\Program Files\MySQL\MySQL Server 5.5\lib&lt;/span&gt;  to &lt;span style="font-style: italic;"&gt;[Ruby Installation Directory]\bin\&lt;/span&gt;&lt;/li&gt;&lt;li&gt;Specify mysql2 version to you gem file&lt;/li&gt;&lt;li&gt;Run bundle install&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1770001802890288716-6921817504089879012?l=www.morshed-alam.com' alt='' /&gt;&lt;/div&gt;</description><link>http://www.morshed-alam.com/2011/07/mysql2-gem-on-windows-7.html</link><author>noreply@blogger.com (Morshed Alam)</author><thr:total>0</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-1770001802890288716.post-8479622843454151834</guid><pubDate>Thu, 24 Feb 2011 16:34:00 +0000</pubDate><atom:updated>2011-12-30T01:57:29.860+06:00</atom:updated><category domain='http://www.blogger.com/atom/ns#'>log</category><category domain='http://www.blogger.com/atom/ns#'>Ruby on Rails</category><title>How to disable logging in Rails application</title><description>It's not a good practice to do though depends on your needs. It can be done by two ways, one is to disable for whole application and another is to disable for specific environments. You're probably looking for some or all of the following settings: &lt;pre class="brush: js; toolbar: true;"&gt;config.logger&lt;br /&gt;config.active_record.logger&lt;br /&gt;config.action_controller.logger&lt;br /&gt;config.action_view.logger&lt;br /&gt;config.action_mailer.logger&lt;br /&gt;config.active_resource.logger&lt;br /&gt;&lt;/pre&gt; If you set any of them to &lt;b&gt;nil&lt;/b&gt; like following way: &lt;pre class="brush: js; toolbar: true;"&gt;config.active_record.logger = nil&lt;/pre&gt; It should disable logging for that specific component. You can experiment with these to disable logging for specific components or set all of them to nil to get no logging. &lt;br /&gt;&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1770001802890288716-8479622843454151834?l=www.morshed-alam.com' alt='' /&gt;&lt;/div&gt;</description><link>http://www.morshed-alam.com/2011/02/how-to-disable-logging-in-rails.html</link><author>noreply@blogger.com (Morshed Alam)</author><thr:total>0</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-1770001802890288716.post-835914007074892273</guid><pubDate>Mon, 14 Feb 2011 11:00:00 +0000</pubDate><atom:updated>2011-12-30T02:00:43.331+06:00</atom:updated><category domain='http://www.blogger.com/atom/ns#'>Ruby on Rails</category><category domain='http://www.blogger.com/atom/ns#'>Resources</category><title>How to use mutliple ruby version on windows</title><description>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;I have found a nice ruby version manager for windows named pik. It's pretty easy to install and manage multiple ruby versions. &lt;br /&gt;&lt;br /&gt;First install the pik gem:&lt;br /&gt;&lt;pre class="brush: js; toolbar: true;"&gt;gem install pik&lt;/pre&gt;&lt;br /&gt;After installing the pik, you have to use pik_install script to install the pik executable. You must install pik in a different directory other than your ruby\bin directory. &lt;br /&gt;&lt;pre class="brush: js; toolbar: true;"&gt;pik_install C:\Windows\System32&lt;/pre&gt;&lt;br /&gt;If the installation gone smooth, you should see like ..&lt;br /&gt;&lt;pre class="brush: js; toolbar: true;"&gt;pik is installed&lt;br /&gt;&lt;br /&gt;if you want to use pik with git bash, add the following line to your ~/.bashrc:&lt;br /&gt;&lt;br /&gt;  [[ -s $USERPROFILE/.pik/.pikrc ]] &amp;amp;&amp;amp; source $USERPROFILE/.pik/.pikrc&lt;/pre&gt;&lt;br /&gt;Now you can see the list of available ruby versions by using following commands:&lt;br /&gt;&lt;pre class="brush: js; toolbar: true;"&gt;pik list&lt;/pre&gt;&lt;br /&gt;Add, you can install a ruby version and add to version manager using below command:&lt;br /&gt;&lt;pre class="brush: js; toolbar: true;"&gt;pik add C:\Ruby192\bin&lt;/pre&gt;&lt;br /&gt;To switch the ruby version use command:&lt;br /&gt;&lt;pre class="brush: js; toolbar: true;"&gt;pik switch [Version Name]&lt;/pre&gt;&lt;br /&gt;That's all to use multiple version of ruby on windows machine.&lt;br /&gt;&lt;br /&gt;&lt;a href="https://github.com/vertiginous/pik"&gt;Click here to know more about pik&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1770001802890288716-835914007074892273?l=www.morshed-alam.com' alt='' /&gt;&lt;/div&gt;</description><link>http://www.morshed-alam.com/2011/02/how-to-use-mutliple-ruby-version-on.html</link><author>noreply@blogger.com (Morshed Alam)</author><thr:total>0</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-1770001802890288716.post-4880357537368034581</guid><pubDate>Mon, 31 Jan 2011 10:01:00 +0000</pubDate><atom:updated>2011-12-30T01:59:06.826+06:00</atom:updated><category domain='http://www.blogger.com/atom/ns#'>Error</category><category domain='http://www.blogger.com/atom/ns#'>Git</category><category domain='http://www.blogger.com/atom/ns#'>Ruby on Rails</category><title>LF will be replaced by CRLF</title><description>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;I was getting following message while trying to add files to GIT index:&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Warning: LF will be replaced by CRLF ....&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;By google search I found that - whenever tried to add files to the repository, git thinks that, the file is a text file and all files automatically will have their LF line endings converted to CRLF endings. &lt;br /&gt;&lt;br /&gt;It's an important warning for a binary file because git incorrectly assesses a binary file to be a text file but it's OK for text file.&lt;br /&gt;&lt;br /&gt;The line-ending conversion can be prevent by setting false of core.autocrlf attribute. By default it remains true.&lt;br /&gt;&lt;br /&gt;The command is as follows(in Bash mode):&lt;br /&gt;&lt;pre class="brush: js; toolbar: true; highlight: [1];"&gt;git config core.autocrlf false&lt;/pre&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1770001802890288716-4880357537368034581?l=www.morshed-alam.com' alt='' /&gt;&lt;/div&gt;</description><link>http://www.morshed-alam.com/2011/01/lf-will-be-replaced-by-crlf.html</link><author>noreply@blogger.com (Morshed Alam)</author><thr:total>0</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-1770001802890288716.post-8022263935772058394</guid><pubDate>Sat, 22 Jan 2011 06:43:00 +0000</pubDate><atom:updated>2011-12-30T01:55:23.071+06:00</atom:updated><category domain='http://www.blogger.com/atom/ns#'>Error</category><category domain='http://www.blogger.com/atom/ns#'>Ruby on Rails</category><title>Unpacked gem has no specification file</title><description>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;I started working on a new rails project and in every time from command line operation getting this type of irritating message:&lt;br /&gt;&lt;br /&gt;config.gem: Unpacked gem ..... in vendor/gems has no specification file. Run 'rake gems:refresh_specs' to fix this.&lt;br /&gt;&lt;br /&gt;I run rake gems:refresh_specs but the problem isn't fixed. Moreover, tried by creating specification file as well.&lt;br /&gt;&lt;br /&gt;After that, removed the irritating message by a single line of code to place in the environment file:&lt;br /&gt;&lt;br /&gt;&lt;pre class="brush: js; toolbar: true; highlight: [4];"&gt;# Bootstrap the Rails environment, frameworks, and default configuration&lt;br /&gt;require File.join(File.dirname(__FILE__), 'boot')&lt;br /&gt;&lt;br /&gt;Rails::VendorGemSourceIndex.silence_spec_warnings = true&lt;br /&gt;&lt;br /&gt;Rails::Initializer.run do |config|&lt;/pre&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1770001802890288716-8022263935772058394?l=www.morshed-alam.com' alt='' /&gt;&lt;/div&gt;</description><link>http://www.morshed-alam.com/2011/01/unpacked-gem-has-no-specification-file.html</link><author>noreply@blogger.com (Morshed Alam)</author><thr:total>0</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-1770001802890288716.post-1043553292392728233</guid><pubDate>Thu, 20 Jan 2011 05:55:00 +0000</pubDate><atom:updated>2011-12-30T01:55:30.668+06:00</atom:updated><category domain='http://www.blogger.com/atom/ns#'>Error</category><category domain='http://www.blogger.com/atom/ns#'>Ruby on Rails</category><title>’rails’ is not recognized as an internal or external command, operable program or batch file</title><description>You might experience the problem due to the following reasons: &lt;br /&gt;&lt;ul&gt;&lt;li&gt;You haven’t installed Rails&lt;/li&gt;&lt;li&gt;Rails path cannot be found&lt;/li&gt;&lt;li&gt;Installed Rails using a ‘special’ installer&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;To resolve the issue, uninstall rails installation from your PC and try a normal installation through command prompt by using following command: &lt;pre class="brush: js; toolbar: true;"&gt;gem install rails –include-dependencies&lt;/pre&gt;&lt;br /&gt;&lt;i&gt;Note: Be sure, you are connected with internet&lt;/i&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1770001802890288716-1043553292392728233?l=www.morshed-alam.com' alt='' /&gt;&lt;/div&gt;</description><link>http://www.morshed-alam.com/2011/01/rails-is-not-recognized-as-internal-or.html</link><author>noreply@blogger.com (Morshed Alam)</author><thr:total>0</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-1770001802890288716.post-5939583825218661166</guid><pubDate>Tue, 18 Jan 2011 11:34:00 +0000</pubDate><atom:updated>2011-12-30T01:55:41.365+06:00</atom:updated><category domain='http://www.blogger.com/atom/ns#'>MySql</category><title>Remote mysql backups on windows</title><description>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;In our day to day job needs to backup remote mysql database and sometimes may needs to synchronize with another one.&lt;br /&gt;&lt;br /&gt;It can be done by using following code snippet, no matter the remote server is windows or Linux.&lt;br /&gt;&lt;br /&gt;Save the following code snippet as a batch(.bat) file and setup a task scheduler.&lt;br /&gt;&lt;br /&gt;&lt;pre class="brush: js; toolbar: true;"&gt;set DATET=%date:~-4%_%date:~7,2%&lt;br /&gt;"your mysql bin directory\mysqldump" --host="remote-host" --user="remote-database-user" --password="remote database password" remote-database-name &amp;gt; "backup-directory"backup_%DATET%_csv.sql&lt;br /&gt;"your mysql bin directory\mysql" -uuser -ppassword -t csv &amp;lt; "backup-directory"backup_%DATET%_csv.sql&lt;/pre&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1770001802890288716-5939583825218661166?l=www.morshed-alam.com' alt='' /&gt;&lt;/div&gt;</description><link>http://www.morshed-alam.com/2011/01/remote-mysql-backups-on-windows.html</link><author>noreply@blogger.com (Morshed Alam)</author><thr:total>0</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-1770001802890288716.post-8277624025164455757</guid><pubDate>Tue, 11 Jan 2011 05:32:00 +0000</pubDate><atom:updated>2011-10-19T12:27:23.447+06:00</atom:updated><category domain='http://www.blogger.com/atom/ns#'>Error</category><category domain='http://www.blogger.com/atom/ns#'>Ruby on Rails</category><title>‘nmake’ is not recognized as an internal or external command, operable program or batch file</title><description>I have experienced the problem due to the version difference of rubygems installed on my developer PC with gems.  &lt;br /&gt;&lt;br /&gt;I have downgraded the rubygems, to choose the right versions and solved the problem. After completing the installations, updated all of my gems which did not generate any errors. &lt;br /&gt;&lt;br /&gt;If you still experience the problem then try the link below to resolve the problem: &lt;ul&gt;&lt;li&gt;&lt;a href="http://www.question-defense.com/2009/03/27/nmake-is-not-recognized-as-an-internal-or-external-command-operable-program-or-batch-file"&gt;‘nmake’ is not recognized as an internal or external command, operable program or batch file&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1770001802890288716-8277624025164455757?l=www.morshed-alam.com' alt='' /&gt;&lt;/div&gt;</description><link>http://www.morshed-alam.com/2011/01/nmake-is-not-recognized-as-internal-or.html</link><author>noreply@blogger.com (Morshed Alam)</author><thr:total>0</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-1770001802890288716.post-2983708791797834400</guid><pubDate>Tue, 12 Oct 2010 12:45:00 +0000</pubDate><atom:updated>2011-12-30T23:50:56.330+06:00</atom:updated><category domain='http://www.blogger.com/atom/ns#'>MySql</category><title>Mysql backup on linux using ssh and cron</title><description>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;Sometimes, we may need to backup and synchronize mysql on linux as a background process. Linux has a great program for this called cron. It allows tasks to be automatically run in the background at regular intervals.&lt;br /&gt;&lt;br /&gt;Create a script file(.sh) using following code snippet to backup and restore database in to another database:&lt;br /&gt;&lt;pre class="brush: js; toolbar: true;"&gt;ssh user@remote-host "mysqldump -u my-remote-db-username --password=my-remote-db-password my-remote-db-name" | mysql -udb-username --password=db-password --host=host-name -C db-name&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Open a terminal and run:&lt;br /&gt;&lt;code&gt;sudo crontab -l&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;To edit the list of cronjobs you can run following code which will open default editor to let us the crontab:&lt;br /&gt;&lt;code&gt;sudo crontab -e&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;You can configure your script in to crontab by following code:&lt;br /&gt;&lt;pre class="brush: js; toolbar: true;"&gt;* * * * * /bin/execute/this/script.sh&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;The above five stars represent different date parts in the following order:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;minute (from 0 to 59)&lt;/li&gt;&lt;li&gt;hour (from 0 to 23)&lt;/li&gt;&lt;li&gt;day of month (from 1 to 31)&lt;/li&gt;&lt;li&gt;month (from 1 to 12)&lt;/li&gt;&lt;li&gt;day of week (from 0 to 6) (0=Sunday)&lt;/li&gt;&lt;/ol&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1770001802890288716-2983708791797834400?l=www.morshed-alam.com' alt='' /&gt;&lt;/div&gt;</description><link>http://www.morshed-alam.com/2010/10/mysql-backup-on-linux-using-ssh-and.html</link><author>noreply@blogger.com (Morshed Alam)</author><thr:total>0</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-1770001802890288716.post-8389587593899201624</guid><pubDate>Tue, 22 Jun 2010 17:35:00 +0000</pubDate><atom:updated>2011-12-30T23:50:21.700+06:00</atom:updated><category domain='http://www.blogger.com/atom/ns#'>.htaccess</category><title>How to do custom redirection of a website</title><description>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;Usually the redirection needs when a website changed/move to different location though it may use for lots of other purposes. In this post, I have explain how you can do it by using .htaccess&lt;br /&gt;&lt;br /&gt;Say, your site has lots of URL and you want to redirect some of those which query string has a parameter name “option” and the value is “redirect”. &lt;br /&gt;&lt;br /&gt;Below are the codes to redirect into new URL:&lt;br /&gt;&lt;pre class="brush: js; toolbar: true;"&gt;RewriteEngine on&lt;br /&gt;RewriteCond %{QUERY_STRING} option=redirect&lt;br /&gt;RewriteRule (.*) http://newsite.com/index.php?%{QUERY_STRING} [R=301,L]&lt;/pre&gt;&lt;br /&gt;Just copy above lines into .htaccess file and place it to root directory in your application.&lt;br /&gt;&lt;br /&gt;Some helpful posts:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;a href="http://morshed-alam.blogspot.com/2009/05/htaccess-tips-and-tricks.html"&gt;Most useful htaccess tips and tricks&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://morshed-alam.blogspot.com/2010/06/hide-fact-that-web-pages-are-written-in.html"&gt;Hide the fact that web pages are written in PHP&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://morshed-alam.blogspot.com/2010/06/change-file-extension-in-url.html"&gt;Change file extension in the URL&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1770001802890288716-8389587593899201624?l=www.morshed-alam.com' alt='' /&gt;&lt;/div&gt;</description><link>http://www.morshed-alam.com/2010/06/how-to-do-custom-redirection-of-website_22.html</link><author>noreply@blogger.com (Morshed Alam)</author><thr:total>2</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-1770001802890288716.post-1852426690064095377</guid><pubDate>Sun, 20 Jun 2010 17:04:00 +0000</pubDate><atom:updated>2011-12-30T23:49:51.019+06:00</atom:updated><category domain='http://www.blogger.com/atom/ns#'>.htaccess</category><title>Change file extension in URL</title><description>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;In my previous article I have shown how you can use different extension of a file instead of .php explicitly but in this post I have explain how to rewrite the URL instead of renaming the file extension explicitly.&lt;br /&gt;&lt;br /&gt;To rewrite the URL you must add following lines in a .htaccess file and place it to root directory of your application.&lt;br /&gt;&lt;pre class="brush: js; toolbar: true;"&gt;Options +FollowSymlinks&lt;br /&gt;RewriteEngine on&lt;br /&gt;RewriteRule ^(.*)\.htm$ $1.php [nc]&lt;/pre&gt;&lt;br /&gt;The above code will rewrite the product.php to product.html. &lt;br /&gt;&lt;br /&gt;And following is the code to pass parameters with URL&lt;br /&gt;&lt;pre class="brush: js; toolbar: true;"&gt;Options +FollowSymlinks&lt;br /&gt;RewriteEngine on&lt;br /&gt;RewriteRule ^(.*)\.html(.*)$ $1.php$2&lt;/pre&gt;&lt;br /&gt;Some related posts:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;a href="http://morshed-alam.blogspot.com/2009/05/htaccess-tips-and-tricks.html"&gt;Most useful htaccess tips and tricks&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://morshed-alam.blogspot.com/2010/06/hide-fact-that-web-pages-are-written-in.html"&gt;Hide the fact that web pages are written in PHP&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1770001802890288716-1852426690064095377?l=www.morshed-alam.com' alt='' /&gt;&lt;/div&gt;</description><link>http://www.morshed-alam.com/2010/06/change-file-extension-in-url.html</link><author>noreply@blogger.com (Morshed Alam)</author><thr:total>1</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-1770001802890288716.post-7052827498994242257</guid><pubDate>Sat, 19 Jun 2010 19:52:00 +0000</pubDate><atom:updated>2011-12-30T23:49:20.266+06:00</atom:updated><category domain='http://www.blogger.com/atom/ns#'>PHP</category><category domain='http://www.blogger.com/atom/ns#'>.htaccess</category><title>Hide the fact that web pages are written in PHP</title><description>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;Sometimes you may want to hide the fact of your web site’s written language to visitors then you can do it easily by using .htaccess Say, you have developed your site by using PHP and wanted to show it as ASP then you can do it by using following tricks:&lt;br /&gt;&lt;br /&gt;Just add following line in the .htaccess file and place it to application root directory.&lt;br /&gt;&lt;pre class="brush: js; toolbar: true;"&gt;AddType application/x-httpd-php .asp&lt;/pre&gt;Now everyone have to use all files of the application by using .asp though the application was written in PHP.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1770001802890288716-7052827498994242257?l=www.morshed-alam.com' alt='' /&gt;&lt;/div&gt;</description><link>http://www.morshed-alam.com/2010/06/hide-fact-that-web-pages-are-written-in.html</link><author>noreply@blogger.com (Morshed Alam)</author><thr:total>3</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-1770001802890288716.post-8055738313794316613</guid><pubDate>Sun, 21 Mar 2010 16:56:00 +0000</pubDate><atom:updated>2011-12-30T02:02:23.398+06:00</atom:updated><category domain='http://www.blogger.com/atom/ns#'>MySql</category><category domain='http://www.blogger.com/atom/ns#'>Error</category><category domain='http://www.blogger.com/atom/ns#'>Ruby on Rails</category><title>The bundled mysql.rb driver has been removed from Rails 2.2</title><description>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;After two months, I have started working on rails again and upgraded Rails to 2.3.2 on my laptop.  After upgraded when I have tried to run a sample rails application and got following errors:&lt;br /&gt;&lt;pre class="brush: js; toolbar: true;"&gt;&lt;br /&gt;=&amp;gt; Booting WEBrick&lt;br /&gt;=&amp;gt; Rails 2.3.2 application starting on http://0.0.0.0:3000&lt;br /&gt;!!! The bundled mysql.rb driver has been removed from Rails 2.2. Please install the mysql gem and try again: gem install mysql.&lt;br /&gt;=&amp;gt; Call with -d to detach&lt;br /&gt;[2010-03-21 04:39:09] INFO  WEBrick 1.3.1&lt;br /&gt;[2010-03-21 04:39:09] INFO  ruby 1.8.6 (2007-09-24) [i386-mswin32]&lt;br /&gt;[2010-03-21 04:39:09] INFO  WEBrick::HTTPServer#start: pid=5032 port=3000&lt;br /&gt;=&amp;gt; Ctrl-C to shutdown server&lt;/pre&gt;After getting the above error I have installed newer version of mysql gem but problem was not solved. Then just copy the MySQL dll from &lt;span style="font-weight: bold;"&gt;mysql/bin/libmysql.dll&lt;/span&gt; to &lt;span style="font-weight: bold;"&gt;ruby/bin/libmysql.dll&lt;/span&gt;. And it worked perfectly.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1770001802890288716-8055738313794316613?l=www.morshed-alam.com' alt='' /&gt;&lt;/div&gt;</description><link>http://www.morshed-alam.com/2010/03/bundled-mysqlrb-driver-has-been-removed.html</link><author>noreply@blogger.com (Morshed Alam)</author><thr:total>1</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-1770001802890288716.post-6417331240262428875</guid><pubDate>Mon, 15 Feb 2010 18:19:00 +0000</pubDate><atom:updated>2011-12-30T02:03:03.615+06:00</atom:updated><category domain='http://www.blogger.com/atom/ns#'>Html</category><title>Specify rendering engine of IE</title><description>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;Internet Explorer 8 supports different document compatibility to ensure that your web pages have a consistent appearance in future versions.&lt;br /&gt;&lt;br /&gt;If you are having trouble on a site in different IE, you can use specific rendering mode to display your web pages by using simple META tag. Below is the META tag to use IE7 rending in IE8:&lt;br /&gt;&lt;pre class="brush: js; toolbar: true;"&gt;&lt;br /&gt;&amp;lt;meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" /&amp;gt;&lt;/pre&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/cc288325%28VS.85%29.aspx" target="_blank"&gt;Details of defining rendering engine in IE&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Related link:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;a href="http://morshed-alam.blogspot.com/2009/05/htaccess-tips-and-tricks.html" target="_blank"&gt;Most useful htaccess tips and tricks&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1770001802890288716-6417331240262428875?l=www.morshed-alam.com' alt='' /&gt;&lt;/div&gt;</description><link>http://www.morshed-alam.com/2010/02/specify-rendering-engine-of-ie.html</link><author>noreply@blogger.com (Morshed Alam)</author><thr:total>0</thr:total></item></channel></rss>
