Installing rpy and rpy2 on RHEL6

I wanted to install rpy and rpy2 on Red Hat Enterprise Linux 6. Here's how I did it. There have been several fixes in the rpy SVN repository that have not shown up in the version downloadable from SourceForge. Hopefully that's been fixed by now, but here's how I installed it by retrieving rpy directly from the repository.

First I made sure that the python-devel package was installed to avoid the error src/RPy.h:63:20: error: Python.h: No such file or directory:

yum install python-devel

Then I installed R and R-devel from EPEL:

rpm -Uvh http://download.fedora.redhat.com/pub/epel/6/x86_64/epel-release-6-5.noarch.rpm
yum install R R-devel

Then I downloaded rpy and extracted it:

curl http://rpy.svn.sourceforge.net/viewvc/rpy/trunk/rpy/?view=tar > rpy.tar.gz
tar xvzf rpy.tar.gz
cd rpy
python setup.py install

Lo and behold, it imports without error:

python -c "import rpy"

Yay!

Besides R and R-devel, rpy2 requires that the readline-devel package be installed, otherwise installation fails with ./rpy/rinterface/_rinterface.c:79:31: error: readline/readline.h: No such file or directory.

yum install readline-devel

After that, rpy2 installs easily:

curl http://pypi.python.org/packages/source/r/rpy2/rpy2-2.2.0.tar.gz#md5=a42a7f1e6ddb10dc3a1886c2f4309fab > rpy2-2.2.0.tar.gz
tar xvzf rpy2-2.2.0.tar.gz
cd rpy2-2.2.0
python setup.py install

[ Submitted by John on Wed, 2011-06-08 14:38. | | ]

Custom Reporting for CrashPlan PRO using Python and the REST API

CrashPlan PRO has some nice reports but sometimes you just want to dump raw data so you can do your own thing with it.

Here's an example of how to use the CrashPlan PRO REST API to dump out tab-delimited columns of data. Output looks like this:

Computer User GB Email OS IP Server Last Connect
optiplex745 Doe, Jane 25 jane@example.com Windows 7 6.1 1.2.3.4:0 1 2011-01-18T09:29:27.332-06:00
optiplex760 Doe, John 20 john@example.com Windows XP 5.1 1.2.3.5 1 2011-01-18T06:19:27.257-06:00
macbookpro Doe, Jenny 81 jenny@example.com Mac OS X 10.6.6 1.2.3.6:0 1 2011-01-18T09:25:18.946-06:00

The script is attached below as a text file. To run it just use python scriptname at the command line on the CrashPlan server. It's just a modification of one of the examples at the CrashPlan API Architecture page. You can do much more with the API than this lowly querying and reporting.

I'm running on OS X 10.5.8 (we use old Macs for CrashPlan servers since it takes very little CPU) and I had to install Python 2.7.x using the PPC installer; the stock Python in 10.5 is ancient.

[ Submitted by John on Tue, 2011-01-18 11:26. | | ]