friday, january 27

insomnia's a poor subject, i guess
but an inevitable one
it's too late to be awake,
but you're awake
all the failures and mistakes
are playing on tight loops in your head
all the pain you cause
the unkindnesses you've dealt
out and the promises you've broken

daytimes the sunlight keeps them
out of circulation for a while
and the machinery of distraction you cultivate
but the sun goes down the engines
cough and sputter out
and there you are again
the future like an empty field
the past so many absences and resignations
the cost of everything tallying itself
in the tattered ledgerbook of
a memory handled carelessly
for too long

so you write something
it doesn't really matter what
a letter, a poem
you're only trying to obscure for now the traces
of all that traffic in mistakes and dull
the chattering exchange of all your trade in the
economy of squandered gifts

tags: topics/insomnia, topics/poem

p1k3 / 2017 / 1 / 27

Wednesday, January 25

I went down to the Women’s March in Denver on Saturday with my girlfriend and my sister and a couple of our friends and (from the looks of things at the bus station) a pretty good percentage of Boulder County. I didn’t take a camera any better than my phone; none of us were really sure what to expect from the whole thing, and traveling light seemed like a good idea.

(Images redacted.)

above: rough-draft sign mockups, patches, blurry phonecam of crowd

I only went to a few antiwar events in the run-up to the Iraq invasion (a thing I didn’t really know what to think about, in a time before I knew what to think about a lot of things). I sat out Occupy, although I had friends involved in one way or another. I’ve never done a genuinely big march or demonstration of any kind, really. We talked to people on the way down who said they never had either, but they felt that things had gone too far and it was time.

As it turned out, this march at least was overwhelmingly peaceful. The parts of it I was there for were, I don’t know how else to put this, mellow. Calm. Kind of happy. Lots of pleasant middle-aged ladies. Families with kids. Maybe the biggest crowd I’ve ever been part of, and everyone who bumped into me politely apologized. I think I exchanged smiles with a lot of people who have been feeling for a while like the entire probable tide of history is chipping away at their sanity.

I knew some of the chants: “No justice / no peace”, “no Trump / no KKK / no fascist USA”. “What does democracy look like / this is what democracy looks like”. Is some of this shit cringey in its sincerity? Yes. On the other hand, do I disagree? Not really. The Klan and fascism and Donald Trump are all bad things. Down with this sort of thing.

“United / we stand / against his tiny hands” was a big hit. “Science is real” was both affirming and not a thing you want to look at too hard, because why are we in a situation where asserting that there’s something like an observable, correlatable external reality qualifies as a form of dissent?

I don’t have any neat conclusions about this. I’ve spent a long time thinking that protest in general has been pretty well assimilated and neutralized by an emergent collusion between governments, law enforcement, and news media. I still think that, but I have other thoughts too: Maybe marching and chanting in the streets is for its effect on the marchers and the marched-for, not the marched-against. Maybe it’s not all quite so toothless as I have been conditioned to think.

I’m not going to frame taking to the streets as a moral imperative. But I also think well, it’s not nothing.

tags: topics/colorado, topics/gallery, topics/politics

p1k3 / 2017 / 1 / 25

Tuesday, January 24

shell history using RASH

Back in October of 2016, I mentioned that I’d started working on a utility called commandlog for keeping Bash and Zsh shell history in a database. My proof-of-concept was tiny and didn’t do much, but it seemed like an obviously fruitful idea. Especially after I talked to friends about the idea of using shell history to build up a kind of logbook and per-directory menu system

I’m fighting a cold tonight and too fuzzy in the head to work on anything very complicated, so I thought I’d hack on commandlog a bit. It occurred to me that I hadn’t really looked very hard at other alternatives, so I did some googling first.

Sure enough, people have done some work. I’m tagging a few things under “shell-history” on Pinboard. The most promising thing I’ve found so far is a Python project called RASH. Like commandlog, it keeps history in an SQLite db, albeit with a weird intermediate step where JSON files are written to a directory and then added to the database by a daemon process.

