fogbound.net




Wed, 28 Nov 2007

Linux Security Camera Server on a Dell Vostro 400

— SjG @ 11:17 am

So I’ve been building a new security camera system. The last time I did this, I bought a Dell dual-core box, and spent about a week installing Debian, and building and rebuilding the kernel to support the dual cores, to support the BT878 video capture chipset, compile and configure motion, etc. It took a week of evenings and a weekend or two, because the Dell hardware wasn’t automatically supported, and it required special boot-time parameters to recognize the SATA controller, for example.

So I’m building a new system on a Dell Vostro 400. Right off the bat, I ran into problems with installing the Debian net-install. I was booting off a CD, but the installer couldn’t find an ATA/IDE controller for which it had a driver. Weird. This article showed me the solution to that — set the Dell controller’s SATA mode to “RAID.”

But then I hit a wall with the Intel Gigabit network controller. I couldn’t find any workarounds for it, but, after extensive Googling, found that some of the Ubuntu people may have a patch. The posting was six months old.

So screw it, thought I, and downloaded a shiny new ISO of Ubuntu 7.10 Server Edition to see whether it would work.

Damn, am I impressed! Not only did it recognize the ATA/IDE controller and the network controller, it happily recognized the BT878-based card and loaded the kernel modules. It even has motion installed as a package for easy installation. I was able to copy over all my support scripts and motion configuration files, and was up an running in less than two hours (and that includes setting up the web server, motd, special sshd tweaks, and all)!

Now, all I have to do is deal with my crisis of faith. Do I leave the Church of Debian for the radical new Ubuntuist movement?


Sat, 17 Nov 2007

Aperture Import Script

— SjG @ 7:14 pm

So, after the demise/µsoftification of iView Media Pro, the time came to switch to Aperture.

However, while Aperture is mighty powerful, its limitation of 10,000 images in a project makes import of my photos difficult. What’s more, my … er … unique system of “organization” doesn’t natively work well with Aperture. My attempt at organization, which predates such things as iView, Aperture, or even a usable Bridge, is predicated on the idea of the filesystem as a hierarchical database of sorts.

For example, I start with a directory called “photos” and within it are directories for “animals,” “events,” “people,” “places,” “things,” “projects,” etc. Within “events” are “political,” “work,” “family,” etc. With each of these are either further taxonomic directories, or what might be equivalent to rolls-of-film directories, e.g., “MothersDay-2007-05-13” or “CocktailsAtBerris-2000-06-14.” Directories are all Unix-friendly (no spaces or crazy punctuation) and are generally CamelCase for multiple words.

So I went through a frustrating attempt to write a good Applescript importer. The problem with languages like Applescript (or Javascript implementations embedded in Adobe products) is that they promise more than they can deliver. They’re designed to interact with Applications, but generally don’t have rich access to application functionality. Why can’t I create a folder in my Aperture library in Applescript? Why can’t I get/set a single pixel in Photoshop with Javascript. Yes, I know both are possible through some crazy GUI-script calls or cryptic Event IDs, but why give me the equivalent of object-oriented access and then leave out all the important methods?

Well, enough ranting. With a lot of help from others who have gone before me and posted comments and, even better, code, I hacked together something that will read in my hierarchy, create a new Aperture Project for each leaf node on my tree, and convert the path to that node into a set of keywords which it will apply.

So “photos/events/family/MothersDay-2007-05-13” will become a project named “MothersDay-2007-05-13” and the images within it will all be tagged with the keywords: Events, Family, Mothers, Day, 2007-05-13. It’l also throw in copyright notices and author name.

There’re provisions for excluding words from becoming tags (e.g., “and”) as well as special case code for directories named “misc,” which I often use as catchalls for a taxonomical branch — these get named for the parent directory plus the “misc” (e.g. “ArthopodsMisc”).

Perfect? No. Better than doing it manually? Yes.

In any case, here it is:
Aperture Importer


Fri, 9 Nov 2007

Finding File and Directory Counts

— SjG @ 3:31 pm

So, in the process of organizing photographs, I wanted to examine my deeply-nested hierarchy to figure out how it’s possible I have 30,000 images (Aperture only wants me to have 10,000 in a project, so I need to re-organize the hierarchy even before I import).

So, I figured it’d be easy to use find to list all my directories, and how many images they contain. It turns out that (at least for me) it’s not.

My best stab so far is to use find and a loop, which gives me almost what I want (it not only includes the count of images in the each directory, but subdirectories as well). It fails if there are too many directories. It’s good enough. But it’s not elegant.

So CLI Deities — how would you make this pretty?

find . -type d | while read dir; do echo `ls -1 "$dir" | wc -l` $dir; done

Potential type-face issue disambiguation: after the ls, that first argument is a one, not an ell, although I suppose an ell would work too. The wc option is an ell.


Wed, 10 Oct 2007

Further eAccelerator weirdness

— SjG @ 4:34 pm

As I described back in this article, I was getting segfault errors from eAccelerator.

I’m experiencing it on another, similarly-equipped GoDaddy VPS server. Same software versions, even, for Apache, PHP, eAccelerator, and OS, although this is not a old CMS Made Simple install.

Still, no good solutions out there, as far as I can google.

Here’s the clues I have found:

  • The syntax function fun_name ($arg = array (blah)) is fatal.
  • The order in which PHP extensions are loaded might matter.
  • There are issues with files that get included or required multiple times via different paths.
  • Software versions are just Too Old.

This is teh suckage.

Next thing I’ll try, when I have the time, is to upgrade the VPS to Fedora Core 6, and see if pushing those version numbers up a bit helps.


Windows Update

— SjG @ 10:51 am

Windows update just told me it was installing a “Malicious Software Removal Tool.”

Gosh, I hope that the virtual hyphen is between the first two words, rather than the second.

*sigh*