Gessel On…

…this and that.

Sunday, June 15, 2008

Hacking the ImageMagick Makefile

More upgrading follies.

ImageMagick was recently updated from 6.4.1.1 to 6.4.1.5 and I did a portupgrade -ra and eventually got the configure dialog. There were a couple of options I thought could be useful: WMF support and SVG support seemed to be useful. But, alas, I run my server without X11 - it’s just a server after all… the overhead of X11 is pretty pointless. Unfortunately the config dialog doesn’t do a dependency check or tell you anything, so selecting either or both of those options without selecting X11 breaks the build.

Now there is a simple way to force the config dialog to come back, but I couldn’t find it this morning and can’t remember. Every time I tried to build I got an X11 dependency error. So I tried deleting the SVG option from the top of the Makefile, which just breaks it worse. In the end I modified the test conditions and commented out the IGNORE statements for both WMF and SVG and forced –without for both conditions - that is build without SVG or WMF whether or not they are specified in the config file and skip the result of the check WITH SVG or WMF and !WITH X11.

posted at 13:00:30 more on... Linux  

Wednesday, February 6, 2008

Calendar Syncing

Like many people, I have to use Outlook. It is by far not my favorite email or calendar system; I use Mulberry personally because it does not suck at all and it has a cool calendar I can use offline. I haven’t quite figured out my own webdav server, so I use Google Calendar to keep track of shared events with my girlfriends and others in my life. And everyone can use Google calendar and it does not suck either, so there’s no reason not to.

But it does create a sync issue. One which can be solved with free software and services by the following fine providers:

I end up using Google as my shared hub, sort of. Technically scheduleworld.com is the hub, but it’s invisible to everyone but me. To get there I use the Funambol outlook plug-in to sync my outlook calendar with scheduleworld.com (following these directions). It is not able to sync directly to Google yet because Google has to do it their way. Fortunately the clever man behind scheduleworld has that figured out. I also sync contacts using funambol to scheduleworld, but Google borked the contact API and so they don’t make it to Google Contacts from scheduleworld any more: scheduleworld does have an LDAP server though.

On the well-designed side, I use gcal daemon to sync my Mulberry calendars with Google (my directions here). I also subscribe to the scheduleworld LDAP server from Mulberry so I can access my outlook contacts from mulberry.

Now, oddly, Outlook’s contact databases are painfully borked and the local address book and global address books do not collaborate at all. Stupid. Unfortunately neither does Mulberry offer an option to sync the local address book to one or more remote LDAP directories, which would be very useful. I think there is still an odd disconnect on the part of developers who tend to work stationary and assume everyone has an always-on connection with very rare moments of disconnect, but as someone who gets on at least 4 planes a week can attest: this is not always the case. Even Mulberry, which is the only IMAP client I’ve found that supports a workable disconnected mode, does not make frequently disconnected mode trivial to use - neither to keep IMAP mailboxes in sync nor to provide off-line lookup of LDAP databases.

But Cyrus is responsive and I am optimistic we might, someday, have a good solution. If not, Adobe Air is pointing the way toward a viable seamless connected/disconnected (or periodically disconnected) world. I think this will become increasingly essential as the world goes to frequently interrupted wireless connectivity. Currently we tolerate wireless (WAN) interruptions because we have to, but that rules out far too much of what we’d like to be able to do and solutions thus far are generaly ad-hoc. We need an imperfect WAN connected world that is perceptively as relaible as a wired one.

posted at 13:41:05 more on... Linux, reviews, technology  

Saturday, August 25, 2007

ZoneMinder on FC7

26828649.jpg

Overview
Zone Minder Config ZoneMinder 1.22.3 on Fedora Core 7

There are useful instructions at this URL

Do a basic install of FC7.

  • KDE seems to work better than gnome.
  • Remove unnecessary SW to speed install (desktop stuff)
  • Add Server and Development to get the right tools
  • Add http://rpm.livna.org/rlowiki/ as an RPM source
  • Make sure the necessary holes are in the firewall at 80

