Walk the line…endings

Have a file where you want to add a comma to the end of each line?

$ sed 's/$/,/' ip_addresses.txt | head -n2

This should work…but, wait, it didn’t. Instead, it replaced the first character of each line with a comma:


Ah, because the file is dos encoded, see the “\r \n”:

$ head -n1 ip_addresses.txt | od -c
0000000 9 6 . 1 2 7 . 0 . 0 / 1 7 \r \n

Ok, so dos2unix to the rescue:

$ dos2unix ip_addresses.txt
dos2unix: converting file ip_addresses.txt to Unix format...

And, finally:

$ sed 's/$/,/' ip_addresses.txt | head -n2,,

But, not so fast. We actually wanted commas on all but the last line:

$ sed 's/$/,/' ip_addresses.txt | tail -n2,,

So, use “$!” which matches lines which are NOT the last line:

$ sed '$!s/$/,/' ip_addresses.txt | tail -n2,

Flannery O’Connor, Annie Dillard, and David James Duncan walk into a bar…

…to have a drink with Pierre Teilhard.

In 2001-02 I studied Theology at Regent College. There I took a literature course from Dr. Loren Wilkinson. His syllabus listed about a dozen books, including: Everything That Rises Must Converge, For the Time Being, and The Brothers K.

Having just now read Duncan’s essay “Assailed: Improvisations in the Key of Cosmology” in Where I’d Rather Go: More Essays Beyond the Comfort Zone by Susan Olding et al, I’m more convinced than ever that Pierre Teilhard de Chardin was onto It.

Funny because I wrote a paper about this back at Regent. And, while it’s probably embarrassingly bad, I still have it here.

default routes

When you want to connect a not-Internet-connected router via ethernet to your Ubuntu laptop, but still prefer your laptop’s Wi-Fi connection for Internet routes, you can delete the default route for the ethernet connection:

$ /sbin/ip route | awk '/default/ { print $3 }'
$ sudo route del default gw

^^ where the 192 address is the gw for the ethernet connection

There may be better ways to do this, such as using ifmetric, but the above works for me.

Weekend project

I started an inventory of my clothing this weekend. My goal is to be more intentional about the stuff in my life and pare down my belongings. This will require keeping track of the new stuff coming in and sifting through what I already have. I plan to write about each process as I go.

I love wood burning season

From roughly mid-October to March, the primary heating source for our house is a basic woodstove.

It’s ironic in a way- we have zoned heating with network connected thermostats for each bedroom and a heat-pump/mini-split for the mainfloor and yet I prefer the oldest heating method known to man: fire.

There is just something magical about being in a room with a woodstove burning. Through the glass door, the flames have a sun on your skin feel, a feeling in short supply during a Pacific Northwest winter.

Sounds romantic? It is! Sort of.

It is especially romantic if you’re lucky enough to have a housemate who’s willing to do the chore for you- hauling, chopping, stacking, hauling (again), lighting, tending, cleaning, tending (always), relighting, etc.

If you’re the one doing the chores? It’s still pretty great and good for your body and soul.

Of course, wood burning has its detractors- one of my colleagues is an outspoken opponent of it and can cite studies showing negative health effects from woodsmoke. I respect that. The folks at BioLite cover this topic well and have neat products and a business model to address it.

I’m of the mindset that wood burning done right can be an environmentally sound activity. Our firewood comes from trees we felled to make room for the house- our lot was heavily treed, we left far more standing than we felled. I make a concerted effort to fire our stove in a temperature range which creates a “secondary burn” and when done right puts very little (bad) smoke out the chimney. I also benefit physically from the labor involved with processing my own firewood- except for that time I chunked part of my thumb with the hatchet.

Eighteen months ago, I knew next to nothing about wood burning. If you’re interested in learning more, I recommend two books:

  1. Closer to the Ground, by Dylan Tomine [author site] . I don’t know Dylan, though we live on the same island. His book isn’t strictly about wood burning either. But, my feelings and experience with wood burning tangle up nicely with the other themes he writes on, so I recommend you read the whole damn thing.
  2. Norwegian Wood, by Lars Mytting [author site] . A friend gave this to me after we’d moved to the island and they’d visited our home. She translates Norwegian professionally and was familiar with the title, which is apparently quite popular in its original Norwegian issue.

Unrelated to wood burning, but to a theme I’m working out here in my daily posting…I bought nothing today, except for coffee and gas for the Pilot. Also, I went for a run for the first time since December 20th- more on that in a later post.

Cars cost money

I took my 2010 Honda Pilot in for an oil change today…at least, I thought that’s what I was doing. Surprise! The little car brain told the mechanic to tell me that various other transmission and differential fluids needed changing…so, it turns out I spent ~$700 on coffee and car maintenance today. Maybe I should own fewer vehicles? Drink less coffee?

Some things to consider.