RASH seems to have a bunch of the features I want out of a tool like this. For example, you can search history by the current directory:

$ rash search -d .
v index
touch tag-technical tag-commandlog

Or use a regexp to look for commands beginning with comment, and display 5 lines of context on either side of them:

$ rash search -M '^comment' -C 5
rash search -M comment -C 3 --with-command-id
rash search -M comment -C 3
rash search -M comment
rash search -h
rash search
comment "checking out rash for shell history logging"
sqlite3 ./db.sqlite
rash search -h

…which is useful because I use comment "foo" to toss in little descriptions of tasks. It also logs a customizable set of environment variables, which would probably be the right thing if I wanted to add tagging or grouping of commands.

My hesitation is that it’s a Python project with a low version number and only partial Python 3 support, and development appears to have stopped some time in 2015. Still, it’s promising. I probably shouldn’t write my own version of all this if an existing project proves to work.

tags: topics/commandlog, topics/notes, topics/shell, topics/technical, topics/zsh

p1k3 / 2017 / 1 / 24

Sunday, January 22

org mode

I finally tried Org mode for Emacs, by way of a spacemacs install. I wanted to find something more structured for notes and TODOs than the directory full of text files I’ve been using, and Org nearly always comes up in these discussions.

It turns out to be nearly as all-singing-all-dancing as it’s made out to be: Crazy huge featureset, and situated in a very capable environment. (Emacs really is something very like an operating system, and has many of the qualities of being an environment of tool usage that I look for in software.)

The basic idea is that it’s an outliner, with collapsible nested sections that can be cycled open and closed by hitting Tab. There are checklist items that can be cycled through various states, date metadata, and ways to execute inlined code. There’s also tooling for viewing uncompleted tasks, a calendar interface, and an agenda based on upcoming events and task start dates / deadlines.

The syntax is moderately ugly and not as regular as I would have expected from its Lisp-adjacency, but it’s handled fluidly, with fewer glitches and more polish than I tend to expect from complex editor plugins.

It’s magical, but I didn’t actually wind up sticking with it.


I got a few days into the Org mode thing, and then Ben pointed me at Vimwiki. I had already by that point tried vim-orgmode, which wasn’t quite what I was looking for. Vimwiki turned out to be it, or at least something much closer.

Vim-instead-of-Emacs reasons:

  • Even with good Vim-style keybindings (and evil-mode, which is on by default in spacemacs, is very good), I always wind up in the part of Emacs that’s physically painful to use. (Lots of key chording really seems to bring on my always-latent RSI.)

  • I lean a lot on Vim behavior that’s different or missing in evil-mode. I’m not sure I could even tell you what behavior, just that it differs enough to break my brain. Stuff around visual selections and line endings is a lot of it, I think.

  • I cannot afford to mess around customizing Emacs for a month right now.

Vimwiki-is-legit-good reasons:

  • This is a simple, old-school wiki. Storage is plaintext with very basic syntax, links and new pages are cheap to create.

  • You can be up and running with no config and 4 or 5 key sequences with pretty simple mnemonics. I didn’t have to memorize much of anything I don’t already know.

  • There’s a checklist syntax, headers are easy, and you can inline code (with syntax highlighting). This is pretty much all I need.

Lastly, there’s the diary. This turns out to be the thing I use more than any other feature. It works like this: You press ,w,w (where , is your leader key) and you get a page for the current date.

Here are the Vimwiki-relevant parts of my current .vimrc (I’m using Vundle to manage plugins - you may prefer other options):

" a calendar - used in conjunction with vimwiki diaries
let g:calendar_keys = { 'goto_next_month': '<C-Right>', 'goto_prev_month': '<C-Left>'}
Plugin 'mattn/calendar-vim'