Add necessary bits
yum install mysql-server mysql-devel php-mysql pcre-devel \
perl-DateManip perl-libwww-perl perl-Device-SerialPort \
perl-MIME-Lite perl-Archive-Zip

updating perl (some will be installed already)
perl -MCPAN -e shell
install Bundle::CPAN
reload CPAN
install Archive::Tar
install Archive::Zip
install MIME::Lite
install MIME::Tools
install DateTime
install Date::Manip
install Bundle::libnet
install Device::SerialPort
install Astro::SunTime
install X10
quit

FFMPEG install

Note that getting the FFMPEG libraries installed so they work is a nightmare. I followed these instructions and they seemed to work:

First add the x264 libraries and devel from livna via software manager

If the database hangs try
rm /var/lib/rpm/__db*
rpm –rebuilddb
yum clean all

svn checkout svn://svn.mplayerhq.hu/ffmpeg/trunk ffmpeg
cd ffmpeg/

./configure --enable-shared --enable-pp \
–enable-libx264 –cpu=pentium3 –enable-gpl

make
make install
nano /etc/ld.so.conf

add the line “/usr/local/lib”
ldconfig

System demons

chkconfig --add mysqld
chkconfig –level 345 mysqld on
chkconfig –level 345 httpd on
service mysqld start
service httpd start

add to /etc/sysctl.conf to increase shared memory limit
kernel.shmall = 134217728
kernel.shmmax = 134217728

Zoneminder Install

Check the latest version of zoneminder at http://www.zoneminder.com/downloads.html

wget http://www.zoneminder.com/downloads/ZoneMinder-1.22.3.tar.gz
tar xvfz ZoneMinder-1.22.3.tar.gz
cd ZoneMinder-1.22.3

patch it

http://www.zoneminder.com/wiki/index.php/1.22.3_Patches

The configure command I used is:
./configure --with-webdir=/var/www/html/zm \
–with-cgidir=/var/www/cgi-bin ZM_DB_HOST=localhost\
ZM_DB_NAME=zm ZM_DB_USER=zmuser ZM_DB_PASS=zmpass \
CFLAGS=”-g -O3 -march=pentium3″ CXXFLAGS=”-g -O3 \
-march=pentium3″ –with-ffmpeg=/usr/bin \
–with-webuser=apache –with-webgroup=apache

putting a reasonable user name for “zmuser” and password for “zmpass”

make
make install

