Gnokii OS X, Part II

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.

Posted in ElectronicArts, MacOS Support, Projects, Scripts - Programming, Systems and Servers | Leave a comment

gnokii OS X, part I

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”

Posted in Projects | Leave a comment

Wammu Gammu OS X

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

Posted in ElectronicArts, Systems and Servers | Leave a comment

MacMini Landscape Server, Part II

 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!

Posted in Landscape Change, Projects, Scripts - Programming, Systems and Servers | Leave a comment

Migrate Landscape Change Project to MacMini server

 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  to 
  • 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. 

 

 

Posted in Landscape Change, Projects, Scripts - Programming, Systems and Servers | Leave a comment

CMAP server notes

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?

Posted in Projects, Systems and Servers | Leave a comment

I need a new Image

Like this, for instance…

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

Posted in My pitiful Life | Leave a comment

movable type and goLive

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.

Posted in Blogs, Projects | Leave a comment

Script Help

Script problems and solutions discussed with Sean Dempsey.

Posted in Projects, Scripts - Programming | Leave a comment

Davis Construction cam movie

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

Posted in Projects, Video and Audio | Leave a comment