" CUSTOMIZE: vimwikis - for notes, daily logs, etc. {{{

  let wiki = {}
  let wiki.path = '~/notes/vimwiki/'
  let wiki.path_html = '~/notes/html/'
  let wiki.auto_tags = 1

  " do syntax highlight in preformatted blocks:
  let wiki.nested_syntaxes = {
    \ 'python': 'python',
    \ 'ruby': 'ruby',
    \ 'perl': 'perl',
    \ 'sh': 'sh'
  \ }

  " there can be many of these:
  let g:vimwiki_list = [wiki]

  let g:vimwiki_folding = 'expr'

  Plugin 'vimwiki/vimwiki'

" }}}

Nothing is perfect, but if you’re already a user of Vim and looking for a semi-formal note-taking paradigm, I endorse Vimwiki as a starting point.

For future work, I’d like to think about:

  • Executing inlined code (I already have this for Markdown documents; it should be simple enough).

  • Inlining structured data (like timestamps for invoicing).

  • Some kind of glue script to correlate diary entries with VCS commit logs, Atom/RSS feeds, and command-line history.

  • Using Vimwiki to manage the wiki entries on this site that used to be handled by WalaWiki (I’d intended to turn WalaWiki back on, but the modern web is such a hostile environment that I think it’d require a from-scratch rewrite or use of some other wiki platform to feel safe exposing it. It’s easier to just generate static HTML pages and accept changes by way of git).

addenda, early 2019

For a first pass at correlating diary entries with other dated info, see timeslice.

For invoice timestamps, I wound up using the timelog script originally described in this entry, along with a Makefile like this:

all: *.pdf

# See *.md for vim exec filters that generate the actual markdown.
# Oh my god this is baling wire bullshit.
%.pdf : ~/.timelogrc
        pandoc -o $@ $<

And invoice templates in Markdown like this

Invoiced 2019-02-03

**Billed to:**  
Foo, Inc.
New York, NY

**Pay to:**  
Brennen Bearnes  
Somewhere, CO

<!-- exec-raw zsh -c 'timelog ~/notes/vimwiki/diary/2019-01-*.wiki' -->
*   2019-01-02 10:00 - 17:30    7.500 hours
*   2019-01-03 10:05 - 17:00    6.917 hours
*   2019-01-04 09:40 - 18:35    8.917 hours
*   2019-01-07 09:50 - 18:30    8.667 hours
*   2019-01-08 09:15 - 17:00    7.750 hours
*   2019-01-09 09:50 - 17:45    7.917 hours
*   2019-01-10 10:15 - 17:00    6.750 hours
*   2019-01-11 09:00 - 17:00    8.000 hours
*   2019-01-14 10:00 - 15:35    5.583 hours
*   2019-01-15 10:00 - 16:45    6.750 hours
*   2019-01-16 10:00 - 12:00    2.000 hours
*   2019-01-16 15:00 - 17:30    2.500 hours
*   2019-01-16 21:00 - 21:40    0.667 hours
*   2019-01-20 14:00 - 17:00    3.000 hours
*   2019-01-22 09:30 - 17:00    7.500 hours
*   2019-01-23 09:52 - 12:00    2.133 hours
*   2019-01-25 11:00 - 17:00    6.000 hours

98.550 total hours at $4.20/hr = $413.91  
$0.00 in expenses

**Total due = $413.91**
<!-- end -->

Then I can generate a PDF with:

$ make foo-2019-02-03-hours.pdf

The bit inside the exec-raw comments is refreshed by pressing ,r, which runs the current buffer through some filters including filter-exec-raw. I still haven’t adapted filter-exec-raw or its siblings to be aware of Vimwiki markup, but sometimes I just put the HTML-style comments inside of a {{{ }}} block.

There are several levels on which this is probably not how you should do your invoicing.

tags: topics/emacs, topics/notes, topics/technical, topics/vim, topics/vimwiki

p1k3 / 2017 / 1 / 22

friday, january 20

the text is a program
running on the reader's mind
this is no small responsibility

it consumes resources and
has side effects in
a highly stateful system
indexes into existing storage
and may replicate itself in exposed

