dl

David Lundgren

Web Developer & Systems Administrator

gallery 2.2.1 with gnome 2.16.2

This is a re-post from my MySpace blog.

UPDATE 1: While I haven’t tested it this bug appears to be fixed as of 2007-06-11.

UPDATE 2: SourceForge uses better urls now. Not sure when this was changed.

I thought I would download the new Gallery 2.2.1 and use webDav. They need better setup instructions. Basically do the following and you will get webDav working:

  1. Activate the webDav module in the Site Admin;
  2. Acitvate the URL rewriting plugin.

It should be working, if not there are other issues, these solved mine.

The other problem was Gnome 2.16.2 PUTs an empty file on the server first, and then replaces it with the new image. This caused problems with Gallery2 not creating a thumbnail. Apparently this also happens with OS X’s webDavFS as well, http://sourceforge.net/tracker/index.php?func=detail&aid=1681406&group_id=7130&atid=107130. (SourceForge should make that MUCH more user friendly, or at least search engine friendly). While I submitted it as a comment to the tracker, I’m sure someone will be like “you idiot” I don’t care about them, this should make people happy to use the native webDav that their window manager uses, in my case Gnome.

The diff below solved my problem, despite the fact I have little clue how to make a meaningful diff for others to use. Except now I have a “File” instead of a “photo”, I could care less about the semantics because I have the thumbnails.

--- gallery2.orig/modules/webdav/ItemAddWebDav.inc Sun Apr 8 10:34:41 2007
+++ gallery2/modules/webdav/ItemAddWebDav.inc Sun Apr 8 10:37:04 2007
@@ -109,6 +109,9 @@

$platform->fclose($handle);

+ // double check the mimeType of the file that was uploaded
+ list ($nothing, $mimeType) = GalleryMimeTypeHelper_simple::getMimeType($tmpFile);
+ list ($ret, $mimeExtensions) = GalleryCoreApi::convertMimeToExtensions($mimeType);
if ($mimeType == 'application/octet-stream'
|| $mimeType == 'application/unknown'
@@ -187,6 +190,9 @@
GalleryCoreApi::releaseLocks($lockIds);
return array($ret, null, null);
}
+
+ // double check the mimeType of the file that was uploaded
+ list ($nothing, $mimeType) = GalleryMimeTypeHelper_simple::getMimeType($filePath);

$item->setMimeType($mimeType);

nullfs and sockets

This is a re-post from my MySpace blog.

UPDATE: This was fixed far better than I did it at the time in the stable/9 branch as of 2012-04-24

What happens on FreeBSD 6.x series machines using nullfs and sockets? At least in my current setup it fails.

The scenario is that I am running mysql on the host and apache in a chroot environment. (I don’t have the extra IP’s, and don’t want to deal with NAT to make jails work.) I have the apache chroot nullfs mounted (ro, except for the data apache needs to write and the user directories for php/perl scripts to work). In either rw/ro mode the nullfs does not translate the mysql socket correctly unless it is mounted on the nullfs mount and even then it is sporadic.

After a couple hours of googling, and rummaging through the freebsd-* archives, I ended up with the kern/51583 PR. This PR is from 2003 and fixed the socket/chr/blk devices in the sys/fs/nullfs/null_subr.c in such a manner that allowed sockets to work. Taking the approach that was taken I applied the following to the code in null_subr.c at line 235 (at least for the sources dated at 2006.09.14):

if (lowervp->v_type == VSOCK) vp->v_un = lowervp->v_un;

This allowed the sockets to work but I do not if this is a good idea to institute when using jails as opposed to my problem up above as it might work fine within a jail’d environment but not a chroot’d environment, I haven’t tested with it in either direction. I also have no other knowledge of the nullfs or vnode code. The main difference between the patch submitted in kern/51583 and mine is that mine only affects vnodes with a v_type of VSOCK, where it affected all or did an addalias to VCHR, and VBLK.

subversion and stunnel

This is a re-post from my MySpace blog.

After a couple of days of trying I finally figured out how to use stunnel with subversion. Then after I managed to figure it out I decided I would check the mailing lists and the bug tracker. someone already managed to do the same thing. I however found the solution proposed made more noise than was needed. The openssl s_client on my FreeBSD 6.1 machine still outputs noise about the certificates. After trying openssl, I tried ucspi-ssl and couldn’t get it to work, I finally ended up using sst (and netcat). sst can be found in ports/security/sst, for those on FreeBSD.

Here are the configuration settings that I used. (3691 is reserved by IANA for use by “Magaya something” I forget because I don’t run it).

  1. stunnel.conf
    [svns]
    accept  = 3691
    connect = 3690
  2. ~/.subversion/config in the [tunnels] section
    Either you can override the ssh = or create another scheme such as I did (accessed via svn+ssl://)
    [tunnel]
    ssl = /path/to/home/bin/svnssl
  3. svnssl (new file, remember to chmod to 700 or 755)
    • with openssl
      #!/bin/sh
      /path/to/openssl s_client -quiet -port 3691 -host $1
    • with sst (needs netcat as well)
      NOTE: the timeout option (-t) must be set otherwise sst will keep the connection alive forever, 30 seconds should be more than enough.
      #!/bin/sh
      /path/to/sst -p 3691 -t 30 -- nc $1 3691

Flash 9 upgrade

This is a re-post from my MySpace blog.

If you want a better web surfing experience turn flash OFF. It sounds crazy but since I’ve converted my laptop from WindowsXP Pro to FreeBSD (6.1) and I’ve refused to install linux compatibility on my laptop, I have not had flash available at all. It does make browsing certain websites (SciFi, Fox, etc…) impossible to use (HINT to those sites, MAKE a HTML only website).

I don’t find myself to be in a bad position, most flash content is annoying as hell and I have had it blocked from loading for awhile anyhow. When it came to audio/video flash here on myspace, I have blocked several websites because I don’t care for hearing audio, or seeing videos in myspace profiles. Not only do I not care for hearing it, it INTERFERES with music I am playing, and since browsers haven’t learned how to control their own volume I ain’t dealing with it.

I’ll stick with FreeBSD and my lack of initiative to get flash working on it for as long as possible. Hell I still haven’t gotten my Java VM working on FreeBSD yet, although I do have a native java built and installed.