Thursday, July 30, 2009

In Solaris 10, $EDITOR cannot contain arguments.

Some people got into the habit of setting the UNIX environment variable $EDITOR to a command and its arguments, for example "emacs -nw". This is no longer supported by crontab(1), as of Solaris 10. It doesn't seem to be documented anywhere, but Solaris 9 executed the editor command by running "sh -c", but Solaris 10's crontab command, instead, splits $PATH, joins $EDITOR to it, and runs execve(2) on each in turn until one works. Thus, it will try and run a program named "emacs -nw", not a program named "emacs" with an argument "-nw".

Nice undocumented change, Sun!

Wednesday, July 8, 2009

NFSv4 ACLs and chmod annoyances

The implementation of chmod -R with NFSv4 ACLs is very broken. Particularly when removing them. You can only remove ACL entries recursively if they are present at all levels of the path. If they're not there at any level, chmod will error out as soon as it finds one.

So the only way to reliably remove an ACL entry across a set of files is with find . -exec chmod A-<acl entry> {} \;.

Monday, February 9, 2009

Obfuscated perl

For my own amusement, I like writing Perl as if it were a functional language, with lots of map()s, grep()s and join()s. Here's a fun example, commented up. What it does is print out all the capitalized words in a document that are not found in the system dictionary.

I was using this for the Kencyr Wiki on the HTML versions of the E-books, looking for proper names I hadn't defined in the Wiki.


#!/usr/bin/perl -w

# We just use a hash for its side-effect of quick keyed lookup
my %dictionary = map {chomp; tr/A-Z/a-z/; $_, 1} `cat /usr/share/dict/words`;

# Here, a hash is used for its side-effect of key uniqueness. The list returned by the first
# map() contains duplicates, but they are "flattened" when assigned to a hash.
my %allcapwords =
(map {$_ => 1} # Make hashy
(grep {not defined $dictionary{$_}} # sieve out only the undefined ones
(map {tr/A-Z/a-z/;s/\W+$//;$_} # Post-massage; lowercase; remove trailing garbage
(grep {/^[A-Z][a-z]/} # Only capital-then-lowercase words
# pre-massage; remove HTML and then split into words
(map {chomp; s/<[^<]+($|>)//g; s/&\w+;/ /g; split /\s+/; } <>)))));

# And output it all. We only ever were interested in the keys; the values were always 1
print((join "\n", keys %allcapwords) . "\n");

Wednesday, December 31, 2008

Kencyr Wiki

I've launched a new Wikia project: the Kencyr Wiki, which is a Wiki on the Kencyr novels by P. C. Hodgell that follow Jame, AKA Jamethiel Priest's-bane, who's a wonderful female anti-hero. This is a series of four novels and a short story collection, with a fifth novel in the works, and is a bit of a underground, cult fandom—the series has had a very spotty publication history. Pat now has Baen signed up to publish her works, though; they've released them all as ebooks and will be re-releasing the old books in new paperback form. The first comes out this month, so take a look!

Anyway, we're now at over 200 articles; granted, most are quite stubby so far, but there are several longer treatments already. I've picked up a few other contributors and am hoping for more; I've also had a promise of a logo from an artist, and Pat Hodgell herself has pointed to our new baby Wiki from her blog at tagmeth.livejournal.com.

Our aim is an obsessive, totally geeky level of detail.

Thursday, October 16, 2008

The Crüxshadows at The Knitting Factory, Hollywood

Brittany Bindrim of I:Scintilla Jennifer Parkin of Ayria Rogue of The Crüxshadows Porcelain Doll Valerie Gentile, Ayria fan Sarah Stewart of The Crüxshadows

My photos from Monday's The Crüxshadows show with I:Scintilla and Ayria at The Knitting Factory, Hollywood are now up on my Flickr photostream.

Monday, October 6, 2008

Tamron 70–300mm f/4–5.6: Great cheap lens, but choppy bokeh.

The Tamron 70–300mm f/4–5.6 Di LD MACRO 1:2, to give it its rather unwieldy full name, is a wonderful lens for a very bargain price: only about $150 street, for a lens that's really quite impressively sharp, rendering very fine detail, and with good color reproduction besides. Take it from me, you will be blown away comparing it to your kit lens—I was—or, for that matter, to your camera maker of choice's budget 75-200+ offering, for less money than that lens too. It also stays at f/4 for longer—not dropping to f/4.5 until 135mm.

Of course, you don't get perfection for only $150. (It could be argued that you don't get perfection for $1,500 either; lenses are by their nature compromised to greater or lesser degree).

The bokeh wide open is a little compromised; it's bright-ringed around the outside of the out-of-focus circle, which makes the overall look of the bokeh a little choppy:

Fern setting up for the performance Angela at Pagan Pride '08

The objectionability depends on the nature of the background, of course; here, the second image blends together much better.

Stopped down, though, the bokeh improves.

The other issue is chromatic aberration on specular highlights, which is obvious but not objectionably so IMO; others might disagree.

Friday, October 3, 2008

Flickr encourages square format

The squarer the format, the larger the total area of photograph displayed in Flickr; this is especially important when only the Small size of photos is displayed. The tinier the photo, the less the impact, I find; thus, there is pressure towards the square format there (as there is anywhere that photos are fitted into a square bounding box).

I thus find myself looking for the square crop in the viewfinder and especially during editing. Moreover, I'm liking the square crop.

Anyone else?