may run in parallel
on many minds,
or become a dependency
of other texts, other programs
entire operating systems
of the human soul

i mean this as more
than an image
it's broadly true, if imprecise —

just as in code we programmers
too routinely neglect our responsibilities
even as our art becomes the stuff of
power and territory,
in all this text we seem to neglect
the fragility and transience of mind
the possibility of harm
the cost of all these wasted cycles
and chained complexities

tags: topics/poem

p1k3 / 2017 / 1 / 20

saturday, january 14

enough exposure to the look and feel of
old science fiction will give you
this kind of double vision when it comes
to the style of the present

the valence of the future has changed
it has begun to merge with that of the present moment
which maybe signifies a shear in the structure
of, at least, our tastes and expectations

i started consuming ideas of the future
by reading ones that had aged into alternate histories
decades before i was born;
in the decades since then i have outlived the
time horizon of countless others

this may help explain why, in the chronological
territory of my mind, 1970 is always
somewhere in the near-future-past
and 2017 has that strange dual quality of now
and still yet to come

tags: topics/poem, topics/reading, topics/sfnal

p1k3 / 2017 / 1 / 14

Saturday, January 7

initial notes on the dell xps 13 developer edition (9360)

This will probably only be of interest to people who own (or are thinking about owning) a Dell XPS 13, and running Debian GNU/Linux on it.

I recently got a new work laptop courtesy of Adafruit, and have been getting it into working shape over the last few days. It’s a Dell XPS 13 Developer Edition, manufactured in late December of 2016. It shipped with Ubuntu 16.04 installed, so I assumed it would probably run Debian acceptably. That’s been true, for the most part. I’ve had to install Stretch / Testing, as Jessie doesn’t appear to support the hardware.

Some general observations, first:

  • I got this system on the advice of friends who’ve been using similar models for a few months, and also specifically because it comes with a Linux distro out of the box. That’s still depressingly rare from mainstream manufacturers, and it seems like a good idea to send the signal that there is a market.

  • There are more pixels on this thing than anybody needs, and that’s probably the biggest obstacle to using a non-mainstream windowing environment. More about that in a moment.

  • The keyboard here is more or less what I expect from expensive modern laptops, which is to say that it’s kind of shitty but not completely intolerable. Keys with real travel and a ThinkPad-esque layout would be nice, even at the expense of a few mm more case thickness, but Apple casts a long shadow over this conceptual landscape, so I know better than to expect them. (So it goes. If there’s one thing I know about markets, it’s that they happily prefer worse functional alternatives where aesthetic religion dictates.)

  • Two USB ports and a USB Type C / Thunderbolt port (I think; I have yet to fully get what is going on with this thing, but I guess it can do everything?). This is obviously not as many ports as you’d want, but on a machine this tiny it’s probably acceptable. Keep in mind you will need to buy accessories to connect to most legacy monitors or to an ethernet network. Which is on one level ridiculous, but again, it’s what it is.

  • Ok, so it doesn’t have nearly as much physical stuff as I often want. On the other hand, it’s really small and takes up like half as much space in my bag as my last couple of portable machines. Also the case build feels pretty nice - it’s aluminum and carbon fiber, which beats hell out of the flimsy, brittle plastic that’s standard on most non-Apple laptops.

  • There’s a touchscreen. This isn’t lifechanging, but with the right configuration it might be pretty neat. With scrolling and gestural input for window management tasks, it could be a major advantage.

Anyhow, on to setup specifics.

I used this Debian wiki installation guide, which says to install Stretch because Jessie won’t work. (I tried Jessie anyway first, since I had a recent netinst image laying around — no go.)

I found a BIOS update to version 1.2.3, which I installed by putting it on a USB stick with a FAT filesystem (actually a camera microSD card in a little keychain reader thing I got at SparkFun; everything else I have laying around seems to be EXT3 or 4), hitting F12 at boot, and selecting “BIOS Flash Update” from inside the BIOS menu. I’m not sure if this was strictly necessary, but it probably didn’t hurt anything.

