The AADL Developer's Blog. Technical info about what new features we're working on, releasing, and playing with.

Using RedLaser with AADL

Thanks to the help of rjstoneus, if you have an iPhone and use the RedLaser application you can use it to search the AADL Catalog, MelCat and World Cat.

Redlaser

To install the additional options you will need to visit the following links on your iphone in safari. You then save the bookmark to your home screen.

New Public Computers - Hardware

Computers at Traverwood Branch

We recently overhauled the public computing setup at AADL, though it hasn't been rolled out at all the branches yet. It consists of a mix of linux hosted web management software, linux thin clients and windows terminal servers. It is a bit of a unique setup so figure I should share. Once we get it farther towards complete we'll probably release the code.

Some History

For some background the previous setup consisted of windows thin clients and windows servers running Citrix. The thin clients had published application sets that connected to a fairly basic server farm. The farm wasn't really setup well resulting in high loads and slow logins. A custom set of flash applications and php gateways administered it all.

As I researched options I decided I wanted to drop Citrix as I didn't really see it as needed and the licensing costs aren't exactly small. I also decided I would prefer as much be opensource as possible though we decided on keeping Windows for the public facing part for now.

I tested out quite a few public computing management software, lockdown software, cyber cafe software but didn't really find anything that did everything I wanted, kept it fairly simple, was flexible, etc. For reference here are a few things about our setup:

  • Patrons can use the computer as long as they want without interruption unless there are other patrons waiting for a computer. They have a minimum 30 minutes if there is a line, after which they are given 5, 2, 1 minute warnings.
  • They can be idle for a total of 10 minutes before being ended (given a warning after 5)
  • They swipe their card at an assigner first that gives them a station. These are spaced out then random

The New Thin Clients

Debian Thin Clients

The thin clients we settled on are HP Compaq t5735 Thin Clients. In bulk they ran under $250 each. The specs worked out for what we needed:

  • VESA mountable on both sides. Made it easy to securely mount to tables and even to the back of monitors
  • 1 GB Flash, 256M RAM
  • VGA and DVI
  • Lots of USB ports including back, front and secure (within case)
  • Debian Linux preinstalled (stock plus some custom HP packages)

The thing I like most about the thin clients is the imaging process. The clients come with a HP programs called HPThinState which can write a bootable imager to a USB drive. Once the USB is imaged you can boot other machines from the USB and walk through a simple imaging process. The process is simple enough that front line staff now image machines themselves when needed (usually ext3 partition corruption after power failure). This has significantly cut time of IT staff and reduced how long a client is out of order for simple problems.

Another nice thing is that all changes are put on flash immediately, no special write/flashing software needed. You can apt-get upgrade and have the changes there on reboot with no further interaction.

Break Out Boxes

One of the biggest problems we had previously was USB ports being damaged on clients. We tried multiple things like hubs, etc but nothing really lasted. Our latest attempt is using a modular box that is meant to be inserted in a 5.25 cd bay on a tower. We put 2 usb extenders and a headphone jack extender in it and mount it to the table. This leaves an easily replaceable port and also lets us move the thin client out of harms way. So far this has worked great and we haven't had to replace a port yet. At about $10-12 it can't be beat.

Modular USB Boxes

Other Hardware

We have USB floppy drives available for use and may expand to other formats. The monitors are stock though we add on privacy screens. Each station is also equipped with a USB based barcode reader that is used for signin purposes.

We also have one of the thin clients VESA mounted to a monitor and barcode reader that acts as the assigner.

More information on the actual software / workflow behind it coming up in a second post. Overall though we've been really happy with the hardware described above. Really stable and much better priced.

Infrastructure Upgrade: Online CD Previews

About the Upgrade

We've been working hard lately on an aadl.org infrastructure upgrade that includes updates to Drupal, SOPAC and the servers that run the site.

While it will still have the same look and feel, behind the scenes we've made changes to speed things up, fix bugs and give us a robust platform to more quickly roll out new features and bug fixes. You'll notice most of the changes in the catalog which was completely revamped. Below is one such update to the catalog you can look forward to when we go live with the changes.

Stay tuned for more previews and please leave any feedback and suggestions you have.

Online CD Previews

AADL CD Preview Station

You may have used our CD preview stations that are present in our branches. They allow you to scan a CD and listen to samples of the tracks. Thanks to the company that produces our stations we were able to get a head start on moving these samples online. Here is a screen shot of the tracks for Big Dave and the Ultrasonics:

cd preview

