Archive for October, 2008

undefined method `init_gettext’ for ApplicationController:Class

In : ruby, Posted by on Oct.10, 2008

I just updated to rails 2.1.2 and see this error:

undefined method `init_gettext’ for ApplicationController:Class

To resolve it.

  1. make sure you have the latest gettext gems.
  2. if it does not help, try add this to the first line of your app/controllers/application.rb
    • require ‘gettext/rails’
Tags :


mysql output csv file

In : mysql, Posted by on Oct.10, 2008

Here is the code to output result to csv file.

SELECT order_id,product_name,qty
FROM orders
INTO OUTFILE '/tmp/orders.csv'
FIELDS TERMINATED BY ','
ENCLOSED BY '"'
LINES TERMINATED BY '\n'

Tags :


sendmail 451 Name server timeout

In : linux, system, Posted by on Oct.10, 2008

This is something related to sendmail IPv6 support.

  1. cd /etc/mail
  2. sendmail.mc and add the following at the end of the file:
  3. define(`confBIND_OPTS’, `WorkAroundBrokenAAAA’)dnl
  4. type make
  5. restart sendmail
Tags :


hadoop hbase ec2 installation

In : system, Posted by on Oct.10, 2008

Here is the steps by steps hbase ec2 installation.

  1. start elasticfox
    1. create a “keypairs”
    2. on your “security groups” default group, add port 50000-51000 (for hadoop) and port 60000-61000 (for hbase)
    3. search for hbase AMI (ami-4de30724)
    4. launch the install with the newly create keypair and default group permission
  2. on you desktop linux/window machine do: ssh -i <keypair.pem> root@<your new instance IP>
    1. replace the <keypair.pem> with the newly create keypairs pem file
    2. replace <your new instance IP> to your newly create instance IP address
  3. step 2  will login your ec2 machine. Then do the following:
    1. type: ssh-keygen -t dsa -P ” -f ~/.ssh/id_dsa
    2. type: cat ~/.ssh/id_dsa.pub >> ~/.ssh/authorized_keys
    3. type: ssh localhost
    4. If it does not ask you for the password, you are okay.
    5. type: exit
    6. vi /usr/local/hadoop-0.17.1/conf/hadoop-site.xml
      1. replace: <value>hdfs://:50001</value>  to <value>hdfs://INSTANCE IP ADDRESS:50001</value>
      2. replace: <value>:50002</value> to <value>INSTANCE IP ADDRESS:50002</value>
    7. type: /usr/local/hadoop-0.17.1/bin/hadoop dfs namenode -format
    8. type: /usr/local/hadoop-0.17.1/bin/start-all.sh
    9. check /mnt/hadoop/logs/hadoop-root-namenode-<….>.log and make sure that your hadoop is starting correctly.
    10. vi /usr/local/hbase-0.2.0/conf/hbase-site.xml
    11. replace:  <value>:60000</value> to  <value>INSTANCE IP ADDRESS:60000</value>
    12. replace:  <value>hdfs://:50001/hbase</value> to <value>hdfs://INSTANCE IP ADDRESS:50001/hbase</value>
    13. type: /usr/local/hbase-0.2.0/bin/start-hbase.sh
    14. check /mnt/hbase/logs/* to make sure your hbase is start correctly.
  4. if everything is okay, you can point your browser to: http://INSTANCE IP ADDRESS:60010/ and see the hbase information.
Tags : , ,