I also followed this part of the instructions from the wiki:

Choose the first option, BIOS Setup. You have to change two settings:

System Configuration: SATA Operation: change “RAID On” to “AHCI”. Without this change, Linux won’t find the SSD.

Secure Boot: Secure Boot Enable: change to “disabled” since Debian currently doesn’t support secure boot.

…although since the system was already running Ubuntu, I think at least one of these didn’t need changed.

For the Debian install, I wound up downloading a netinst image with the extra nonfree firmware from, in order to support the Atheros network hardware in the installer.

On another Debian system, I did:

sudo dd if=firmware-stretch-DI-alpha8-amd64-netinst.iso of=/dev/sdc

…where /dev/sdc was another microSD card in the USB reader stick, and then booted the Dell from it. If I remember right, I may have needed to hit F12 again to get a boot menu that would let me select the stick.

I used the classic text-mode installer. I’ve been through this thing hundreds of times by now, and it’s usually painless, but this time was tricky because the console text was so tiny that I had to put on a pair of reading glasses and hold the monitor inches from my face to read the menus (I tried a magnifying glass first - it worked, but was a pain to hold while typing). I also had to restart the installer at least once before it picked up the existence of the extra nonfree firmware on the installation media - no idea why.

It’s worth pointing out that this version of the distribution is not stable software, and may cause pain. I’m pretty comfortable fixing Debian systems when something goes wrong, but if you’re new to the whole thing I’d recommend sticking with the out-of-box Ubuntu install for a while. (And maybe installing Gnome instead of Unity.)

Once I had a running operating system, I needed to be able to read things and use the keyboard.

By default, you have to chord Fn and a function key to get traditional F1 - F12 input. Since I bind a bunch of stuff to function keys in my editor, and only change the volume or toggle the keyboard backlight occasionally, this feels backwards. I eventually found a forum post that mentioned the BIOS settings for this are now hidden in POST Behavior -> FN Lock Options.

As to reading things on the display, I currently have a branch of bpb-kit going for this machine-specific set of config changes. Some notes:

  • My level of certainty about most of this stuff is pretty low. A bunch of things interact, and I’ve never learned how most of them are actually put together.

  • Gnome pretty well worked ok out of the box. I set Fonts -> Scaling Factor to 1.30 in gnome-tweak-tool, which seems maybe to have an effect on Xft font scaling when gnome-settings-daemon is running, even outside of Gnome-proper?

  • XMonad needed more help.

    • Set Xft.dpi = 192 in ~/.Xresources, which is included by a line in my xmonad.start script.
    • Increased trayer height to 40 in xmonad.start.
    • Changed xmobar’s default font to xft:Bitstream Vera Sans Mono:size=9:antialias=true in .xmobarrc.
    • Rewrote a good chunk of my ~/.xmonad/xmonad.hs, but mostly for other reasons than resolution - added rofi as a launcher and i3lock for screen locking, rewrote keybindings to use EZConfig, added some comments.
    • Added XMonad keybindings for volume & brightness keys.
  • In Firefox, I entered about:config in the URL bar and set layout.css.devPixelsPerPx to 2.0.

Stuff I still haven’t figured out:

  • Scaling in some GTK applications like Gimp and Inkscape.
  • Scaling in Qt applications like Konsole, which I’ve been using for a while now as a primary terminal (I just set the font real big).
  • Font sizes in XMonad tabs are still tiny.
  • There’s a weird, perceptible lag in starting applications, even tiny ones like xterm. Some bit of configuration state is almost certainly causing this.
  • ssh-agent doesn’t seem to be active by default. Related to above? Maybe.

I may improve these notes at some later date, but I wanted to publish what I had so far.

Update: I swapped out gnome-settings-daemon for xsettingsd.

There’s still a bunch of stuff running that I probably don’t need. I may get rid of GDM and see what happens. I should probably also think about building a custom kernel and look into power tweaks.

