Monday Oct 12, 2009

Blurb BookSmart software on OpenSolaris

I would like to create my first photo book. After short investigation I decided to give a chance to Blurb. But wait, their BookSmart software is just for Macintosh and Windows. Short Internet search revels that it's actually Java application and that some Linux guys were successful to run it. So, why I should not run it on OpenSolaris?

Following is the procedure to install and run Blurb BookSmart software on OpenSolaris and other similar systems with Java (tested with BookSmart version 2.5.0). It is based on Ubuntu documentation.

1. Download BookSmart version for Macintosh from Blurb web pages.
(After download I had it in following location ~/Downloads/BookSmart_2.5.0.dmg)

2. As OpenSolaris cannot handle DMG images, we need to install just another Java application which can do it - HFSExplorer.

mkdir ~/hfsexplorer
cd ~/hfsexplorer

3. Now we will extract software into ~/BookSmart directory.

mkdir ~/BookSmart
./ -o ~/BookSmart -fsroot ~/Downloads/BookSmart_2.5.0.dmg

4. There is also need for script which will start the application.

cat > ~/BookSmart/ << EOF

cd ~/BookSmart

# Build classpath with all jars in the lib directory
for jar in lib/\*.jar

java -Xincgc -ea -Xms256m -Xmx1024m -classpath \\$classpath com.blurb.booksmart.application.BookSmart

exit \\$?
chmod a+x ~/BookSmart/

5. From now and on Blurb BookSmart application can be started using new run script.


Monday Jun 01, 2009

Network Auto Magic and Profiles

One of the wifi networks I connect to with my OpenSolaris 2009.06 laptop provides wrong list of DNS servers. In order to get properly working Internet I need after connecting change content of /etc/resolv.conf. But you don't want to do such thing manually every time you connect.

At this situation I learned in nwadm(1) info about Profiles which perfectly solved my problem.

First I had to prepare script which will determine whether I have just connected to my problematic wifi (used BSSID is just an example):

$ cat /etc/nwam/ulp/check-conditions
dladm show-wifi -o BSSID | grep 0:1:2:3:4:5 > /dev/null && echo bad-dns-wifi

Then I had to create "bringup" script for new "bad-dns-wifi" profile which will modify resolv.conf file. Again, IPs are just an exmple:

$ cat /etc/nwam/ulp/bad-dns-wifi/bringup
echo "nameserver\\nnameserver" > /etc/resolv.conf

Note: These interfaces can change in future as it's stated in above mentioned man page.

Wednesday Jan 21, 2009

Tomcat 6 in OpenSolaris

In OpenSolaris build 106 there were some important changes to bundled version of Tomcat:
- Tomcat was upgraded to version 6.0.18
- Tomcat was moved under SMF(5) control
- SMF executes Tomcat with "webservd" user credentials
- Tomcat started via SMF service can be configured to use privileged TCP ports (< 1024)
- Tomcat is now installed in different locations /usr/tomcat6 and /var/tomcat6
- New symbolical link /etc/tomcat6 to configuration directory /var/tomcat6/conf
- New man page tomcat(1M)

Starting Tomcat SMF service

Tomcat is shipped with default configuration file (/etc/tomcat6/server.xml) so it can be immediately started via:

# svcadm enable tomcat6

Status of Tomcat SMF service can be queried as follows:

# svcs tomcat6
online 4:41:46 svc:/network/http:tomcat6

And finally Tomcat is stopped:

# svcadm disable tomcat6

Configuring Tomcat to listen on port 80

With default configuration Tomcat listens on TCP port 8080. You may need to change it to standard HTTP port 80 (and 443).

The port number is defined in /etc/tomcat6/server.xml as following:

Connector port="8080" protocol="HTTP/1.1"

This is especially nice if you want to use Tomcat alone without Apache Web Server.

Tomcat and HTTPS

Tomcat is using Java Secure Socket Extension (JSSE) for SSL HTTP implementation. Following are steps based on Tomcat ssl-howto which shows how to enable it:

Certificate key store creation:

# /usr/java/bin/keytool -genkey -alias tomcat -keyalg RSA -keystore /etc/tomcat6/keystore

Server configuration (/etc/tomcat6/server.xml) then need uncomment following section and to add in it "keystoreFile" and "keystorePass" attributes:

