Wednesday, January 1, 2014

IR_Black Theme in IDLE Shell

I prefer to use the IDLE Shell for interactive Python programming.  I do not, however, particularly like the default themes.  I created a theme based on the somewhat popular IR_Black theme.  Here is how I set up IDLE:

  • In ~/.idlerc/config-main.cfg I added the following:

[Theme]
default = 0
name = IR_Black

  • In ~/.idlerc I created a file named config-highlight.cfg.  In that file I added the following:
[IR_Black]
break-foreground = #E0E2E4
builtin-foreground = #95cbf9
comment-foreground = #66747B
console-foreground = #E0E2E4
cursor-foreground = #E0E2E4
definition-foreground = #95cbf9
error-foreground = #fc6863
hilite-foreground = #E0E2E4
hit-foreground = #E0E2E4
keyword-foreground = #93C763
normal-foreground = #E0E2E4
stderr-foreground = #fc6863
stdout-foreground = #95cbf9
string-foreground = #fda368
break-background = #242424
builtin-background = #242424
comment-background = #242424
console-background = #242424
definition-background = #242424
error-background = #242424
hilite-background = #36397e
hit-background = #7f397b
keyword-background = #242424
normal-background = #242424
stderr-background = #242424
stdout-background = #242424
string-background = #242424

Enjoy!

Accessing HBase using Thrift/Python

Install Thrift (and it's Dependencies)

To access HBase via Python you must first download, compile, and install Apache Thrift.  As of the time of this writing, the Apache Thrift website does not offer pre-compiled binaries for OS X.  The process for downloading, compiling and installing Thrift is documented on the Thrift web site.  However, I have recorded my steps below incase someone is interested in following them.

Download and install libevent
  1. Download libevent (here is the link for 2.0.12, which is the version I used)
  2. Untar libevent
  3. Compile libevent by executing the following three commands
./configure --prefix=/usr/local 
make
sudo make install

Download and install Boost
  1. Download Boost (here is the link for 1.54, which is the version I used)
  2. Untar Boost
  3. Compile Boost by executing the following two commands
./bootstrap.sh
sudo ./b2 threading=multi address-model=64 variant=release stage install

Note:  I received numerous warnings and errors but ignored them.

Download and install Thrift
  1. Download Thrift (here is the link for 0.9.1, which is the version I used)
  2. Untar Thrift
  3. Compile Thrift by exeucting the following command
./configure --prefix=/usr/local/ --with-boost=/usr/local --with-libevent=/usr/local