The display is based on the BSD licensed project SoundManager 2. While we're starting small with just simple previews the project supports more advanced scripting of volume and playlists which we can hopefully take advantage of. This also opens the door for featured previews, playlists and the like.

Currently our sample collection is rather incomplete but we hope to fill it out and hopefully get some of our more unique and obscure items up for easier discovery.

If you have ideas of projects/ideas that can take advantage of this new track and preview data, please leave a comment.

New Public Computers

This past week we rolled out our new public computer stations at the Malletts Creek branch, bringing the number of locations with our new system to three (the others being Traverwood and West). The new stations have a few features that improve both hardware management and the user experience:

Traverwood Thin Clients

The new thin clients have standard VESA mounts on both the top and bottom. The bracket splits into two parts, with one part attaching with screws to the client and the other attaching to the table. Once you've made your cable connections you slide them back together. Super easy, and very solid. The thin clients run a customized version of linux, which gives us more control over configuration and remote access than the embedded windows of the old system. Once you log in to a computer, it launches a full screen remote Windows session, which is transparent to the user.

Easy Parallel Processing with PHP on the Command Line

Developers often come across tasks that can be sped up with Parallel processing. When there is a lot of repetitive tasks to be done, which can be split into independent parts, being able to run multiple processes simultaneously can speed the job up immensely. A good example is a running some calculation on every line of a huge report. Here's how I was able to make a command line script in PHP that allowed me to break a process into parts and process them all at the same time. One caveat: this technique only works on the command line and on Linux/Unix servers.

Part 1: starting another process from within PHP using exec()

The exec() function will run the command given to it. Normally, your PHP script will wait for the command to complete before proceeding, but if you redirect the output to a file and end the command with a '&', exec() will run the process in the background. so instead of writing

exec("ls -al");

you can write

exec("ls -al > listing.txt &");

and your script will create a new process and then proceed to the next statement immediately.

Part 2: make your function recursive with $argv

Drupal Development Tricks

Last week I was privileged to attend the drupal4lib camp at Darien Library. I was prepared to give a lightning talk on my development environment for drupal but we ran out of time. I thought I'd share a couple of tricks I've found here. Nothing earth shattering, but they've become very helpful to me in my day-to-day code monkeying.

1) Use SSHFS to access remote files

Greetsaver Update

GreetsaverQC
As requested by superpatron Ed Vielmetti, here's a fresh link to the latest and greatest version of our "GreetSaver", which welcomes patrons and visitors to various locations of the Library.

This should work on any Mac running OSX Leopard, but there's a bit of additional configuration that must be done. You need to subscribe to the AADL video podcast, and you need to put some awesome library pictures into a new folder called "GreetPics" inside your Pictures folder (~/Pictures/GreetPics for you terminal geeks out there).