If make barfs with
/usr/local/src/ZoneMinder-1.22.3/src/zm_mpeg.cpp:284: undefined reference to `av_free(void*)'
try
”in src/zm_mpeg.h starting on line 26, add the lines with the + (removing the + of course) The other lines are just for reference and should be already in the file.” from this reference.

nano src/zm_mpeg.h

#define ZM_MPEG_H
+extern “C” {
+#define __STDC_CONSTANT_MACROS
#include <ffmpeg/avformat.h>
+}
#if FFMPEG_VERSION_INT == 0×000408

Install scripts
install scripts/zm /etc/init.d/
chkconfig –add zm

Create and configure the ZoneMinder database
mysql mysql < db/zm_create.sql
mysql mysql

at the mysql prompt:
grant select,insert,update,delete on zm.* to \
‘zmuser’@localhost identified by ‘zmpass’;
quit

mysqladmin reload

GO!
service zm start

you should get a nice green [OK].

http://127.0.0.1/zm

Black Screen? Go Faster?
No php?
If you have issues make sure you have installed apache php and perl modules.

IJG SIMD jpeg should double performance.
http://cetus.sakura.ne.jp/softlab/jpeg-x86simd/jpegsimd.html#source
* requires nasm which wasn’t installed. Use package manager.
wget http://cetus.sakura.ne.jp/softlab/jpeg-x86simd/sources/jpegsrc-6b-x86simd-1.02.tar.gz
tar xvfz jpegsrc-6b-x86simd-1.02.tar.gz
cd jpeg-6bx
./configure –enable-shared –enable-static
nano Makefile

* Change the CFLAGS from O2 to O3 and add
-funroll-loops -march=pentium3 -fomit-frame-pointer

make
make test
make install

identify the libraries to the system
ldconfig

I also copied the installed files from /usr/local/bin to /usr/bin:
cp /usr/local/bin/cjpeg /usr/bin/cjpeg
cp /usr/local/bin/cjpeg /usr/bin/cjpeg
cp /usr/local/bin/cjpeg /usr/bin/cjpeg
cp /usr/local/bin/cjpeg /usr/bin/cjpeg
cp /usr/local/bin/cjpeg /usr/bin/cjpeg

/etc/init.d/zm restart

NetPBM resizes the JPEGS and faster is better: compile and install
cd /usr/src
svn checkout https://netpbm.svn.sourceforge.net/svnroot/netpbm/stable netpbm
cd netpbm
/usr/src/netpbm/configure

Answer the questions (GNU and then defaults - I didn’t have TIFF or VGA libs, so “none”)
vi Makefile.config
I added -march=pentium3 to the CFLAGS at the end of the file
make
make package
/usr/src/netpbm/installnetpbm

accept defaults

cabozola install

* package add Ant (it needs ant, but it wasn’t installed by default)
cd /usr/src
wget http://www.charliemouse.com/code/cambozola/cambozola-latest.tar.gz
tar xvfz cambozola-latest.tar.gz
cp /usr/src/cambozola-0.68/dist/cambozola.jar /var/www/html/zm
chmod 775 /var/www/html/zm/cambozola.jar

posted at 01:44:34 more on... Linux, technology  

Wednesday, August 15, 2007

Linux 342

An IBM 342 with a ServeRAID 4lx is a fine machine, but getting Linux to install is less the effortless. Emacs!

2d238159.jpg

I’m trying to get zoneminder to work on this very nice IBM 342 with a serve raid card and some good drives and 3 video capture cards. The thing should be able to capture 12 streams of video simultaneously, or 6 at full 30FPS. But getting Linux variants to properly recognize the serveraid card is a challenge.

The Mandrake LiveCD install works great on IDE systems, no problem at all. But it doesn’t see the serveraid, so that one was out. Gentoo saw the serveraid card, and since video capture and real time analysis is one of those things that would be good to do fast, the gentoo optimization scheme seemed promising, but it wasn’t. Just a miserable series of failed compiles and fixes that went on endlessly.

So from there to Debian, which is very nice and since it is the parent of Ubuntu and there’s an Ubuntu package and Carolyn loves Ubuntu, that seemed worth a shot. It does see the Serveraid, but there seems to be a bug in the IPS.o driver which reared it’s irritating head during package installs causing hangs, even after I updated the firmware to 7.12.12.

So that was out. On to a distro officially supported by IBM: Suse. That installed great, easy no problem, detected all the ADCs on the capture cards and everything. Very easy to install, but there are some weird bugs with ffmpeg that hung the compile of Zoneminder. It descended into another endless series of patch and edit and retry effort to get through the compile….

Then I saw that Fedora 7 has an RPM in the main distro for ZoneMinder. It is officially supported by IBM and seems rock solid. So far the network install has gone well - the install CD is only 7.71 MB (!) and it seems tentatively promising… it’s on the “Starting install process” screen, which is supposed to take several minutes. As it may need a few GB of data, I’ll give it some time. Unfortunately Fedora doesn’t support CD installs and the 342 has a laptop style CD-ROM drive, so doing a DVD install is out of the question. Network installs are efficient if you only have to do them once, but the retry is all penalty download.

posted at 15:05:15 more on... Linux  

Powered by WordPress