Feb. 5th, 2009

elfs: (Default)

I’m very fond of gaffitter, a smart little console program that scans a list of files and/or directories and fumbles through them until it comes up with a subset of that list that will fit in a given space.  It’s perfect for taking large directories of stuff and segmenting them into archivable collections.

I recently ran out of disk space on my desktop and realized I had hundreds, nay thousands, of music directories that I needed to put somewhere else.  I suppose I could have bought more hard drive space, but more than that I wanted a lot of it just to be put away.   I ran gaffitter on the collection with a limit of 4.2 GB, the reliable size of a data DVD, and it said I had about 35 collections worth.  Great, I thought, but how to organize the output of gaffitter into subdirectories that I could then burn onto DVDs?

For that, I wrote mass_gaffiter.py.  It’s a very simple little script that uses gaffitter’s regular output as its input, and then turns around and spits out another script (a shell script this time) that, for each collection gaffitter has identified, creates a subdirectory and moves everything in that collection into the subdirectory.  When it’s done, your cluttered directory is organized into a collection of subdirs named “gaf_disk_01″, “gaf_disk_02″, etc., all ready for growisofs or whatever other DVD burning software you like.

I’m trying to get into the habit of sharing the little utilities in life that I can’t work without.  I think of them as little throwaways, but some of them I’ve kept for years, so I figure someone else might have good use of them. Here’s mass_gaffiter.py:

#!/usr/bin/env python

import sys
import re

re_m = re.compile(r'^\[(\d+)\] Sum')

f = open(sys.argv[1], "r")
accum = []
for l in f:
    g = re_m.match(l)
    if not g:
        accum.append(l[:-1])
        continue

    print 'mkdir gaf_disk_%03d' % int(g.group(1))
    print 'mv %s gaf_disk_%03d' % (
        ' '.join(['"' + i + '"' for i in accum if i]),
        int(g.group(1)))
    accum = []
This entry was automatically cross-posted from Elf's technical journal, ElfSternberg.com
elfs: (Default)

Mourning cards
You might wonder what would cause such an outpouring of grief. These cards read "We'll Miss You" and "Rest In Peace," and they were left at a very public place. A place Omaha and I visited not less than a month ago.

The Keg was one Burien's highest of high-end restaurants. It was well-run, and the food was usually better than other Kegs in the area. The place was always packed, every time Omaha and I went, no matter the time of day or the day of week. For it to just vanish like this, with little warning, stunned both of us more than just a little. And it's understandable that it would cause the kind of reaction I've photographed here: the regulars loved it because it was so good, and because there's nothing else really like it in our area. We'd have to go into Seattle to get a decent steak; there's no place over at Southcenter that really does it quite so well.

Goddamn. That's sad. Sigh. I make a really good steak (just ask [livejournal.com profile] lisakit), but sometimes I want someone else to do it for me.
elfs: (Default)

I’ve been reading Iain Banks’s Matter, and I have to say that while I’m only on chapter 4, Banks’s new book is edging dangerously close to being a book easy to put down and never pick up again. Chapter 4 features one of the longest infodumps I have yet to read in a Banks novel, a long if colorful description that seems no end with Banks smirking at his audience saying, “This is my setting. Isn’t it cool?”

Actually, Iain, no, it’s not cool. Superstructures are old hat, as are abandoned giant manufactured worlds, even ones that occasionally kill you. I’m sure you’ll do something interesting with your usual mix of characters, ending with some wry observation on human nature that may or may not be completely off base, and possibly attempting to reach for some crowning moment of awesome that quite possibly will leave some of your audience starstruck and the rest of us going, “Yeah, that was almost as good as Karl Schroeder dropping a house off the edge of a ringworld in Lady of Mazes.”

Anyway, Matter feels like a classic Banks chess game: lining up all his pieces and then playing them off one against the other, kings, queens, knights, bishops, and pawns. I’ll read it all the way through, I’m sure. Banks’s literatary skills are good, honed so sharp even a formulaic Culture novel can survive being formulaic. The info dump is heralded by four pages of a dialog between two aliens in which just enough is revealed to make you want to read the infodump just so you’ll know what the hell those two are talking about, and followed by the characters resuming their conversation as if any listeners were now fully educated, although with some foreshadowing so painfully obvious it had better red herring in the end.

This entry was automatically cross-posted from Elf's writing journal, Pendorwright.com. Feel free to comment on either LiveJournal or Pendorwright.

Profile

elfs: (Default)
Elf Sternberg

December 2025

S M T W T F S
 12345 6
78910111213
14151617181920
21222324252627
28293031   

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Feb. 9th, 2026 02:29 pm
Powered by Dreamwidth Studios