<Connector port="8443" protocol="HTTP/1.1" SSLEnabled="true"
maxThreads="150" scheme="https" secure="true"
keystoreFile="/etc/tomcat6/keystore" keystorePass="changeit"
clientAuth="false" sslProtocol="TLS" />

Running Tomcat as ordinary user

Even if OpenSolaris bundled Tomcat is primary meant to be controlled via SMF service and to be run with "webservd" user credentials, also other users can still use it.

For such a reasons there is CATALINA_BASE environment variable which specifies part of Tomcat directory structure which must be per Tomcat instance unique, contains server configuration and which is writable. Therefore user will first need to create such data. The easiest way is to copy it:

$ cp -r /var/tomcat6/ ~/tomcat

User can then start Tomcat as follows:

$ CATALINA_BASE=~/tomcat /usr/tomcat6/bin/ start

And of course to stop it:

$ CATALINA_BASE=~/tomcat /usr/tomcat6/bin/ stop

Monday Apr 21, 2008

Let's check out Wine on OpenSolaris

Last Friday Wine community released Wine 0.9.60. As Wine 1.0 is approaching (see schedule) it would be nice to make some love to Wine on Solaris and check out how is Wine doing comparing to Linux (main Wine development platform).

For compilation you need to have i386 box and recent Solaris (I used Nevada build 83). And then do just usual stuff:

CFLAGS=-std=gnu99 ./configure --prefix=/opt/wine
gmake install


- you need to have /usr/sfw/bin in your PATH (because of gcc)
- above CFLAGS are needed as workaround for #12008

Sunday Jan 20, 2008

My favorite Windows photo application running now on OpenSolaris via Wine

There are only few things which prevent me to remove Windows from my laptop and use OpenSolaris exclusively on it. One of them is good application for photo managing and processing.

I use Zoner Photo Studio (ZPS) which is application for people like me. While I do like taking picture I'm not willing to do any complicated post processing in GIMP for just fixing red eyes or bad horizon. This kind of application lets me to do this and many more similar tasks within few intuitive clicks. Problem is that it's Windows application. So up till now I had to chose whether I want to work or manage/view my pictures. Changing between these tasks would eventually mean to reboot from one operating system to another.

And here cones Wine which is Open Source implementation of the Windows API for Unix systems. So, Why not to run ZPS using Wine? Wine was historically primary develped for Linux systems and few years ago when I tried to compile it for Solaris it wasn't possible. But now it compiles!


Solaris Nevada (build 78)
Wine 0.9.52
Zoner Photo Studio 10 (build 7)

One rather minor compilation problem I had with Wine is described in following mail thread on OpenSolaris-discuss:

Screen shot

Zoner Photo Studio is really running under OpenSolaris. Note that it's Czech version of ZPS.


Stability and usability

While screen shot of ZPS running on OpenSolaris looks very nice there are still some problems. The main problem I see is stability where whole application tends to crash because of X protocol errors [e.g: BadAccess (attempt to access private resource denied)]. There are also other rather minor problems like not receiving events from file system and thus not refreshing content of current directory.


Speed is very positive surprise for me. While some content redrawing after window resize is rather slow all others seems to be fast. If I say fast I mean really fast and probably faster then any comparable native application I have ever seen on Solaris.

To support this I have created kind of benchmark test. It was based on comparison of duration for JPEG file resizing using ZPS and graphical application bundled with Solaris. For test I used a directory with set of high resolution JPEG files (46 files with resolution up to 3456x2304 and total size of all about 146MB).

As native Solaris application I used convert command which comes with ImageMagick software suit. I tried to set comparable JPEG parameters as much as I was able. Finally there was still some difference because resulted files from ImageMagick were about 16% bigger then files from ZPS.

Following command was used to measure ImageMagick:

time find ZONER_SPEED/B/\*.JPG -exec convert {} -sampling-factor 2x1 -quality 98 -resize 1280x853 {} \\;

For ZPS I set equivalent parameters however time measurement had to be done manually (as for GUI application time command was useless).

Results were following:

ImageMagick 2m41.5s
Zoner Photo Studio 0m54s

It means that ZPS was almost three time faster!

Why is that? Probably ZPS code is more optimized (especially JPEG DLL used in ZPS against JPEG library in Solaris)?

ZPS speed test

Specific support for running under Wine

Interesting is also possibility to switch ZPS to special mode where it won't use some specific Windows resources (in this case Internet Explorer). This is done via creation of specific file in program directory (more info on this can be found on Zoner Wiki in Czech).




« April 2014