HomeHome ArchiveArchive

Ruby 1.8.2 Debian Woody Packages

This are backports of Ruby 1.8.2 for Debian woody. They are the build from Akira Yamada’s unstable Debian 1.8.2-2 ruby package. In order to build them I had to use a few backports and apply a few dirty hacks - see the changelog.

Use our packages at your own risk - remember it was a “quick” hack - but please do report back to us us any bugs you’ll find.

Enjoy! Tomas Pospisek

Download

apm and usb-storage

When suspending and resuming my laptop all the processes that were accessing an external USB harddisk would freeze.

The problem seems to lie in the combination between USB and SCSI, which do not seem to be stateless, that means that when the laptop goes silent and alive again the whole USB stack gets mixed up. I don’t know whether the problem lies within the kernel’s drivers or within the USB/SCSI protocols themselves - I’ve tried the 2.4.27 and the 2.6.9 kernels without success.

I’ve also tried umount -a but that won’t help since processes, that access the filesystem will still freeze inside the kernel with state “D” with no way to kill them. IMHO a clean solution would be to have the whole stack supporting suspending and resuming well or, if the USB/SCSI protocolls don’t allow this, modify Linux fs semantics to that unmounting a fileystem which is being accessed (filehandles or cwds) will work and will cause any access to the filesystem to simply fail, thus allowing applications that access the filesystem to fail gently i.e. do something about the failure (this is being discussed here)

Finally I’ve implemented a work-around. What I do now is, instead of suspending directly with apm -s to first try to unmount the external harddisk, remove all usb-storage related modules and suspend only after that. Maybe not everything is needed, maybe there’s a better solution, comments are wellcome.

The script below assumes that your external HD is mounted under /mnt/maxtor and that you are using the usb-ohci, so adapt as needed.

Enjoy! Tomas Pospisek

$ cat /usr/local/bin/remove_maxtor
#!/bin/sh
#
# remove the external USB drive
#
# v0.1 2005-01-20   Tomas Pospisek
#
# released into the public domain
#

unmount () {
  if mount|grep "on $1" >/dev/null; then
    if ! umount $1; then
      return 1
    fi
  fi
  return 0
}

rmmodule () {
  if lsmod|grep "^$1\b" >/dev/null; then
    if ! rmmod $1; then
      return 1
    fi
  fi
  return 0;
}

if 
  unmount /mnt/maxtor && 
  rmmodule sd_mod && 
  rmmodule usb-storage && 
  rmmodule scsi_mod && 
  rmmodule usb-ohci && 
  rmmodule printer && 
  unmount /proc/bus/usb && 
  rmmodule usbcore;
then 
  echo "successfully removed maxtor"
  exit 0
fi
echo "failed to remove maxtor"
exit 1

#!/bin/sh
#
# put the laptop to sleep
#
# unfortunately we can't put this into
# /etc/apm/suspend.d/ since apm will
# automatically suspend after a certain
# time if called with "apm -s" even if
# the script has not terminated yet
#
# v0.1 2005-01-20   Tomas Pospisek
#
# released into the public domain
#

while ! /usr/local/bin/remove_maxtor; do
  echo "can't remove maxtor"
  sleep 1
done
apm -s

UMN Mapserver contributions

SDE Raster support

These enhancements to Mapserver 4.2.0 add support for SDE raster layers. A function msSDELayerQueryByAttributes for fast queries on SDE layers is also included. Usage:

  CONNECTIONTYPE sde
  CONNECTION "mapserver.gis.gr.ch,port:5151,'',username,password"
  TYPE raster
  DATA "KONTEXT.LANDESKARTE_50_KOMBINIERT.IMAGE,SHAPE"

The connection has the following arguments: server,instance,database,username,password The work was kindly sponsored by the GIS-Kompetenzzentrum of Graubünden, Switzerland.

SDE Query speedup

This patch against Mapserver 4.2 activates the call of msSDELayerQueryByAttributes.

--- ms-4.2.3.orig/mapquery.c    2004-09-29 09:47:26.000000000 +0200
+++ ./mapquery.c        2004-09-29 09:27:37.000000000 +0200
@@ -292,7 +292,11 @@
   else
     lp->project = MS_FALSE;
 #endif
-  status = msLayerWhichShapes(lp, searchrect);
+  if (lp->connectiontype == MS_SDE) {
+    status = msSDELayerQueryByAttributes(lp);
+  } else {
+    status = msLayerWhichShapes(lp, searchrect);
+  }
   if(status == MS_DONE) { // no overlap
     msLayerClose(lp);
      msSetError(MS_NOTFOUND, "No matching record(s) found, layer and area of interest do not overlap.", "

Ruby MapScript for Mapserver 4.0

Ruby MapScript is included in the current Mapserver version. Ruby MapScript is a Ruby interface to the UMN Mapserver library. The compiled version is also integrated in the binaries of MapDesk. Download the source package. In order to compile you will need:

  • Sources of UMN MapServer (version >= 4.0)
  • Ruby (version >= 1.6)
  • Optional: Swig (version >= 1.3a5)

MapDesk

Introduction

MapDesk is a UMN MapServer based map editor and viewer. The built-in map file editor supports syntax highlighting, context-sensitive help and a preview function.

Screenshot

Features

  • Standalone application, no need of UMN MapServer CGI
  • Built-in map file editor
  • Built-in viewer with map file preview, zoom, pan, etc.
  • Preview of the legend
  • Platform-independent architecture

Download

You can download the fully functional MapDesk binaries, now in the version 0.7.0:

The RPM and the Windows packages are not fully tested! Please give us feedback.