Archive for the ‘Tech Notes’ Category.

setting JAVA_HOME

The instructions at http://www.cyberciti.biz/faq/linux-unix-set-java_home-path-variable/ are slightly out of date or incorrect. Instead of setting

export JAVA_HOME=/usr/lib/jvm/java-6-sun-1.6.0.22/bin/java # do NOT do this

as you might expect from their instructions, you should

export JAVA_HOME=/usr/lib/jvm/java-6-sun-1.6.0.22/

rpm complaint about NSS/NSPR headers really looking for sechash.h…

Needed to build a recent version of RPM from source. When running ./configure for rpm-4.8.1, I ran into the ‘configure: error: missing required NSPR / NSS header’ error referenced at

http://lists.rpm.org/pipermail/rpm-list/2009-May/000253.html

The solution there is good but incomplete, a peek into the configure file reveals that they are really checking for ’sechash.h’ which is in the nss-devel package. After doing a

yum install nss-devel
as well as
yum install nspr-devel

then I can successfully run

./configure CPPFLAGS=”-I/usr/include/nspr4 -I/usr/include/nss3″

(well, almost successfully…now I am on to the next error message about a Berkeley Db directory not present…if that seems tricky as well will post a solution here, if straightforward I won’t bother…)

Drupal 6 semantic support

Drupal 6 generally is a solid version, notwithstanding the INSTALL.txt issue. It has good RDF support as well, including the ability to add and manipulate arbitrary triples using the RDF module. The Relations API module provides an easy user interface to add SeeAlso relations to nodes, but not to include nodes in arbitrary triples.

From the README.txt that comes with the Relations API: ” Currently supports bidirectional node relationships based on the rdfs:seeAlso predicate. This could in the future fairly easily be extended to include support for user-defined predicates and for unidirectional relationships.” – so this was part of the possible future plans, at least.

Since most of the RDF work appears now to be focusing on Drupal 7, I’m hoping that arbitrary relations make it in there. What I would really like to see is the use of the taxonomy terms vocabulary that the RDF module auto-generates used as the predicate set – that would essentially reach the “en:anyword” goal mentioned below, and in a widely used CMS! Perhaps this will be possible by extending the Relations API. For now, using it in standard form at a teaching tips site, http://bteaching.com

Do NOT follow the instructions in Drupal 6 INSTALL.txt …

So, I am ping-ponging around in my spare-time quest for the best way to quickly add triples to the web on a nice user-friendly content-rich website.

Latest attempt involves Drupal 6 and the Relations API module, as it seems to me that Drupal 7 doesn’t yet have this particular functionality (though I am hoping it will by code freeze!)

Anyway, thus my latest discovery: the installation instructions in the INSTALL.txt packaged with Drupal 6.17 are WRONG. They tell you to make a copy of default.settings.php to settings.php before you visit the new site the first time and choose your language. This will result in annoying error messages like so: “Warning: Table ‘mydb.access’ doesn’t exist query: SELECT 1 FROM access WHERE type = ‘host’ AND …”.

Luckily the solution is documented here:
http://drupal.org/node/464982

but would it be too much to ask to correct the INSTALL.txt file for us old-fashioned text-doc-reading types?

Cubicweb notes

So, although the RDF support in Drupal7 is really encouraging, I wanted to experiment with a pure semweb app that might make it cleaner and quicker to add relations between things. Trying out Cubicweb, here are some notes:

My main server runs Fedora, which is supported but doesn’t have a packaged install. Going down the path of least resistance, I spun up a cheap Debian Lenny server at Rackspace.com and installed the nice debian packages following the instructions at http://www.cubicweb.org/doc/en/admin/setup.html. All went well until I hit the ‘Next’ link and got to the page Creation of your first instance. Oops! I haven’t installed a cube yet, and here it says “Now that we created a cube…”. Back, forth, nope – didn’t miss a step, must be a wrong link in the docs.

Backed up and found the tutorial with Steps for creating your cube. Continuing…

learning python-isms, such as the fact that classes must start with capital letters…

and YES! It works. http://173.203.29.23:8080/ Its password protected so you can’t see anything public yet, but I love the interface that encourages you to add relations to everything.

sigh. Drupal7 thinks I only have SQLite (solved)

There seems to be a lot of excitement in the Drupal 7 dev groups about support for SQLite. Well and good, but when I try to install Drupal 7 on my Mysql/Apache/PHP5 server, I get “Your PHP configuration only supports the SQLite database type so it has been automatically selected.”. And unfortunately the section search capabilities on drupal.org are not good enough to make a quick existing bug search efficient.

Drupal 6 detects my Mysql server without any problem…

(I was trying to install Drupal 7 for the RDF capabilities, it seems RDFCCK will be part of core in 7. But looks like may have to wait a few months.)

A bit of research determined that Drupal 7 requires the PDO extension to PHP. However, something funky in my Fedora OS setup didn’t let me recompile PHP from scratch, and yum update php wasn’t doing the trick. Finally, after looking at this page

http://www.electrictoolbox.com/update-php-command-line-yum/

I tried just yum installing the extensions, like so:

1010 yum install php-pdo
1011 yum install php-mysql
1012 yum update php
1013 yum install php-gd
1014 yum install php-xml
1015 yum install php-soap

and that worked. Your mileage may vary…

CubicWeb app framework

I like the looks of this – need to see if we can also have cubes that interface with mysql, make fuzzy-rule-based decisions as well as clear inferences. If so, this looks like a fun way to code…

mysqlimport bug coercing long floats

Just ran into an error, using mysqlimport to pull in a tab-delimited file with long float values in BIGINT columns. When trying to import the value

866.897575000000057458

as an int, mysqlimport turned it into 866897575000000057458 – a bit off!

mysqlimport Ver 3.5 Distrib 5.0.45, for redhat-linux-gnu (x86_64)
(maybe this is fixed in 5.1, don’t know)