<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>The Wrath of Kon &#187; hacks</title>
	<atom:link href="http://rumored.com/tag/hacks/feed/" rel="self" type="application/rss+xml" />
	<link>http://rumored.com</link>
	<description>Dispatches, news, stories, and ramblings from fiction writer Jon Konrath</description>
	<lastBuildDate>Fri, 10 Feb 2012 02:33:12 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Automatic writing</title>
		<link>http://rumored.com/2009/10/03/automatic-writing/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=automatic-writing</link>
		<comments>http://rumored.com/2009/10/03/automatic-writing/#comments</comments>
		<pubDate>Sat, 03 Oct 2009 20:46:07 +0000</pubDate>
		<dc:creator>jkonrath</dc:creator>
				<category><![CDATA[general]]></category>
		<category><![CDATA[hacks]]></category>
		<category><![CDATA[writing]]></category>

		<guid isPermaLink="false">http://rumored.com/journal/?p=336</guid>
		<description><![CDATA[I haven&#8217;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 &#8230; <a href="http://rumored.com/2009/10/03/automatic-writing/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I haven&#8217;t been writing in a while.  I still feel like my last great writing project was <a href="http://rumored.com/rumored">Rumored to Exist</a>, 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&#8217;ve managed to get a few good short stories hashed together in <a href="http://www.paragraphline.com/journal/">the zine</a>, but it starts and ends there.</p>
<p>And in the last year, forget about it.  I haven&#8217;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&#8217;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&#8217;s a perishable skill, and if you don&#8217;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&#8217;m amazed at how much better it is than anything I&#8217;ve tried to do in the last few months.  And it&#8217;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.</p>
<p>I&#8217;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&#8217;t just dump anything in here. I&#8217;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.</p>
<p>That&#8217;s when I decided I needed to dump more into automatic writing.  I&#8217;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&#8217;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.</p>
<p>I dropped this into my .emacs file:</p>
<pre>(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)</pre>
<p>Now I can hit Control-C Control-W in emacs and open up a text file with today&#8217;s date, and type away.</p>
<p>I&#8217;ve been doing this for the last two weeks, and it has been amazing.  I&#8217;m just writing stupid stuff, memories of old computers and cars and places I&#8217;ve lived, bits I&#8217;ve vaguely forgotten and have never put into stories, or things that don&#8217;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&#8217;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 <em>War and Peace </em>or anything, but it&#8217;s something I&#8217;m thoroughly enjoying, and I look forward to doing it every day.</p>
<p>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&#8230;)</p>
<p><a class="a2a_button_google_reader" href="http://www.addtoany.com/add_to/google_reader?linkurl=http%3A%2F%2Frumored.com%2F2009%2F10%2F03%2Fautomatic-writing%2F&amp;linkname=Automatic%20writing" title="Google Reader" rel="nofollow" target="_blank"><img src="http://rumored.com/wp/wp-content/plugins/add-to-any/icons/reader.png" width="16" height="16" alt="Google Reader"/></a><a class="a2a_button_reddit" href="http://www.addtoany.com/add_to/reddit?linkurl=http%3A%2F%2Frumored.com%2F2009%2F10%2F03%2Fautomatic-writing%2F&amp;linkname=Automatic%20writing" title="Reddit" rel="nofollow" target="_blank"><img src="http://rumored.com/wp/wp-content/plugins/add-to-any/icons/reddit.png" width="16" height="16" alt="Reddit"/></a><a class="a2a_button_facebook" href="http://www.addtoany.com/add_to/facebook?linkurl=http%3A%2F%2Frumored.com%2F2009%2F10%2F03%2Fautomatic-writing%2F&amp;linkname=Automatic%20writing" title="Facebook" rel="nofollow" target="_blank"><img src="http://rumored.com/wp/wp-content/plugins/add-to-any/icons/facebook.png" width="16" height="16" alt="Facebook"/></a><a class="a2a_button_stumbleupon" href="http://www.addtoany.com/add_to/stumbleupon?linkurl=http%3A%2F%2Frumored.com%2F2009%2F10%2F03%2Fautomatic-writing%2F&amp;linkname=Automatic%20writing" title="StumbleUpon" rel="nofollow" target="_blank"><img src="http://rumored.com/wp/wp-content/plugins/add-to-any/icons/stumbleupon.png" width="16" height="16" alt="StumbleUpon"/></a><a class="a2a_button_twitter" href="http://www.addtoany.com/add_to/twitter?linkurl=http%3A%2F%2Frumored.com%2F2009%2F10%2F03%2Fautomatic-writing%2F&amp;linkname=Automatic%20writing" title="Twitter" rel="nofollow" target="_blank"><img src="http://rumored.com/wp/wp-content/plugins/add-to-any/icons/twitter.png" width="16" height="16" alt="Twitter"/></a><a class="a2a_button_instapaper" href="http://www.addtoany.com/add_to/instapaper?linkurl=http%3A%2F%2Frumored.com%2F2009%2F10%2F03%2Fautomatic-writing%2F&amp;linkname=Automatic%20writing" title="Instapaper" rel="nofollow" target="_blank"><img src="http://rumored.com/wp/wp-content/plugins/add-to-any/icons/instapaper.png" width="16" height="16" alt="Instapaper"/></a><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Frumored.com%2F2009%2F10%2F03%2Fautomatic-writing%2F&amp;title=Automatic%20writing" id="wpa2a_2"><img src="http://rumored.com/wp/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://rumored.com/2009/10/03/automatic-writing/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Shell scripting will eventually kill me</title>
		<link>http://rumored.com/2009/10/01/shell-scripting-will-eventually-kill-me/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=shell-scripting-will-eventually-kill-me</link>
		<comments>http://rumored.com/2009/10/01/shell-scripting-will-eventually-kill-me/#comments</comments>
		<pubDate>Thu, 01 Oct 2009 14:00:03 +0000</pubDate>
		<dc:creator>jkonrath</dc:creator>
				<category><![CDATA[general]]></category>
		<category><![CDATA[hacks]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://rumored.com/journal/?p=322</guid>
		<description><![CDATA[I spent two hours the other night trying to hack out a shell script to import the archives into this thing. WordPress doesn&#8217;t have a simple way to just suck in a bunch of text files; you need to assemble &#8230; <a href="http://rumored.com/2009/10/01/shell-scripting-will-eventually-kill-me/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I spent two hours the other night trying to hack out a shell script to import the archives into this thing.  WordPress doesn&#8217;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:</p>
<p>1) All of the posts had to be on a single line in the <code></code> element.  This involved a bit of dicking around with <code>awk</code> and then <code>sed</code> before I finally gave up and realized I could do it faster with <code>tr</code>.</p>
<p>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 <code>/bin/date</code> 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&#8217;s brainpower goes to stupid pursuits like &#8220;oh, I have philosophical issues with the 87 flags offered in BSD&#8217;s date program, so I&#8217;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.&#8221;</p>
<p>Case in point, this DOES NOT work in OS X:</p>
<p><code>date -j -f "%Y%m%d" "20090930" +"%+"</code></p>
<p>This DOES work:</p>
<p><code>date -j -f "%Y %m%d" "2009 0930" +"%+"</code></p>
<p>But my filenames are <code>20090930.html</code> and not <code>2009 0930.html</code>.  That extra fucking space killed me.</p>
<p>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&#8217;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&#8217;m not about to quit my day job just to sit around slicing up onions.</p>
<p>Here&#8217;s the script:</p>
<pre>for f in ~/website-mirror/oldjournal/html/1997*.html; do
    echo "&lt;item&gt;"
    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 "&lt;pubDate&gt;"
    echo -n $pubdate
    echo "&lt;/pubDate&gt;"
    echo "&lt;category&gt;&lt;/category&gt;"
    echo "&lt;title&gt;&lt;/title&gt;"
    echo "&lt;content:encoded&gt;`tr '\n' ' ' &lt; $f`&lt;/content:encoded&gt;"
    echo "&lt;/item&gt;"
done</pre>
<p><a class="a2a_button_google_reader" href="http://www.addtoany.com/add_to/google_reader?linkurl=http%3A%2F%2Frumored.com%2F2009%2F10%2F01%2Fshell-scripting-will-eventually-kill-me%2F&amp;linkname=Shell%20scripting%20will%20eventually%20kill%20me" title="Google Reader" rel="nofollow" target="_blank"><img src="http://rumored.com/wp/wp-content/plugins/add-to-any/icons/reader.png" width="16" height="16" alt="Google Reader"/></a><a class="a2a_button_reddit" href="http://www.addtoany.com/add_to/reddit?linkurl=http%3A%2F%2Frumored.com%2F2009%2F10%2F01%2Fshell-scripting-will-eventually-kill-me%2F&amp;linkname=Shell%20scripting%20will%20eventually%20kill%20me" title="Reddit" rel="nofollow" target="_blank"><img src="http://rumored.com/wp/wp-content/plugins/add-to-any/icons/reddit.png" width="16" height="16" alt="Reddit"/></a><a class="a2a_button_facebook" href="http://www.addtoany.com/add_to/facebook?linkurl=http%3A%2F%2Frumored.com%2F2009%2F10%2F01%2Fshell-scripting-will-eventually-kill-me%2F&amp;linkname=Shell%20scripting%20will%20eventually%20kill%20me" title="Facebook" rel="nofollow" target="_blank"><img src="http://rumored.com/wp/wp-content/plugins/add-to-any/icons/facebook.png" width="16" height="16" alt="Facebook"/></a><a class="a2a_button_stumbleupon" href="http://www.addtoany.com/add_to/stumbleupon?linkurl=http%3A%2F%2Frumored.com%2F2009%2F10%2F01%2Fshell-scripting-will-eventually-kill-me%2F&amp;linkname=Shell%20scripting%20will%20eventually%20kill%20me" title="StumbleUpon" rel="nofollow" target="_blank"><img src="http://rumored.com/wp/wp-content/plugins/add-to-any/icons/stumbleupon.png" width="16" height="16" alt="StumbleUpon"/></a><a class="a2a_button_twitter" href="http://www.addtoany.com/add_to/twitter?linkurl=http%3A%2F%2Frumored.com%2F2009%2F10%2F01%2Fshell-scripting-will-eventually-kill-me%2F&amp;linkname=Shell%20scripting%20will%20eventually%20kill%20me" title="Twitter" rel="nofollow" target="_blank"><img src="http://rumored.com/wp/wp-content/plugins/add-to-any/icons/twitter.png" width="16" height="16" alt="Twitter"/></a><a class="a2a_button_instapaper" href="http://www.addtoany.com/add_to/instapaper?linkurl=http%3A%2F%2Frumored.com%2F2009%2F10%2F01%2Fshell-scripting-will-eventually-kill-me%2F&amp;linkname=Shell%20scripting%20will%20eventually%20kill%20me" title="Instapaper" rel="nofollow" target="_blank"><img src="http://rumored.com/wp/wp-content/plugins/add-to-any/icons/instapaper.png" width="16" height="16" alt="Instapaper"/></a><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Frumored.com%2F2009%2F10%2F01%2Fshell-scripting-will-eventually-kill-me%2F&amp;title=Shell%20scripting%20will%20eventually%20kill%20me" id="wpa2a_4"><img src="http://rumored.com/wp/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://rumored.com/2009/10/01/shell-scripting-will-eventually-kill-me/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

