The University of Vermont

10/28/2009

Drupal and LDAP @ UVM

Wesley Wright (Grand High Wizard of Blogsalot) @ 2:54 pm
(filed under category Projects)

First, look at documentation

http://drupal.org/handbook/modules/ldap_integration

Next, download the right module for your Drupal version

http://drupal.org/project/ldap_integration

For me it was ldap_integration-6.x-1.0-beta1.tar.gz

Expand compressed package, unpack archive


gzip -d ldap_integration-6.x-1.0-beta1.tar.gz
tar -xvf ldap_integration-6.x-1.0-beta1.tar

Move ldap module into drupal. Assuming tar file was expanded in drupal folder, simply

mv ldap_integration modules

Now we go to Drupal=>Administer->Site Building->Modules

Scroll down to bottom, enable LDAP Authentication. Optionally select Data and or Groups if you want to have real fun.

Screen shot 2009-10-28 at 2.51.25 PM

OK, now go to Drupal=>Administer->Site configuration->LDAP -> Authentication . The only thing you might change is Authentication Mode LDAP only

Screen shot 2009-10-28 at 2.57.17 PM

From same screen, choose Add Server. Use these settings
Screen shot 2009-10-28 at 3.01.53 PM

comments ?


serial interface fun

Wesley Wright (Grand High Wizard of Blogsalot) @ 2:39 pm
(filed under category Projects=> Scripts - Programming)

Perl module Device::SerialPort is our friend.

As is Clipboard, IO::All, Spiffy

Trying to talk to a Sartorius precision balance. Speaks over Serial/USB cable.

Dang, there was supposed to be more here to serve as documentation. Now, months later, I have forgotten it all…

Here is at least the shell of the code:


