Jun 19, 2012

Configuration for using post-review command on Mac

The memo for using post-review command on Mac

#easy_install -U RBTools
#brew update
#brew install svn  // It would stop on "make" step like following message. Don't worry about it. You just run it again. It will be installed.


==> Installing subversion
==> Downloading http://www.apache.org/dyn/closer.cgi?path=subversion/subversion-1.7.5.tar.bz2
==> Best Mirror http://ftp.meisei-u.ac.jp/mirror/apache/dist/subversion/subversion-1.7.5.tar.bz2
######################################################################## 100.0%
==> ./configure --disable-debug --prefix=/usr/local/Cellar/subversion/1.7.5 --with-ssl --with-zlib=/usr --with-sqlite=/usr/local --disable-neon-version-check --disable-mod-activation --withou
==> make

But you may have some problem yet. Because your built in svn(/usr/bin/svn) is prior to installed svn(/usr/local/bin/svn). You can change your path by using this command.

export PATH=new_path //copy your original path and exchange /usr/bin and /usr/local/bin

 or

Use /usr/local/bin/svn propset reviewboard:url http://reviewboard.example.com .

And make .reviewboardrc file in your check out directory.
#vim .reviewboardrc
REPOSITORY = "http://localhost/svn/myproject/trunk/"
REVIEWBOARD_URL = "http://localhost/reviewboard"

Finally you can use post-review for review board!
#post-review  // in your work directory = check out and modified directory.

reference:
http://www.reviewboard.org/docs/manual/dev/users/tools/post-review/

Warning:
If you use svn1.7.x, post-review command is unable on Review Board 1.6.9.
http://code.google.com/p/reviewboard/issues/detail?id=2359




Jun 18, 2012

Installing ReviewBoard on Ubuntu

I'm following this URL
http://www.reviewboard.org/docs/manual/dev/admin/installation/linux/

#sudo apt-get update
#sudo apt-get upgrade  //It takes time
#sudo apt-get install sqlite3
#sudo apt-get install apache2 libapache2-mod-wsgi
#sudo apt-get install python-setuptools
#sudo apt-get install python-dev

#sudo apt-get install memcached
#sudo easy_install python-memcached
#sudo apt-get install patch
#sudo easy_install ReviewBoard //If you failed here, please use pip. You may see this error message "error: Setup script exited with error: command 'gcc' failed with exit
status 1"
#sudo easy_install pip
#sudo pip install ReviewBoard
#sudo easy_install RbTools  //Don't forget this!!!

If you forget the last command, you will see "Review Board is taking a nap" message.


Install ldap modules
#sudo apt-get install libldap2-dev libsasl2-dev

#sudo easy_install python-ldap


Now you are ready to create Review Board site. Come on just run command. Choose options to fit your environment.


# rb-site install /var/www/rb


Finally we're the last step.



# sudo chown www-data -R /var/www/reviewboard/
# cp /var/www/reviewboard/conf/apache-wsgi.conf /etc/apache2/sites-enabled/000-default

Trouble with mysql-python gcc failed

I'm installing Reviewboard. I followed installing on Linux(Cent OS 5.4). I don't have any problem except the following command.

easy_install mysql-python


/usr/include/python2.4/pyconfig.h:6 から include されたファイル中,
                 /usr/include/python2.4/Python.h:8 から,
                 pymemcompat.h:10 から,
                 _mysql.c:29 から:
/usr/include/python2.4/pyconfig-64.h:648:1: 警告: ここが以前の宣言がある位置です

Googling gave me the answer about this.http://blog.eflow.org/archives/54
Actually the writer couldn't fix this problem but Olivier Biot has the answer.
Thx Olivier! The answer is here.

yum install MySQL-python

It works perfectly.

Jun 12, 2012

Mac keyboard symbol

I've just started MacBook Air a month ago. Yes I'm a newbie. So sometime I'm confused what this symbol( like ⎋) means when I started IntelliJ Idea. Here is the list of mac keyboard symbol. I hope it to help you.


  • ⎋ esc
  • ⇧ shift
  • ⌥ alt option
  • ⌘ command
  • ⌃ control
  • ⌫ delete

Jun 6, 2012

How to scan/fetch all of keys in Voldemort

I'm supposed to provide a list that shows all of data in Voldemort. At first, I look around voldemort.client.StroreClient class. It has #getAll() method but this method has a parameter that is collections of key. Now I want to know all of keys!

Next step, I searched "getAll", "scan" and "fetch" that heats what I want. I found voldemort.client.protocol.admin.AdminClient#fetchKeys(). But it fetches all keys on a particular node. As you know I want all of keys in Voldemort cluster. Let me do coding little bit.

Here is my code. Forgive me for my dirty code. I just wrote this in an instant.
 


    private List getAllKeys() {
        String bootstrapUrl = "tcp://localhost:6666";
        StoreClientFactory factory = new SocketStoreClientFactory(new ClientConfig().setBootstrapUrls(bootstrapUrl));
        AdminClient adminClient = new AdminClient(bootstrapUrl, new AdminClientConfig());

        Collection nodes = adminClient.getAdminClientCluster().getNodes();
        List list = new ArrayList();
        int count = 0;
        for (Node node : nodes) {
            if (!factory.getFailureDetector().isAvailable(node))
            {
                System.out.println("Oops Node " + node.getId() + " is unavailable");
                continue;
            }
            List partitionIds = node.getPartitionIds();
            Iterator iter = adminClient.fetchKeys(node.getId(), "tabe_name", partitionIds, null, true);
            while (iter.hasNext()) {
                String key = new String(iter.next().get());
                list.add(key);
                count++;
                System.out.println("Node id:" + node.getId() + " key: " + key);
            }
        }

        System.out.println(count);
        return list;
    }