Archive for June, 2009
Vonage charges: what your 24.99 deal will actually cost you
Talking about hidden charges, telephone companies are one of the most notorious. It is not entirely their fault since a lot of the add on charges are imposed by governenment etc. Vonage is not different. I just signed up and here is what my advertized 24.99 bill looks like:
|
Charges Detail: |
||||||||||||||||||||
|
Pillars of Ayurvedic Treatment
Listening to Baba Ramdev‘s program on Zee TV.. heard these 4 pillars of Ayurvedic treatment:
- Ayurved
- Acupressure
- Balanced lifestyle: food that restrains intake of milk, ghee/butter, oil and sugar/sweets.
- Yoga
mysql user management idiosyncracies
Ok, we are all used to adding new user in mysql with following command:
GRANT ALL ON [db].* TO [user].’%’ IDENTIFIED BY ‘[PASS]‘
So, what happens when you added user before creating the said database. Well, as I found out, mysql won’t complain. Oh well, so what happens if you create the database for the user after the fact. No, it won’t back fix the privileges.
So, I had to delete and recreate the user. Having not done this before, I just tried:
DROP USER [user]
and it worked! The only caveat here is if you added the original user for a particular host, you have to specify host when deleting, like this:
DROP User [user]@’[host]‘
Re-creating the user fixed the problem.
Enjoy!
Twittering my blogs using twitter-tools
Now that I have been using twitter regularly to post my random thoughts, I also wanted to hook it upto my blog so my new blogs get twitted automatically. As I realize there are tons of plugins for this for my wordpress blogging engine. Without any deeper feature comparision, I went with twitter-tools. I guess this is the most common twitter plugin for wordpress. It was as easy as to install and setup as it can be and seems to have most of the things I can think of. And yes, this is my first blog after that.
Happy blog twittering!
Hosts file on Windows Vista
Getting hosts file (for DNS resolution) to work on Windows vista could be aggravating because of all the security and access control that it has in place. In my case, I couldn’t get it to honor the entries in my hosts file. Commonly proposed solutions modifying UAC, and flushing DNS cache didn’t work for me.
Today I found this. stopping/restarting dns cache service worked. Not sure how this is different from flushing-dns but it worked for me.
> net stop dnscache
> net start dnscache
Stick with ERB or move to Haml
Haml is gaining popularity in Rails community. It claims higher productivity compared to defacto ERB templating. Not everybody agrees though. I see 2 short-term problem with haml.
- ERB is similar to it pre-decessor and hence easier to learn. Compared to JSP etc. ERB is similar, you still see lots of HTML tag with interleaved ruby (or Java). Although verbose, it is closer to how your HTML would finally look like.
- If your team has a dedicated HTML programmer (Designer as we may call them). These folks are very good at plain HTML and don’t want the trouble of converting files and having all the plumbing around when working. It is not efficient for them.
Despite this, I see Haml as valid alternative for following reasons:
Rails Following Core development
If you are a passionate ruby/rails developer, you ought to be following the discussion at rubyonrails-core. Why? because the discussion (like this) that goes on about how to fix current deficiencies are really really exciting. It not only explains what the creators of the framework had in mind when designing bits and pieces and why and why not something should be changed. Whether or not something gets accepted into the framework, it does reveal the full-truth behind the correct usability of a feature.
Great stuff. Enjoy!
Passenger, Apache, Ruby configuration
Installing passenger to work with apache for rails application is especially pleasant since it gives you direction to setup apache passenger module properly. I have done it several times and it has always worked. Recently I had to change the version of ruby that passenger uses and all I had to do is change the PassengerRuby directive in httpd.conf (or apache.conf) as follows:
#LoadModule passenger_module /opt/ruby-enterprise-1.8.6-20090421/lib/ruby/gems/1.8/gems/passenger-2.2.2/ext/apache2/mod_passenger.so
#PassengerRoot /opt/ruby-enterprise-1.8.6-20090421/lib/ruby/gems/1.8/gems/passenger-2.2.2
#PassengerRuby /opt/ruby-enterprise-1.8.6-20090421/bin/ruby
LoadModule passenger_module /opt/ruby/lib/ruby/gems/1.8/gems/passenger-2.1.2/ext/apache2/mod_passenger.so
PassengerRoot /opt/ruby/lib/ruby/gems/1.8/gems/passenger-2.1.2
PassengerRuby /opt/ruby/bin/ruby
I am not sure if this is the recommended way but it worked for me.
Enjoy!
Redirecting from http to https
Quick Info:
<VirtualHost *:80>
...
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}
</IfModule>
</VirtualHost>
Enjoy
Rails Constants: Location matters
Rails framework provides a standard location for defining application specific constants. All default constants go in constant/environment.rb and any environment specific overrides go in config/environments/<env>.rb file. Normally, any constant that is overridden in environment specific file takes precedence. However, there is a catch. If a constant is defined outside of Rails::Initializer.run block then it overrides all other definition preceding it.
Hence, when defining constants in default config/environment.rb file, beware:
require File.join(File.dirname(__FILE__), 'boot') Rails::Initializer.run do |config| A_CONSTANT = "value" end # Do not define environment specific constants here.
Enjoy!