#!/usr/bin/perl
use Data::Dumper;
use DBI;
use Device::SerialPort;
use Time::HiRes qw(usleep);
use CGI;
$query=new CGI;
print $query->header;
use Clipboard;
sub block_output {
my $block=shift(@_);
print "blocking $block\n";
@bytes = split (//, $block);
foreach $byte (@bytes) {
send_char($byte);
}
}
sub send_char {
my $byte=shift(@_);
my $char;
print "send byte $byte\n";
$port->write("$byte");
}
######################
# #
# Program Main #
# #
######################
# Set up the serial port
# 19200, 81N on the USB ftdi driver
$debug=shift(@ARGV);
print "debug=$debug\n";
if (!$debug) {
$port = Device::SerialPort->new("/dev/tty.usbserial-0000201A");
$port->databits(7);
$port->baudrate(9600);
$port->parity("odd");
$port->stopbits(1);
@handshake_opts = $port->handshake;
print Dumper @handshake_opts;
$port->handshake("none");
}
#block_output(chr(27).'P');
usleep(250000);
$count=0;
while (1) {
until ($count) {
($count,$char) = $port->read(16);
sleep 3;
}
print "count=$count char=$char\n";
if ($count == 16) {
$weight=substr($char,9,7);
Clipboard->copy($weight);
}
$count=0;
}
print "count=$count char=$char\n";
$weight=substr($char,9,7);
Clipboard->copy($weight);
$count=0;
#while ($count) {
# ($count,$char) = $port->read(1);
# print "reply char $char count=$count\n";
#}
exit;

comments ?


6/15/2009

Video Capture Interview Application using Flash and Flash Media Server Clone

Wesley Wright (Grand High Wizard of Blogsalot) @ 1:01 pm
(filed under category Projects)

Client asked me:

I am working on this new project involving testimonies. I already made a video of interviews that I roughly edited, but I want to extend the project “to the world”, digitally. So I thought that you could help me with the creation of a basic computer program with which people can answer questions while being recorded in a computer. I would take this program to many venues and cultures and then, I would put together the answers in video films. What do you think?

So the program would do something like this:

- The person sits in front of a computer and the computer presents him/her with the following options (I am improvising here):

1. Please, adjust you image to the camera and say your name and place of origin.

2. Say your birth date (optional).

3. Please, read the following authorization release. This is only for the purpose of the project… (this can be place at the end of the recording….

4. Please, click on the questions below and answer them at your own pace.

etc…

Client is a Macintosh user, and so am I, so I started looking at my options:

  • Applescript Quicktime Player?
  • Flash?
  • Xcode
  • Java App?

It’s been months since I first started his assignment, so I don’t recall in what order I examined solutions and either discarded or investigated more closely and why. But I finally ended up with XCode. I figured it would be a good learning experience.

And it was — to a point. Found some good tutorials that got me started, and I was able to get a feed from my iSight on the screen in fairly short order. And then got stuck. Figured the camera would be the hard part, but in fact it was the text box where the question would appear that stumped me. Banged my head against it n and of for several weeks, slowly forgetting everything I learned at the star of the project, until I finally backburnered it indefinitely.

Finally the client called me and asked how’s it going. Not, I said, but I would look again. Revisited the same options, this time encouraged by the YouTube and Facebook use of Flash. Tried to pirate their Flash apps, but they wouldn’t work outside the context of their own web pages.

I liked the idea of a web based plug-in of sorts for the camera, since once that was done all the text and interaction stuff would be easy, known territory. So now I tried to become an ActionScript programmer.

[Side observation: large IT corporations should not be allowed to develop programming languages. Visual Basic sucks. AppleScript sucks. ActionScript sucks. Java sucks. I long for the days of ANSI Fortran or even C.]

Anyway, masterful googling revealed some examples in the Adobe ActionScript on-line documentation that got me started. I slowly learned that Flash would only send it’s captured video back to a Flash Media Server. I discovered Red5 and Wowza. I discovered to my dismay that Flash would only use the Sorenson H.263 Spark video codec and the Nellymoser audio codec. I really wanted h.264. Too bad. I really wanted MP4, too, but all I could get was FLV. Drat!

My final frustration and triumph was getting the sound and video to sync when viewing the resulting FLV files in QuickTime Player with the Perian universal codec package. The audio track was consistently shorter duration than the video, and seemed to be missing a second or so at the start. Yet when viewed in VLC player or in my Wowza Videorecording Example derived ActionScript code, the first second or so of video seen in Quicktime player was cut off, thus rendering the audio in sync.

I finally hit upon the cure (combination of dumb luck, trial and error, intuition derived from 25+ years of experience): insert a small delay, about 2.5 seconds seemed to work well, between my calls to nsPublish.attachCamera, nsPublish.attachAudio, and nsPublish.publish:

nsPublish.attachCamera(camera);
nsPublish.attachAudio(microphone);
nsPublish.bufferTime = 30;
Wait.text=”Wait for my signal……”;
Wait.opaqueBackground = 0xFF0000;
myTimer.start();

function timedFunction(eventArgs:TimerEvent) {
myTimer.stop();
nsPublish.publish(nameStr.text, (AppendCheckbox.selected?”append”:”record”));
Wait.text=”Start talking!”;
Wait.opaqueBackground = 0×00FF00;
}

Worked like magic.

So the Flash App is written to by default capture 30FPS 640×480 standard definition video at maximum quality and bitrate and send it to a flash media server running on localhost. FPS, width, height, quality settings, and IP address of remote FMS can be configured by FlashVars in calling HTML.

Full example at http://www.uvm.edu/~waw/archives/tina

comments ?


5/11/2009

Flip Ultra vs Flip MinoHD vs Kodak ZX1

Wesley Wright (Grand High Wizard of Blogsalot) @ 3:43 pm
(filed under category Projects)

I compared three similar pocket digital video recorders. My two simple evaluation criteria were “plays well with UVM basic web servers” and “plays well with iMovie.” Conclusions:

  1. The Kodak ZX1 plays best with UVM servers: video clips can be uploaded direct from camera to server and viewed on the web with no post-processing (conversion, reformat, resize, or edit).
  2. All played equally rough with iMovie HD (the original version, iLife 06 and earlier)
  3. All played equally well and shared nicely with iMovie 09 (and presumably with 08 as well)

Flip Ultra:

Flip Ultra

  • Saves files natively in .AVI container using an MPEG-4 codec
  • Officially — meaning they give you an installer for it — the codec is of the XVid variety, and 3ivx in particular.
  • 640 x 480; 30 fps, about 4.3 mbits/second
  • You can upload .AVI files direct to www.uvm.edu. Will play if client machine has 3ivx or DivX installed. If not installed (but QuickTime is), prompted to get additional components for Quicktime; specifically, the Xvid component. However, installing Xvid component for Windows still did not allow .AVI file to be played using QuickTime browser plug-in. So, raw files not quite ready for web, need post processing
    Example AVI
  • comes with an application preloaded on drive for editing and sharing videos. When launched, prompted to install 3ivx codec, even if Divx already installed. Apparently it wants that installed before it will run.
  • Once it does run (FlipVideo For Mac, that is), it immediately asks if you want a free upgrade. I said no, for now, just to see what’s what
  • Chose Public Online Sharing for Upload to Other Websites. Took ForEVER for 1 minute movie. Produced 496 x 370 pixel; 30 fps; 840 kbit/second .MOV file using QDesign Music 2 (16 kHz) and Sorenson Video 3 codec. Yuck. Where’s my MP4 format go? Also note: movie NOT set for progressive download!
    Example MOV
  • Restarted FlipVideo For Mac, took them up on offer to install FlipShare (100 Mb download)
  • Installed FlipShare, which in turn launched App, which in turn updated flash drive on Flip with new software
  • Launched FlipShare. Chose Share… Online… Other Websites. Produced 640 x 480 pixel; 30 fps; 1171 kbit/second .MOV file using u-Law 2:1 (16 kHz) and H.264 codec.. This is an improvement, but once again movie NOT set for progressive download!
    Example MOV

Flip MinoHD:

Flip Ultra

  • saves in .MP4 container, Quicktime claims file is video: AVC Coding (another name for H.264), 1280 x 720, Millions Colors, Audio AAC Mono, 44.100 kHz, a whopping 10.43 mbits/s
  • Apparently, though, movie is STILL not “optimized for internet” or “flattened” or otherwise ready for Progressive download.
    Example MP4
  • Post processing via QuickTime Pro: Export as MP4, select options, Video codec set to passthrough, audio to passthrough, streaming set to enabled produces a file claimed by Quicktime to be video H.264, 1280 x 720, Millions; audio AAC, Mono, 44.100 kHz, still 10.43 mbits/s. Progressive download now works fine.
    Example MP4

Kodak ZX1:

Flip Ultra

  • records in 720p HD or 480p SD (VGA). Also records in 720p HD 60 fps, but that mode wasn’t tested.
  • saves in .MP4 container, Quicktime claims file is video: Ambarella AVC encoder, either 1280 x 720 (HD) or 640×480 (SD), Millions Colors, AAC, Stereo, 48.000 kHz, and a staggering 11.16 mbits/s for HD and 2.663.30 mbits/s SD
  • Amazingly, movie IS “optimized for internet” or “flattened” and otherwise ready for Progressive download!
  • Post processing via QuickTime Pro: Not Necessary!

Import into iMovie HD (version 6.03, iLife 06)

  • started with iMovie HD (version 6.03, iLife 06). Created new project of type MP4.
    • Dragged original Flip Ultra AVI into project. I waited while iMovie “down converted” from [DivX 6.0, 640 x 480, Millions Microsoft ADPCM, Mono, 44.100 kHz 4316.74 kbits/s] to [AAC, Stereo (L R), 48.000 kHz Apple MPEG4 Decompressor, 640 x 480, Millions 991.62 kbits/s]
    • I used QuickTime Pro to export original as H.264, using mostly default settings and 640×480 dimensions. Resulted in [AAC, Mono, 44.100 kHzH.264, 640 x 480, Millions]. Dragged this into iMovie, it instantly copied file to project with no modifications
    • I dragged the original Flip MinoHD MP4 file into project. I waited while in down converted from [1280 x 720 10.43 mbits/s.] to letter boxed 640×480 981.27 kbits/s.
  • Created new project of type MP4.
    • I dragged the original Flip MinoHD MP4 file into project. iMovie crashed. Tried again, same results as above — down converted from [1280 x 720 10.43 mbits/s.] to letter boxed 640×480 981.27 kbits/s.
  • Clearly, new project of type MP4 is inappropriate for the MinoHD. This time tried HDV 720p
    • I dragged the original Flip MinoHD MP4 file into project. iMovie up converted from [1280 x 720 10.43 mbits/s.] to [16-bit Integer (Little Endian), Stereo (L R), 48.000 kHz Apple Intermediate Codec, 1280 x 720 (1248 x 702), Millions] and a mammoth 32.75 mbits/s. My 91.75 MB MP4 was now 288.15 MB. I don’t know where the (1248 x 702) is coming from. Yes it works, but still not ideal.
  • Now for the Kodak ZX1 files. Same results as with MinoHD

iMovie HD does not handle these cameras as well as it handles an old-school DV camera.

Import into iMovie 08/09

This is a whole different kettle of fish. MacOS and iLife treat these cameras as Still cameras, not video cameras. Hook one up to a Mac, and iPhoto launches and imports movie (and or still) clips. These are registered as “Events” and generally sorted by dates embedded in the photos (Strong Hint: Be sure your camera has the proper Times and Date Set!!).

iMovie has an Event Library Panel. Import from a file or DV camera can be set to create a new Event or add to an existing event. There is also an iPhoto Videos Event. Choose that, find a video in an iPhoto Event, drag it straight into project, watch immediately. Additionally, if you select import and navigate to your iPhoto Library, you can find the movie clips in iPhoto Events and import into iMovie Events.

Bottom line: iMovie 08/09 is far superior to iMovie 06 in terms of working with this class of cameras — if you can tolerate the remainder of the iMovie 08/09 user interface.

comments ?


12/8/2008

Gnokii OS X, Part II

Wesley Wright (Grand High Wizard of Blogsalot) @ 2:45 pm

A long circuitous path, but in the end — sucess!

Started off with darwinports, but that only got us 0.6.8 (current as of this writing was 0.6.27).

Then tried Fink. That got us up to 0.6.13
dating
Tried that version agains a LG phone. It wrked, but the LG phonewasn’t a GSM phome, and thus didnt understand the extended GSM (Ahyes) AT command set. So, no recovery of SMS messages.

Switched to Nokia 6085 phone. Tried 6510 and series40 drivers. Connected just fine, seemed to better understand the –getsms message, but spit out a bunch of errors — and no SMS messages.

Student Jacob was able to quicly install 0.6.27 on a Denebian system, connect to phone via USB, and recover a trial SMS message, all of which suggested we really needed a newer verion on the Mac. Further resaerch suggested that by enabling “unstable” trees of FInk archives and CVS/rsync Source Distributions, we could get version 0.6.26. (http://pdb.finkproject.org/pdb/package.php/gnokii)

This required these steps from Fink FAQ:

run fink configure, answer Yes to “turn on untsable trees”
run fink selfupdate-rsync; fink index; fink scanpackages
then finally

fink install gnokii

Which now told me I needed somethink like 87 prerequisites. Ok, said I. Just do it.

It did, then choked on gtk. But it suggested

You are attempting to build gtk+2 with version 3.1 of Xcode, which
requires an update to your installed version of X11. Please download
and install X11 2.3.0 or later from

http://xquartz.macosforge.org/trac/wiki/X112.3.0

Once you have installed X11 2.3.0, please re-attempt installation of
this package gtk+2.

Hmm. Hadn’t even installed Apple’s X11 yet. So first, I grabbed a Leopard install disk and installed X11. Then I manually got the X11 2.3.0 package installer, installed that. Rebooted. ran fink selfupdate, fink update, and GTK complied. Ran fink install gnokii, and low and behold, gnokii 0.6.26 was alive and well. tested with gnokii –identify and then the all important gnokii –getsms IN 1 1, got the SMS message. Sweet success.

Next step was to rempile the GSMI::Gnokii perl interface. See http://www.agouros.de/gnokii/. Need the “Beta-Test” versions. Had to define GNOKII_DIR with “export GNOKII_DIR=/sw”. Then edit Makefile to remove the “-arch ppc” loader directive.

GSMI mostly works. Do be sure to initialize hash arrays before using. Lot’s of error messages dumped, but in the end — stuff works. here’s a sample:

#!/usr/bin/perl
use GSMI;
use Data::Dumper;
my $smshash={};
my $smscounthash={};
$gsm=GSMI->connect("driver=Gnokii;device=00:22:65:ef:7e:25;options=model:series40,connection:bluetooth,initlength:1,use_locking:no");
$gsm->GetSMSStatus($smscounthash);
print Dumper($smscounthash);
$gsm->GetSMS("IN", 1, $smshash);
#print Dumper($smshash);
print "Message from phone=".$smshash->{'text'}."\n";
$gsm->disconnect;
exit;

and outputs…


2008-12-08 13:45:38.950 perl[13902:10b] *** _NSAutoreleaseNoPool(): Object 0x34d8c0 of class NSCFData autoreleased with no pool in place - just leaking
Stack: (0x90401adf 0x9030e1f2 0x903228c5 0x903224a1 0x6cf038 0x453e36 0x40569a 0x450e25 0x4448e4 0x401995 0x401b79 0x2f6c3 0x1c795d 0x1be3b9 0x14b480 0x204e)
2008-12-08 13:45:41.931 perl[13902:1403] *** _NSAutoreleaseNoPool(): Object 0x3bf400 of class __NSFastEnumerationEnumerator autoreleased with no pool in place - just leaking
Stack: (0x90401adf 0x9030e1f2 0x6d372c 0x9098f9ca 0x950d7635 0x950fb908 0x950fbd54 0x453dc7 0x955316f5 0x955315b2)
2008-12-08 13:45:41.932 perl[13902:1403] *** _NSAutoreleaseNoPool(): Object 0x39f900 of class NSCFArray autoreleased with no pool in place - just leaking
Stack: (0x90401adf 0x9030e1f2 0x9516b1b8 0x6d378d 0x9098f9ca 0x950d7635 0x950fb908 0x950fbd54 0x453dc7 0x955316f5 0x955315b2)
Can not access device please check permissionsAuto was called with GetSMSStatus
$VAR1 = {
'unread' => 0,
'read' => 1
};
Auto was called with GetSMS
Message from phone=Hello world
Auto was called with disconnect
Attempt to free unreferenced scalar: SV 0x83614c, Perl interpreter: 0x800000.

comments ?


gnokii OS X, part I

Wesley Wright (Grand High Wizard of Blogsalot) @ 12:41 pm
(filed under category Projects)

Well, I started this post and never finished it.

Here’s what I though I had to do…

Needs GNU gettext tools from http://www.gnu.org/software/gettext/gettext.html

Configure with

env MACOSX_DEPLOYMENT_TARGET=10.5 CFLAGS="-arch ppc -arch ppc64 -arch i386 -arch x86_64 -g -Os -pipe -no-cpp-precomp -dynamic" CCFLAGS="-arch ppc -arch ppc64 -arch i386 -arch x86_64 -g -Os -pipe -dynamic" CXXFLAGS="-arch ppc -arch ppc64 -arch i386 -arch x86_64 -g -Os -pipe -dynamic" LDFLAGS="-arch ppc -arch ppc64 -arch i386 -arch x86_64 -bind_at_load -dynamic" ./configure --disable-dependency-tracking

need gnokii from http://www.gnokii.org/download/gnokii/

Then similar configure….resulting in absolute failure.

Research suggested “try fink” or “try darwin ports”

comments ?


10/22/2008

Wammu Gammu OS X

Wesley Wright (Grand High Wizard of Blogsalot) @ 11:16 am
(filed under category ElectronicArts=> Systems and Servers)

Long and winding road.

Download cmake source from www.cmake.org — Binary Package is only for Tiger right now. Configure (./bootstrap; make; sudo make install) and install

Download and configure mysql with

env MACOSX_DEPLOYMENT_TARGET=10.5 CFLAGS="-arch ppc -arch ppc64 -arch i386 -arch x86_64 -g -Os -pipe -no-cpp-precomp" CCFLAGS="-arch ppc -arch ppc64 -arch i386 -arch x86_64 -g -Os -pipe" CXXFLAGS="-arch ppc -arch ppc64 -arch i386 -arch x86_64 -g -Os -pipe" LDFLAGS="-arch ppc -arch ppc64 -arch i386 -arch x86_64 -bind_at_load" ./configure --disable-dependency-tracking

make, make install

Download gammu. Edit gammu cmakelists.txt for os x. Edit common/cmakelists . Edit templates/gammu-config.h.cmake

mkdir build; cd build; cmake ..; give up in frustration after seeing this

ranlib: file: libGammu.a(bluez.o) has no symbols
ranlib: file: libGammu.a(blue_fbsd.o) has no symbols
ranlib: file: libGammu.a(blue_w32.o) has no symbols
ranlib: file: libGammu.a(blue_osx.o) has no symbols
ranlib: file: libGammu.a(ser_djg.o) has no symbols
ranlib: file: libGammu.a(ser_w32.o) has no symbols
ranlib: file: libGammu.a(irda.o) has no symbols
/usr/bin/ranlib libGammu.a
/usr/bin/ranlib: file: libGammu.a(bluez.o) has no symbols
/usr/bin/ranlib: file: libGammu.a(blue_fbsd.o) has no symbols
/usr/bin/ranlib: file: libGammu.a(blue_w32.o) has no symbols
/usr/bin/ranlib: file: libGammu.a(blue_osx.o) has no symbols
/usr/bin/ranlib: file: libGammu.a(ser_djg.o) has no symbols
/usr/bin/ranlib: file: libGammu.a(ser_w32.o) has no symbols
/usr/bin/ranlib: file: libGammu.a(irda.o) has no symbols

comments ?


6/4/2008

MacMini Landscape Server, Part II

Wesley Wright (Grand High Wizard of Blogsalot) @ 10:16 pm

 So apparently php5 out of the Leopard box does not have GD or freetype support turned on. Tried a quickie rebuild of the gd.so dynamic loadlib for preinstalled PHP, but got all sorts of undefined errors when invoked.

 

So Mike says, get fink and install fresh packages. Well, fink for 10.5 didn’t exist a few days ago. PHP5 is in the "unstable" brach of distributions, building libraries from fink didn’t always look back to see what other libraries were already installed (e.g., fink install pnglib2 followed by fink install gd2 , gd2 continued to look for pnglib in /usr/X11 ).

 

So I went back to good old install from source into /usr/local. configured, maked, and installed libjpge-6, libpng, libfreetype, libgd. Then looked at the phpinfo for sample config for php. Saw something like this

 

/SourceCache/apache_mod_php/apache_mod_php-44/php/configure’ ‘–prefix=/usr’ ‘–mandir=/usr/share/man’ ‘–infodir=/usr/share/info’ ‘–disable-dependency-tracking’ ‘–with-apxs2=/usr/sbin/apxs’ ‘–with-ldap=/usr’ ‘–with-kerberos=/usr’ ‘–enable-cli’ ‘–with-zlib-dir=/usr’ ‘–enable-trans-sid’ ‘–with-xml’ ‘–enable-exif’ ‘–enable-ftp’ ‘–enable-mbstring’ ‘–enable-mbregex’ ‘–enable-dbx’ ‘–enable-sockets’ ‘–with-iodbc=/usr’ ‘–with-curl=/usr’ ‘–with-config-file-path=/etc’ ‘–sysconfdir=/private/etc’ ‘–with-mysql-sock=/var/mysql’ ‘–with-mysqli=/usr/bin/mysql_config’ ‘–with-mysql=/usr’ ‘–with-openssl’ ‘–with-xmlrpc’ ‘–with-xsl=/usr’ ‘–without-pear’

Wanted to be sure we had all the right compiler flags for universal builds. See http://developer.apple.com/technotes/tn2005/tn2137.html so we add

MACOSX_DEPLOYMENT_TARGET=10.5 CFLAGS="-arch ppc -arch ppc64 -arch i386 -arch x86_64 -g -Os  -pipe -no-cpp-precomp" CCFLAGS="-arch ppc -arch ppc64 -arch i386 -arch x86_64 -g -Os  -pipe" CXXFLAGS="-arch ppc -arch ppc64 -arch i386 -arch x86_64 -g -Os  -pipe" LDFLAGS="-arch ppc -arch ppc64 -arch i386 -arch x86_64 -bind_at_load" 

 

and I want to enable built-in true type font support, so I add –enable-gd-native-ttf

yielding

MACOSX_DEPLOYMENT_TARGET=10.5 CFLAGS="-arch ppc -arch ppc64 -arch i386 -arch x86_64 -g -Os  -pipe -no-cpp-precomp" CCFLAGS="-arch ppc -arch ppc64 -arch i386 -arch x86_64 -g -Os  -pipe" CXXFLAGS="-arch ppc -arch ppc64 -arch i386 -arch x86_64 -g -Os  -pipe" LDFLAGS="-arch ppc -arch ppc64 -arch i386 -arch x86_64 -bind_at_load" ./configure –prefix=/usr –mandir=/usr/share/man –infodir=/usr/share/info –disable-dependency-tracking –with-apxs2=/usr/sbin/apxs –with-ldap=/usr –with-kerberos=/usr –enable-cli –with-zlib-dir=/usr –enable-trans-sid –with-xml –enable-exif –enable-ftp –enable-mbstring –enable-mbregex –enable-dbx –enable-sockets –enable-gd-native-ttf –with-iodbc=/usr –with-curl=/usr –with-config-file-path=/etc –sysconfdir=/private/etc –with-mysql-sock=/var/mysql –with-mysqli=/usr/local/mysql/bin/mysql_config –with-mysql=/usr/local/mysql –with-openssl –with-xmlrpc –with-xsl=/usr –without-pear

But when it became time to compile, it failed, because the libmysql installed from the Package didn’t include the right architectures. (just i386).

 

Tried again, reducing choices down to just i386. Resultant php5.so now fails when apache loads it, again a bad architectures problem

So, now we download mysql source and recompile (with all the flags), and the try php build again.

 

This time it almost worked, but no php was looking for libmysql in /usr/local/mysql/lib/mysql , thanks to an errant –prefix= somwehere. Rather than fix it right, I just made an alias. PHP and APACHE started!

But the graphs and such still fail.

Turns out, I missed these two important points

  1. Using modified php.ini file that forced load og a gd.so built (incorrectly) days ago, and so newly compiled GD support was ignored
  2. Didn’t actually have built-in GD support turned on anyway. Need to specify –with-gd , And with-jpeg-dir=/usr/locak and with-freetype-dir=/usr local

 So, final config for php is

MACOSX_DEPLOYMENT_TARGET=10.5 CFLAGS="-arch ppc -arch ppc64 -arch i386 -arch x86_64 -g -Os  -pipe -no-cpp-precomp" CCFLAGS="-arch ppc -arch ppc64 -arch i386 -arch x86_64 -g -Os  -pipe" CXXFLAGS="-arch ppc -arch ppc64 -arch i386 -arch x86_64 -g -Os  -pipe" LDFLAGS="-arch ppc -arch ppc64 -arch i386 -arch x86_64 -bind_at_load" ./configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --disable-dependency-tracking --with-apxs2=/usr/sbin/apxs --with-ldap=/usr --with-kerberos=/usr --enable-cli --with-zlib-dir=/usr --enable-trans-sid --with-xml --enable-exif --enable-ftp --enable-mbstring --enable-mbregex --enable-dbx --enable-sockets --enable-gd-native-ttf --with-iodbc=/usr --with-curl=/usr --with-config-file-path=/etc --sysconfdir=/private/etc --with-mysql-sock=/var/mysql --with-mysqli=/usr/local/mysql/bin/mysql_config --with-mysql=/usr/local/mysql --with-openssl --with-xmlrpc --with-xsl=/usr --without-pear --with-gd --with-jpeg-dir=/usr/local --with-freetype-dir=/usr/local

 And by golly, it all works!

comments ?


5/30/2008

Migrate Landscape Change Project to MacMini server

Wesley Wright (Grand High Wizard of Blogsalot) @ 2:57 pm

 On paper, this seems easy. Just move 70 GB of images and a dozen database tables to a brand new mac, and we’re done.

Well, not quite…

Step 1: prepare the mac out of the box

This was mostly straight-forward; however, I did a couple of things a little different hoping it would minimize problems down the road.

 

First, run Setup Assistant and create admin account. called it glcp, just to match what was on original host site. Since all the original files were owned by this user, it seemed a nice convention.

Now tricky part: files will be transferred by rsyc, which preserves UIDs and GIDs. So, I needed to create a new group (glcp) and give it and the glcp user the same numeric IDs found on the original host (uid=56774, gid=199976).

Changing the UID for glcp was easy, using System Preferences=>Accounts=>Advanced, as was assigning the primary group ID. But I still needed to create a group that matched. So, open terminal and type

sudo dscl . -create /Groups/glcp gid 199976

Step 2: Reconfigure web services, part 1

The Mac will run Apache and php right out of the box; however, not quite the way we want it.

First, create new top level folder /landscape . Everything (code, HTML, data) will go here. Set owner and group to glcp:glcp

Now, edit /etc/apache2/httpd.conf:

  • uncomment #LoadModule php5_module        libexec/apache2/libphp5.so
  • change document root to  DocumentRoot "/landscape"
  • change <Directory "/Library/WebServer/Documents"> to <Directory "/landscape">
  • change     AllowOverride All
  • change     DirectoryIndex index.html index.php

Step 3: Set up and populate mySQL

First, download mySQL OS X install package. Install the server and the Startup package.

Out of the box, will only index words >=4 characters. So create a little file /usr/local/mysql/my.cnf and insert these lines

[mysqld]
ft_min_word_len=3

Now start the server from terminal
 
sudo /Library/StartupItems/MySQLCOM/MySQLCOM start
 
Need to change root user password, get rid of anonymous users, add glcp user
 
From command line, start mysql
 
/usr/local/mysql/bin/mysql -uroot msql
 
use following commands
 
update user set Password=password("xxxxxx") where User="root";
delete from user where User="";
flush privileges;
create database GLCP_1;
grant all on GLCP_1.* to glcp@"%" identified by "yyyyyyy";
quit
 
Transfer the current database, again via terminal (note: all one line)
 
/usr/local/mysql/bin/mysqldump -hwebdb.uvm.edu -pxxxxxxx -uglcp GLCP_1 | mysql -uglcp -pxxxxxxxx GLCP_1
 

Step 4: Get the code and other files

We can suck up the code from zoo using rsync, but we can’t get everything in one bite, nor do we want everything. Create a text file /Users/glcp/rsync_excludes.txt  of stuff we don’t want

 

CVS/
INTERNS/
Jamie/
WORKING_FOLDER/
bak/
maintenance/
old_learn/
temp_store/
asset_store/
Archived Images tif/
bulk_store/
learn_dev/

run rsync

 

 

rsync -av –delete –rsh=ssh –exclude-from=/Users/glcp/rsync_excludes.txt –progress glcp@zoo.uvm.edu:/…/uvm.edu/fs/geology/landscape /

Cool, so we’ve got the code. Now the asset_store. Turns out it is too big to get all at once, so we do it folder by folder

 

rsync -av –delete –rsh=ssh  –progress glcp@zoo.uvm.edu:/…/uvm.edu/fs/geology/landscape/asset_store/00 /landscape/asset_store

 

It would be nice to script this, but alas, each iteration requires a password, unless one employs SSL keys. But alas, SSL keys don’t work when connecting to zoo, so we need to make the connection from zoo to the mac Mini.

Creating the keys and what-not was gleaned from this document, which hopefully will remain on the web for a while. When following the recipe, consider zoo as the local machine and the mini as the remote machine. Now, we can create a script with commands like this

 

rsync -av –delete -e "ssh -i /users/g/l/glcp/.ssh/glcp-zoo-key" –progress /:/geology/landscape/asset_store/00 glcp@132.198.xxx.yyy:/landscape/asset_store

 

 

I need to work on that script a bit, make it iterate over all exiting asset_store folders.

 

Took maybe 17 hours to send the 70+ GB of data

Step 5: Edit code

Most of the editing is in global.h.php, changing master paths and URLs. Also, many references the $GLOBALS['SERVER_NAME'] apparently need to be changed to $_SERVER['SERVER_NAME']. Also, need to change path for parser.php in those .htaccess files that contain that reference.

Step 6: test and explore dead-ends

Now we can test, and see what we missed.

The first thing missing was GD graphics support in PHP. Apparently, this doesn’t come with the php distributed with Leopard. We need it to draw maos and graphs. I tried following these instructions (for 64 bit CPUs), which enabled GD support, but the Freetype libraries don’t seem to work, causing severe server errors when drawing text on images.

Another issue is Google Maps interface: complains that the key used is not registered, but probably doesn’t matter since it won’t work without real network connection

And that’s where we sit today. Will try getting a whole new php package using Fink, or maybe even rebuild from source, and try again. 

 

 

comments ?


7/13/2007

CMAP server notes

Wesley Wright (Grand High Wizard of Blogsalot) @ 4:35 pm
(filed under category Projects=> Systems and Servers)

It is pretty simple — still, it might be worth me writing some documentation.

And too simple, for some: I see two folders there from non-UVM “contributors.” Apparently, I had the default permissions set such that “Everyone” could create folders. I have rescinded that permission, so you may want to try creating yet another new test folder, and then deleting it, just to be sure.

I’m trying to decide how best to manage this server in a sustainable, scalable fashion. Options:

o current method: use a single “admin” username and password (uvcmaps:spamcmvu), and hand that out to designated departmental coordinators to manage their own stuff

o create admin accounts (jbellum, jhenry, pbierman, etc.) for designated departmental coordinators to manage their own stuff

o Appoint a CMAP server czar (me or some TechCat or Account Services) who keeps a single “admin” username and password and creates folders for designated departmental coordinators to manage their own stuff

Current method is simplest, but has a small security concern in that too many people have super powers. If, say, designated departmental coordinator Pat Q Taireristt is fired and leaves UVM in a Huff, Pat could maliciously delete everyones folders unless we change the password and tell all the other designated departmental coordinators.

Creating admin accounts for all designated departmental coordinators allows us to delete Pat’s account, and everyone else is unaffected

But having either one shared or multiple personal accounts, all with root access to the UVM Public CMAP server, could create a “too many cooks” situation: should Academic Computing and the Center for Teaching and Learning each have folders at the top level, or should ACS and CTL have folders inside a top level folder called “Learning Resources?”

Thoughts? Does it really matter?

comments ?


9/7/2006

I need a new Image

Wesley Wright (Grand High Wizard of Blogsalot) @ 10:30 am
(filed under category My pitiful Life)

Like this, for instance…

I also need a link to a movie here, too.

comments ?


8/2/2006

movable type and goLive

Wesley Wright (Grand High Wizard of Blogsalot) @ 12:20 pm
(filed under category Blogs=> Projects)

a client asks asked

1) Is it possible to link Adobe GoLive directly into the moveable type blogging system? There evidently is an API in golive, but I haven’t been able to find the correct URL to link to the pages within the blog.  It would make sense, for a security standpoint, to require people to only use the MT tools since root access to the actual blog content directories via FTP could be a bad idea.  If so, oh well.. However, being able to use a more advanced content creation system would be nice rather than just cutting and pasting.
Nope. Yes, it would require shell access or sftp access (pretty much the same, since sftp implies ssh implies shell access) or ftp access or webdav access — none of which are currently offered to the typical user on blog.uvm.edu.  So, your only option right now is to cut and paste, as suggested here

    http://www.adobe.com/support/techdocs/332078.html



2) I suspect that I should be able to use cold fusion tags to draw info out of a MySQL database to populate some web pages we’re delivering.  Is this possible and, if so, is it using the same old instructions that we used a year or so ago when I was creating some PHP scripts and using MySQL to populate.  I’m building a Google Gadget that I’d like to populate with an RSS feed or using a database call so having access would be useful.  I have some of the old info you sent me somewhere and if that’s still good I’d find it and use it to create the needed databases.

Cold fusion — well, probably not, since those would require blog.uvm.edu to support ColdFusion, and it does not. But PHP — sure. here’s a link to some examples

http://www.scriptygoddess.com/archives/2002/10/14/individual-entry-and-trackback/

- – - – - –

Sometimes this stuff is easier to do with Wordpress as a blog tool. Pros: it lives in your own public_html folder, which you can access in multiple way, you can hack the php code left and right and write your own functions. Cons: you need to install and configure it yourself, code hacks and modifications require php programming skills.

comments ?


Script Help

Wesley Wright (Grand High Wizard of Blogsalot) @ 12:18 pm
(filed under category Projects=> Scripts - Programming)

Script problems and solutions discussed with Sean Dempsey.

comments ?


Davis Construction cam movie

Wesley Wright (Grand High Wizard of Blogsalot) @ 12:18 pm
(filed under category Projects=> Video and Audio)

Camera 1 knocked out by lightning, zapped all configuration parameters. Reset them, camera back in action.

comments ?


8/1/2006

video for nursing

Wesley Wright (Grand High Wizard of Blogsalot) @ 12:14 pm
(filed under category Projects=> Video and Audio)

on July 24, Kurt Schaberg wrote :

Hello,
My name is Kurt Schaberg and I’m helping Dr. Patricia O’Brien set up her WebCT course web page.  I was told to contact you directly regarding putting video on the web page.  Dr. O’Brien would like to have all of the videos available online for the students to access as a resource.  They are all in windows media video (.wmv) format.  These videos are a series of lectures and informational videos and total just under 9GB in total combined size.

How do you think it would be best to get these accessible on WebCT?

The "video server" has about 84 gigabytes free space, so we have plenty of room

UVM NetID "kschaber" has been authorized to create folders and upload files to the video server

There is already a "nursing" folder on the video server, created around Nov 2001 for a previous exercise in on-line nursing videos; however, you may wish to create your own. Call it anything you like, but we prefer names  that help us track down the owners/purpose

You can use the "Secure Shell File Transfer" program to upload your videos (see http://www.uvm.edu/cit/ssh/?Page=./SFTP_Win_SSH.html) to upload your videos (unless, of course, you are using a Macintosh). Connect to zoo.uvm.edu using your kschaber NetID and associated password.

Once connected, go to the "Operation" menu, select "Go To Folder", and go to folder

    /:/video/realserver/videos/

Look for and open the nursing folder, or chose "New Folder" from the Operation. Now find your video on the left-hand window, and drag them to the right-hand window. Also, change the permissions as described in the above referenced URL

If you get stuck, any of the "Dr is In" staff ought to be able to help.

Once the videos are uploaded, you need to create links to them in you WebCT pages. For a given video, say

    "Nurse2be-OBClinical1Reflections493.wmv"

in the folder, say

    "nursing",

the URL (address, link) for the video is then

    http://real.uvm.edu:554/asxgen/nursing/Nurse2be-OBClinical1Reflections493.wmv

comments ?


Contact UVM © 2009 The University of Vermont - Burlington, VT 05405 - (802) 656-3131