*UPDATE* I forgot I used a custom patch to grab the video files on the welcome page. If you want them to show up follow these instructions:

  1. Download the latest Folder Movies patch from Kineme: http://kineme.net/QuartzComposerPatches/FolderMoviesPatch
  2. Create a new folder in /Library/Graphics called "Quartz Composer Patches" (there should already be a folder there called "Quartz Composer Plug-Ins", don't use that folder)
  3. Copy the FolderMoviesPatch.plugin file into this new folder "Quartz Composer Patches"

This should make a random movie from the AADL video podcast display on the welcome screen.

Enjoy, and throw me a note if you have questions or want to mash it up.

You want to Ubuntu?

I'm sure many of you have seen Jessamyn's awesome video installing Ubuntu on a couple of donated library PCs. I made the switch to Ubuntu for my primary desktop workstation here at AADL after we had a windows virus get loose on our network and I was fed up. I never looked back, even after the virus was summarily squashed.

If you're looking to jump into or even experiment with Ubuntu, this week might be the time to go for it. The latest version of Ubuntu, code named Hardy Heron, is scheduled to be released April 24. Ubuntu releases new major versions about every 6 months, but only once every two years do they label a release as Long Term Support (LTS), which means it will be supported for 3 years for the desktop (5 years for the server edition). The last LTS release was code named Dapper Drake, released in 2006. This version also includes tools that makes it even easier to try Ubuntu, letting you install it like an application inside Windows to try it out.

Ubuntu 8.04 Long Term Support (LTS) provides a stable platform for software and hardware vendors, developers and users. With three years of support and maintenance on the desktop, 8.04 LTS is a great choice for large-scale deployment. A substantial and growing ecosystem of free and commercial software built for Ubuntu provides a rich set of choices for desktop users. This is the eighth desktop release of Ubuntu. Ubuntu's track record in delivering - on a precise schedule every six months - a commercial operating system that is free, stable, secure and fully supported, remains unique. (read more...)

Specific to my geekly duties at AADL, here are some of the applications I use on Ubuntu:

  • Gimp: Great image editor, perfect for quick crops and resizes as well as multi-layer intensive editing. (included in Ubuntu)
  • Firefox: not only works with flash, but all the great Firefox plugins like Adblock plus, firebug, and greasemonkey. (note Firefox 3 beta 5 is included in Hardy)
  • OpenOffice: able to open and edit MS Office docs, still a necessity in this day. (included in Ubuntu)
  • Komodo Edit: a free PHP editor with code completion and syntax highlighting. (Download linux version here).
  • VMWare Server: I've been unable to find a email client that can establish a consistent and stable connection with our Exchange server for email, so I installed XP and Outlook2003 in a virtual machine in VMWare Server. Also nice when I need to test something in Internet Explorer or another Windows-only app. (Download linux version here)
  • Flex Builder: Adobe has an alpha of their Eclipse-based Flex editor for linux. Unfortunately it doesn't include the Design view, but the code completion and compiler work just right. (Install info here)
  • Innovative Millennium: Yes, because the Millennium client is Java based, it works just as well on Linux as any other platform. (download from csdirect)

So give Ubuntu a shot. You might never look back.

PHP Class Notes

Below is the sample code I created during a PHP class on Tuesday. I'm planning to cover storing and retrieving data from MySQL on Thursday, plus some more practical examples of web applications. If you have any questions or suggestions, log in and comment or send me an email.

<html>
    <head>
        <title>Example</title>
    </head>
    <body>
    <form action="test.php" method="post">
    First Name:  <input type="text" name="first" /><br />
    Last Name: <input type="text" name="last" /><br />
    <input type="submit" name="submit" value="Submit me!" />
		</form>
        <?php
        echo "<p>" . date('l dS \of F Y h:i:s A', time()) . "</p>";
        
        if ($_POST)
        {
        	$first_name = $_POST['first'];
        	$last_name = $_POST['last'];
        
        	if ($first_name == "Eric")
        	{
        		echo "Authorized User: ";
        	}
        	else
        	{
        		echo "Unauthorized User: ";
        	}
        	echo $first_name . " " . $last_name ;
        
        	echo "<pre>";
        	var_dump($_POST);
        	echo "</pre>";
        
        	echo "<table border=1>";
        	foreach($numbers as $number)
        	{
        		echo "<tr><td>" . $number . "</td></tr>";
        	}
        	echo "</table>";
        }
        ?>
    </body>
</html>

Events, Twitter and iCal

We recently redid the backend for out events here at AADL. While you probably haven't seen many changes on the public site, we now have the backbone that will allow us to create all kinds of cool things and improved events. Online registration, My Events, reminders. All kinds of things will be possible.

Twitter

To test out the new system we made a few quick applications to take advantage of it. The first is a Twitter feed at http://twitter.com/aadl which gives announcements of events 30 minutes before they begin, among other things. Within a couple days there was already over a dozen followers. The twitter feed utilizes a PHP5 class that can be found at http://groups.google.com/group/twitter-development-talk/files which was coupled with a few simple calls to our events API. With our class and the Twitter class it took very little time to get up an running. A cron takes care of the rest.

iCal

Another big feature is iCal feeds that can be subscribed to for out events. This is still under active development so you may experience some occasional issues. Feel free to comment if you have any suggestions or problems. Here are the URLs currently available. I'll update the list as I add them. Only the Exhibits feed shows exhibits until I can fix some of the all day events so they don't clutter up your calendar.

  • All Events : http://api.aadl.org/ical/all
  • Exhibits: http://api.aadl.org/ical/exhibits
  • Downtown Events: http://api.aadl.org/ical/all/downtown
  • Malletts Events: http://api.aadl.org/ical/all/malletts
  • Pittsfield Events: http://api.aadl.org/ical/all/pittsfield
  • West Events: http://api.aadl.org/ical/all/west
  • Northeast Events: http://api.aadl.org/ical/all/northeast

To get events for a specific keyword you can do the following (replace keyword with your word of choice)

http://api.aadl.org/ical/search/keyword

Again, send any comments, suggestions or problems. Once the iCal becomes more stable you should see easy links on out website.

Syndicate content