Monday, September 19, 2011

davfs2 and filenames with spaces

One of the tricks in using Alfresco, Apache, Gallery, or Knowledgetree
is mounting their webdav access as part of the Linux file system. One
of the problems with Alfresco is that, by default, it has a space in
its filename path (i.e., "User Homes"). There are two ways around
this:

1) Write a proxy in Apache. Covered elsewhere and is a lot of extra work.

2) Delimit the space(s) in the path. After experimenting with percent
codes and leading the space(s) with a backslash (which didn't work), I
consulted the man page for fstab (yeah, I know...). The proper way to
indicate spaces in paths in fstab is to convert them to "40" so that

http://192.168.2.177:8080/alfresco/webdav/User Homes/tim

ends up looking like

http://192.168.2.177:8080/alfresco/webdav/User40Homes/tim

There appears to be one drawback to using Alfresco's WebDAV interface: Alfresco needs to be started before attempting to mount WebDAV.  Since it takes a few minutes for Alfresco to start, mounting WebDAV can't be part of the boot sequence.

Sunday, September 18, 2011

VaBch Hamfest 2011

The Virginia Beach Hamfest was held at the Convention Center yesterday
(17 Sep 2011). The weather was absolutely dismal, in the 60, rainy
and very windy. This caused the "outdoor vendors" section to be
closed. A number of local clubs and orgs had tables. 757labs did
not, due to mechanical failure.

Only a handful of vendors participated. However, I did managed to
spend the cash that I'd been saving for months. Got what I needed (a
new battery for my Icom W32a) and what I wanted (TNC-X), so I now have
everything needed for a mobile packet radio rig. Notes later.

Spent the remainder of the day at 757labs. Crashed the How to Solder
class. Apparently there's no end of expert-how-to-solder videos on
YouTube, made by non-expert solderers. The class was quite
entertaining.

Thursday, September 15, 2011

Something is not right (in the API)

This is a test email for posting through a long string of APIs. About
six months ago, my connection between Posterous and Identica. This
morning, it was suggested that I attempt to authorized the connection
again.

It appears that the API for Posterous is a bit wonky because, when I
use "http://identi.ca/api" for the link, the authorization fails.
However, if I leave the link blank, it defaults to the same URL and
authorizes the connection.

WTF?

Tuesday, September 6, 2011

Coherence and Gallery3

Spent a few days playing with DLNA and WebDAV services. Ended up focusing on Gallery3 and Coherence. Wrote a start-up script for Coherence and developed a work-around to get Coherence to work with Gallery3.

Coherence

Wrote a start-up script for Coherence, based on the skeleton script found in /etc/init. Not too many changes were required:

 1) I moved /root/.coherence to /etc/coherence/coherence.conf
 
 2) Edited the startup script so that:

 DESC="Coherence UPnP service"
 NAME=coherence
 DAEMON=/usr/bin/$NAME
 DAEMON_ARGS=" -c /etc/coherence/coherence.conf"
 
 3) I then added "-b" to the start-stop-daemon lines in "do_start" and  removed "--pidfile $PIDFILE" from all lines in do_start() and  do_stop().

The addition of "-b" causes start-stop-daemon to move coherence to the background, once it's started. Without, Coherence never releases control back to the system (you'd continuously see the output of Coherence and the boot sequence would never reach the login prompt). (Hint: hit Control-C if you manage to do this.)

Removal of "--pidfile $PIDFILE" is more of a personal choice. If you want to continue to use PIDs, leave "--pidfile $PIDFILE" in and add "-m" to the line. "-m" forces the start-up script to create a PID for Coherence because Coherence isn't written to return a PID to the start-up script. This works fine as long as you never run the start-up script while the service is already running. If you do this, a new PID is created that has nothing to do with the currently running service (i.e., you won't be able to stop Coherence with "service coherence stop").

Removing "--pidfile $PIDFILE" forces the script to act more like the "kill" function, where the start-up script looks for functions with the same name as itself and "kill -15"s the process. It's less elegant, but Coherence doesn't have a shutdown function so the two methods are more or less equivalent.

In any case, my version of the start-up script is here.

Coherence and Gallery3

Coherence has a few modules, one of which allows you to show Gallery2-hosted graphics on your UPnP-enabled media player. Notice that I've said "Gallery2". Apparently, it plays nicely with Coherence. Unfortunately, some time in the past, I decided to be "cutting edge", installed Gallery3, and uploaded close to 500 pictures into it.

The problem with Gallery3 is that it's still in development and only recently acquired the Gallery_Remote module which allows Gallery2 to work with Coherence. I spent a few hours experimenting with Gallery_Remote, trying to get it to function. It appears to be very version specific and won't work with my build of Gallery3. At this point, I went looking for work-arounds.

My work-around idea involved setting up WebDAV so that Coherence and using davfs2 to trick Coherence into believing that it was serving files from a local dircectoy. A quick search of Gallery3 modules revealed that it did have a WebDAV module (one based on SabreDAV). I was somewhat successful in getting it to run but, for some reason, it refuses to serve up the first folder of pictures in the directory (works well with all others). Finding this unsuccessful, I removed the module.

My next approach was to use the DAV module that's built into Apache2. This turned out to be the proper approach. I used Adam Shand's notes in configuring Apache2. The only thing that Adam doesn't mention is that you need to run a2enmod for dav, dav_fs, and dav_lock. My version of the Apache2 configuration is here.  Drop it in /etc/apache2/conf.d and restart Apache.

After that, mounting the WebDAV folder is quite easy. It is the same approach that I employed to get Knowledgetree to work as file storage for the in-house wiki. You only have to add a line to /etc/davfs2/secrets (e.g., "http://192.168.2.144/gallery-dav tim pAsSwOrD") and a line to /etc/fstab (e.g., "http://192.168.2.144/gallery-dav /var/www/gallerydav davfs rw,user,auto 0 0"). See the man page for davfs2 for more details.

After all of that work, I now have a media server which can supposedly speak to my wife's TV and my son's PS3. It's configured to serve up: music via Ampache, family photos via Gallery3, movie trailers from Apple iTunes, and streams from various Shoutcast stations. Keeping the service will probably be based on my wife's and son's reactions as the interface is a bit to rigid for my use (I prefer more flexibie solutions like Savonet).

Monday, September 5, 2011

An identity crisis?

Suffered a bit of an identity crisis this past weekend. (Note: Sparks, I blame you!! You too, Jim!)

It started by my going to the SouthEast LinuxFest (AKA SELF), this past June. Jim and Charmaine Brady, owners of Morning Dew Coffee Roasters, were there, giving away free samples of caffeine (good tasting ones!). They were also selling various coffee-themed cups and t-shirts. I managed to buy one of their t-shirts before they ran out. It has "sudo make coffee" printed on the front, over a steaming cup of coffee. On the back is a flow chart for making coffee.

In any case, I was wearing the t-shirt during the weekly run to Walmart, thinking nothing of it. Should have known that it'd draw a comment, my "Evilution" having previously triggered comments by an offended manager. As I started to unload my cart onto the conveyor, the young cashier commented that she "got" the "sudo" joke. The older lady in line ahead of me quipped, "You should see the back of his shirt. It's the algorithm for making coffee." While the cashier was processing my choices, she went on about how she like Linux and how she's not been able to convince her husband to abandon Win7.

The short version of the story is that I'm worried that I've ceased being cutting edge and have faded into "mainstream". What are the odds of three random geeks being in the same checkout line? Could it be that Linux is more popular that currently assumed? In any case, I was unnerved enough that I spent the remainder of the weekend building Xen kernels and bridging various XMPP services together.