Categories
general

Automatic writing

I haven’t been writing in a while. I still feel like my last great writing project was Rumored to Exist, which shipped in 2002. Everything since then has been a greatest hits or a remix or a collection or something that I started and then watched die on the vine. I’ve managed to get a few good short stories hashed together in the zine, but it starts and ends there.

And in the last year, forget about it. I haven’t been able to spend more than ten seconds in front of my home computer, given my work schedule. I thought about a lot of different book projects, and would chip away a few words here and there, but I think in the last year, I’ve managed to write maybe a few thousand words. I did finish one short story, and I sort of dicked around with a few ideas for books, but never committed. And like waking up one day a decade after college and finding oneself fifty pounds overweight, I simply do not write anymore. It might be like riding a bike to some people, but I think it’s a perishable skill, and if you don’t sit down and work on something every day, it goes away. I now flip back to some of my old writing, the books or even stuff on here, and I’m amazed at how much better it is than anything I’ve tried to do in the last few months. And it’s because I used to write every god damned day, and now I write about as much as I go to the gym, which is basically never.

I’ve been talking to my friend Michael about this, and finally came to the conclusion that I just need to man up, wake up earlier every day, and pound out some writing every day, even if it is not for a project. That was the original intention of this journal, to give me some practice every day before I got to the actual writing. But there are a lot of political reasons I can’t just dump anything in here. I’m always afraid of who will read it, and I want things to have a start and a finish, and I want to match a certain theme, and blah blah blah and then I end up paralyzed by fear and unable to write anything. But I need to write SOMETHING.

That’s when I decided I needed to dump more into automatic writing. I’m not talking about the spirit world trance writing bullshit; I mean sitting down at the keyboard, starting with a thought, and just typing, dumping thoughts straight into the buffer with no concern about plot or structure or underlying anything, just brain to hard disk, trying to capture a scene or a feeling. I don’t know the history of this method; I guess Kerouac was pretty hip to it. But my goal was to sit down at 5:30 AM, eat my bowl of cereal, and speed-type down a thousand words a day of something.

I dropped this into my .emacs file:

(defvar write-directory "~/writing/automatic-writing")
(defun writing ()
  (interactive)
  (find-file
   (expand-file-name (format-time-string "%Y%m%d.txt" (current-time))
                     write-directory))
  (goto-char (point-max))
  (newline)
)

(global-set-key "\C-c\C-w" 'writing)

Now I can hit Control-C Control-W in emacs and open up a text file with today’s date, and type away.

I’ve been doing this for the last two weeks, and it has been amazing. I’m just writing stupid stuff, memories of old computers and cars and places I’ve lived, bits I’ve vaguely forgotten and have never put into stories, or things that don’t even make stories but have some good potential for description. I think of an idea in the shower, then without thinking too much, start hacking away. I’ve really been able to knock the rust loose, and I feel like my ability to write is coming back. I am not assembling together the next War and Peace or anything, but it’s something I’m thoroughly enjoying, and I look forward to doing it every day.

My next goal is to (maybe) try to get up a hair earlier, and see how I can work on actually getting the next book going. Or maybe I need to actually focus on a list of vague topics, and see if I can eventually knit together a hundred days of this stuff into something more substantial. But for now, a thousand a day, until I can do it in my sleep. (I sort of am doing that already…)

Categories
general

Shell scripting will eventually kill me

I spent two hours the other night trying to hack out a shell script to import the archives into this thing. WordPress doesn’t have a simple way to just suck in a bunch of text files; you need to assemble them into something that resembles an RSS feed, and then import that. This brought up two problems:

1) All of the posts had to be on a single line in the element. This involved a bit of dicking around with awk and then sed before I finally gave up and realized I could do it faster with tr.

2) The pubdate element had to be in RFC-822 time format, and the only thing I had to work with was the filename, which was in YYYYMMDD format. It took most of the two hours to figure out the god damned /bin/date program that ships with OS X is fundamentally broken, and ALL date commands in unixes are broken, because instead of curing cancer or stopping wars, about 80% of our world’s brainpower goes to stupid pursuits like “oh, I have philosophical issues with the 87 flags offered in BSD’s date program, so I’m going to write a completely incompatible one with 73 flags of its own, but still fail to address the two or three things people need to do with a time program.”

Case in point, this DOES NOT work in OS X:

date -j -f "%Y%m%d" "20090930" +"%+"

This DOES work:

date -j -f "%Y %m%d" "2009 0930" +"%+"

But my filenames are 20090930.html and not 2009 0930.html. That extra fucking space killed me.

AND YES, I am sure I am just an idiot, and if I sat around all day writing shell scripts, I would KNOW that blah blah blah hidden flag blah blah blah run it through a perl script blah blah blah. But truth of the matter is, I write maybe a half-dozen lines of shell script every three months, and then promptly forget everything. I’m sure if I sat around all day slicing onions into cubes, I would be a god damned onion slicing master, but the truth of it is, I only need to cut up maybe one onion a week tops, and I’m not about to quit my day job just to sit around slicing up onions.

Here’s the script:

for f in ~/website-mirror/oldjournal/html/1997*.html; do
    echo "<item>"
    OLDDATE=`basename -s .html $f`
    THEYEAR=`echo $OLDDATE | cut -c1-4`
    THEREST=`echo $OLDDATE | cut -c5-8`
    SHIT=`echo $THEYEAR $THEREST`
    pubdate=$(    date -j -f "%Y %m%d" "`echo $SHIT`" +"%+")
    echo -n "<pubDate>"
    echo -n $pubdate
    echo "</pubDate>"
    echo "<category></category>"
    echo "<title></title>"
    echo "<content:encoded>`tr '\n' ' ' < $f`</content:encoded>"
    echo "</item>"
done