tags: topics/debian, topics/hardware, topics/linux, topics/technical, topics/warelogging, topics/xmonad

p1k3 / 2017 / 1 / 7

Monday, January 2

A while back, I added a simple tag system to this site. Going back and skimming old entries to tag them, it’s hard not to be overcome by this kind of creeping self-hatred and regret for just about everything I’ve ever written.

I was pretty young when I started writing Brennen’s Homepage, or whatever I called it at the time.1 I started, if this tells you anything, on GeoCities, and then rented a shell account from a guy named Robert Hardesty who had a Unix box somewhere in Boston.

The earliest entry I have here is from April of 1997, which means I was 16 and the Internet was still a place (or a thing) that it’s hard to realistically remember at all now.

I want to think of my failings recorded here as the product of something like childhood ignorance, even if they lasted well into my 30s.

I suppose that a lot of the last ~375000 words aren’t something I’d write now partly because the web was smaller and it made sense to write confessional bullshit out where anyone could see it (probably because in fact only internet weirdos like you would see it).

Most of the early blogs and LiveJournals and GeoCities sites have evaporated now. They survive, if at all on the public web, only in the recesses of Mostly they died of bitrot, but there’s been plenty of deliberate clean-slating too. People look at something they started writing when they were still kids, and then they take it out back to shoot it. A final mercy for those cringier traces of their younger selves.

I know people who burn all their journals. The impulse makes a lot of sense.

That’s all something of a cop-out, though. Even if everything I felt bad about writing was gone, I’d still have written it. I’m trying to take this collection of terrible writing as a useful index to some things, like what I have (despite myself) actually learned since I was a teenager.

Here are some things I’ll own:

  • I’ve written a lot of stupid, embarrassing shit about women. I’ve also written some stupid, unthinking, racist nonsense.

  • I’ve done more than my fair share of tasteless appropriation.

  • I grew up so embedded in midwestern American cultural and religious conservatism that its dimensions were basically invisible to me.

  • I soaked up a whole lot of SFnal libertarianism (and much stranger stuff) and then Free Software hit my nascent political brain like a ton of lead bricks. I danced around anarchism for a long time without understanding it. At 35, I do not have a coherent political philosophy. My writing, no doubt, reflects this.

  • I both repeat and contradict myself constantly. I adopt a posture of expertise or certainty far more often than is warranted.

  • My enthusiasm for art has usually been poorly contextualized, embarrassingly naive, or just a bad idea.2

  • I write poems without any real grounding in poetry as such, and they are for the most part very bad poems.

  • I almost never know what the fuck is going on.

I could go on in this vein for a while, but I suppose the point is this: If you needed for some reason to discover that I’m a ridiculous asshole, or convict me of a wide range of ideological offenses (or crimes against basic good taste), you’d have an easy enough time of it. However ill you want to think of me, the text here is likely sufficient to your needs.

I’m not going to delete all this stuff, though. I’m not sure if I can quite say why. I don’t blame anyone else for that impulse, but it’s not for me right now. Maybe I’m just too obsessed with memory to deliberately efface one of the few artifacts I’ve made out of it. Or too conscious of how little else I’ve built than a pile of words, as I near an age when it’s just as likely the bulk of my accomplishments are in the past.

What I would say is: If you find something here you’re repulsed by, well, you might be right. You might well be under no obligation to cut me much slack, but there’s a decent chance I’m trying to do better. At any rate, I’m all too aware I haven’t been doing so hot as it stands.

1 There was, for a little while, this kind of computer gaming zine that I made in Microsoft Publisher and called "Feed The Machine". It was full of cheatcodes I copied from other places and screenshots of demos installed off of the PC Gamer disc. I think it had a web incarnation for about 5 minutes somewhere in there.

2 The opinions I had in public on Usenet... Look, I'm sorry, ok?

tags: topics/writing

p1k3 / 2017 / 1 / 2