fogbound.net




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.


Thu, 1 Nov 2007

The Discovery of Witches

— SjG @ 7:07 pm

Matthew “Witch Finder” Hopkins, 1647, read as a ManyBooks.net publication of a Project Gutenberg text.

A little too scary for Halloween, this short missive is the earliest FAQ I’m aware of. But it’s chilling — it’s a series of answered questions justifying the author’s methodology for identifying witches.

The answers, and their oh-so-reasonable tone, are completely unbelievable. They didn’t use sleep deprivations on the suspects — the suspects refused to sleep, for fear that their familiars would visit. Hopkins didn’t accuse women based upon marks such as moles, “devil’s teats,” or other “unnatural” markings — it was a committee of learned people who could differentiate between the natural and unnatural. And they didn’t drown witches — the waters would reject a witch just as a witch would reject baptism.

He goes on in this vein, and each answer is more depressing and disturbing than the last.

It’s a potent reminder that people will do terrible things for power or money, and attribute their motives to religion.


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*


Mon, 8 Oct 2007

Microfiction: Aachen’s Corvid

— SjG @ 9:14 pm

(In order to better motivate myself to work on a novella that I started last year, I plan to occasionally post little excerpts, sketches, and ideas here. These may or may not wind up as part of the final work, if in fact, a final work ever is produced.)

Strutting along the antenna, twenty stories above the crashing sea, the crow was a moving painting, colored vividly by the light of the setting sun. Ruffled feathers, glittering eye, he was an agitated study in deep charcoal, cobalt blues, and oil-slick opalescence.

On many a day, this crow might be found here, admiring himself, studying his fine reflection in the glass of the control system dials. Or he might be frolicking in the stiff updraft of the winds rushing over the seawall, or croaking out territorial challenges, or flirting, soaring low over the rookeries, or talking history with the murder, recounting the histories of the surrounding places (histories that generally revolved around the memories of particularly fine scavenging). But not today.

The others were keeping distant. Earlier, they had fluttered away upon his approach. The crow paced, turned to peck at the itch of a mite. The morning, so recent, was a muddled confusion. Now images, fragmentary and alien, flashed into his thoughts. He contemplated briefly a sudden, unbroken dive down to the sea-rocks, shattering amidst the ruins of this waning day.

Words formed. Words that were unfamiliar, but their meaning was clear.

The crow didn’t dive. He didn’t look at his reflection in the machinery of the pumping station. He knew what he would see. He’d seen the glint of metal on the back of crows’ heads before.

He knew that he had been split apart from the murder forever.