Friday, August 17, 2012

openindiana zfs nfs share root


sharectl set -p nfsmapid_domain=your.domain nfs

zfs create rpool/nfsshare

zfs set sharenfs=rw,root=client.your.domain  rpool/nfsshare

sharectl get nfs



sharectl set -p nfsmapid_domain=your.domain

mount -F nfs -overs=4,rw server.your.domain:/mnt/nfsshare /mnt/nfs



if I use the IP address it doesn't work (?)

nfs mount: mount: /mnt/nfs: Permission denied
touch: cannot create /mnt/nfs/aaa: Permission denied

Tuesday, August 14, 2012

MDM^T02 with embedded PDF HL7 message sample

OBX|1|HD|113014^DICOM Study^DCM||1.2.840.317.5947431.51||||||O

The Single_Line_base64_encoded_PDF, must be a base64 encoded PDF string, in a single line, i.e. the result of this linux command

base64 -w 0 document.pdf

Monday, August 13, 2012

Openindiana: Too many authentication failures

From an Openindiana host, and connecting to some Linux hosts, often I receive this error from the ssh client

Received disconnect from 2: Too many authentication failures for yourfuckingusername

The fact is that ssh try to first authenticate using keys, and if you have many keys he tries every one of them, so... maybe the server or the Openindiana (I've never seen this problem on Mac OS X, in example) ssh command exit after two or three failed keys authentication.

The solution is to use PubkeyAuthentication options in the ssh command

ssh -oPubkeyAuthentication=no

Or to edit ~/.ssh/conf file


Can't load log handler *.FileHandler

Starting Tomcat (installed from binary, on a CentOS 5.5 server), I was getting an error like this in ''catalina.out''

Can't load log handler ""

This was because I set ''JAVA_OPTS'' at the end of the startup script '''', overwriting all the default ''JAVA_OPTS''...

So the solution is (obviously):

JAVA_OPTS="blablabla $JAVA_OPTS"

Install additional fonts (like Arial) in Openoffice

Download webfonts form

Unpack it

Open each desired font file (like arial32.exe) with Archive Manager and extract font files to a temp directory.

Select all desired TTF files and open them with Font viewer.

In the bottom right of the application window, click on "Install Font"

Files will be copied under ~/.fonts/ directory.

Then, use Openoffice "Printer Administration" to add new fonts.
Files will be placed under ~/

Cycling date in bash

Maybe you want to cycle a time frame from a day to another, taking in consideration how many days a month have (also for leap years). Here is how you can do in bash.

Date format is: YYYYMMDD



while [ "$b" -le "$e" ]
   echo $b
   b=$(date +%Y%m%d -d "$b +1 day")

Execute it

./ 20090101 20090301



It works on Linux, and using gdate (from opencsw, blastwave) on Solaris. On Mac OS X it doesn't work.

How to install Apache Tomcat Native library on CentOS 5.5

If you see this in your tomcat log

INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path:

Do so:

yum install apr-devel

Download package from

cd tomcat-native-1.1.20-src/jni/native/

You must have java installed (I use sun-java). Since you are using tomcat, it is already installed, isn't it?

./configure --with-apr=/usr/bin/apr-1-config

In any case you will get (I don't know, I've not investigated)

configure: error: can't locate a valid JDK location


./configure --with-apr=/usr/bin/apr-1-config --with-java-home=/usr/java/jdk1.6.0_24


su -

make install

At this point you must inform tomcat where this library is located

We can add
to JAVA_OPTS in the script

or add
export LD_LIBRARY_PATH="/usr/local/apr/lib"
at the begginning of the same script

Friday, August 10, 2012

JAVA cache at System Level

It could be useful to avoid that each user, on a multiuser operating system, have own java cache under his home directory, i.e. a corporate application used by each user. Every time the jnlpi is upgraded, every user have to download the new version in his home directory cache.

Using system level cache, only the first user launching the jnlpi will download the java application in the cache.

vi /usr/java/jre/lib/deployment.config

deployment.system.config file:/etc/java/

vi /etc/java/
deployment.system.cachedir /var/tmp/java/wscache /var/tmp/java/security/trusted.certs

mkdir /var/tmp/java
mkdir /var/tmp/java/wscache

Warning. There will be problems with write and read permission on such directory...