Posts

ProxyPass issue

I was trying to ProxyPass the app to another server But ran into a strange problem. ProxyPass worked when I called http://10.0.11.95 but failed when any uri was added to root(10.0.11.95) Like http://10.0.11.95/login gave Proxy Error The proxy server received an invalid response from an upstream server. The proxy server could not handle the request GET /login. Reason: DNS lookup failure for: 127.0.0.1:9051login Where we find the problem is: Code for ProxyPass: ProxyPass               / http://10.0.11.95 ProxyPassReverse        / http://10.0.11.95 Solution, I needed another slash at the final, so, it should be: Code: ProxyPass               / http://10.0.11.95/ ProxyPassReverse        / http://10.0.11.95/ Now it works \m/ .

rails migration like filename in linux

 Creating files with date like rails migrations with datetime in file name in linux

Modulo operation in Ruby

Today I was stumped by a very simple yet awesome problem by my friend Sandip What is the answer of   :  7 % -2  and to the surprise ruby irb printed it as :  -1  After some research I what I found about this and why here is explanation and links From Ruby Programming Language, O,really   Division, Modulo, and Negative Numbers When one (but not both) of the operands is negative, Ruby performs the integer division and modulo operations differently than languages like C, C++, and Java do (but the same as the languages Python and Tcl). Consider the quotient -7/3. The floating-point result is –2.33. The result of integer division must be an integer, however, so this number must be rounded. Ruby rounds toward negative infinity and returns –3. C and related languages round toward zero instead and return –2. (This is just one way to characterize the results; no floating-point division is actually done, of course.) An important corollary of...

Intalling and using rvm

Image
I have been using ruby from a while and like every other I find  rvm as a awesome tool to manage various ruby version in one system. Optional: You many need to install all libs not all but many of these will be need but its better to get installed in the system This is a very small explanation for rvm but I feel this is very enough to get kick started and enjoy coding ..... More help:  http://cheat.errtheblog.com/s/rvm/ https://rvm.io/rvm/   http://net.tutsplus.com/tutorials/why-you-should-use-rvm/

Italic font rendering issue in Ubuntu 11 04

In Ubuntu 11.04 I had to install ttf-dejavu-extra fonts for rendering italic fonts properly $ sudo apt-get install ttf-dejavu-extra This helped me find the solution -  http://support.mozilla.org/en-US/questions/886261 After installing it is now rendering italic characters properly :)

Rails 3 with aws s3

Send emails with Amazon SES in Rails 3 I have been using aws-ses gem quite successfully in Production env. In your Gemfile add: create an initializer in config/initializers Configure ActionMailer   Set delivery mehtod to amazon ses in environment.rb or in a specific environment as needed eg. config/environments/production.rb  

Very good post to understand basic regex Expressations

Image
http://net.tutsplus.com/tutorials/other/8-regular-expressions-you-should-know/ Here is a wonderful post to understand how regex can be used for most basic matches and valiadations in general. This can help better understanding for making more complex use In computing, regular expressions provide a concise and flexible means for identifying strings of text of interest, such as particular characters, words, or patterns of characters.