Author Image Peter Karman

Maker of lunches. Teller of stories. Singer of songs. Crafter of code. Kicker of darkness.

Elasticsearch development

Over the last few years I have done a lot of development against Elasticsearch, especially using the Ruby libraries. The Elasticsearch::DSL is very powerful, but anything beyond a simple query can take hours of debugging to get the syntax just right. I always learn the hard way that it is better to handcraft the JSON first to get the logic correct, and then translate it to the Ruby DSL code.

I don’t do it often enough to remember, so after my latest struggle with ES, I thought it useful to document.

The curl command is:

curl -X POST localhost:9200/myindex/_search \
-H 'Content-Type: application/json' -s \
-d '@q-test.json' | json_xs  | jq .hits.total

where q-test.json is a file with the DSL JSON.

Bart Campolo

[This is a letter I just sent to the New York Times magazine editor. They won’t print it, so I am posting it here.]

I was not surprised to read about Bart Campolo’s move to secular humanism, nor that the evangelical community “has barely noticed.” American evangelicalism has always been less about what you believe and more about how you believe. Evangelical theology functions more as a shibboleth than an orthodoxy.

Bart’s father knew this. I will always remember hearing Tony preach 25 years ago in my midwestern college chapel service. In the heat of his sermon he would say the word “shit” and observe immediately that we were more disturbed by hearing that word than by the poverty and hopelessness he was describing. Words signify which camp we belong to as much as anything.

Those of us who leave the religious traditions of our childhoods don’t so easily leave the psychological patterns those traditions imprint. The toilet paper sticks to your shoe even after the bathroom door swings shut. Noticing that about yourself, and freeing yourself from the endless repetition, is a lifetime’s work. I’m glad if Bart has found a certain relief in his new belief system. He still smells like an evangelical to me.

Analog

I’ve realized this many years ago, about my attraction to computer programming:

The world, which consists of analog phenomena infinite and unknowable, is reduced to the repeatable and the discrete.

via http://opentranscripts.org/transcript/programming-forgetting-new-hacker-ethic/

Problem is, the world cannot be mapped entirely to a technical model, nor should it be. My career-long ambivalence about digital technology hinges on that core belief.

Fresh coat of paint

After a decade of the same non-responsive layout for this site, I have paid off some technical debt to myself. The blog is now on WordPress with a clean mobile-friendly style. The server has been upgraded from CentOS 5 to CentOS 7. And thanks to the good folks at letsencrypt.org, every site hosted on this server has been updated to support SSL (HTTPS).

Managing a household of library users

My family are avid public library patrons. I’d estimate that in the three years we’ve been in Lawrence we’ve checked out well over 1000 items amongst the five of us.

It’s been up to me to manage the due notices and pay the inevitable overdue fines. I think we’ve only had to pay to replace a handful of items, which is a pretty decent success rate given who my children are. Still, it’s been fairly tedious to juggle five library cards, five accounts, log in to the site to check and renew each as needed.

The Lawrence Public Library website greatly improved when they switched to the bibliocommons platform. I finally got around to writing a command-line library management tool to aggregate all five accounts into a single report and automatically renew any that are coming due.

Example:

% perl my-toolbox/lfk-library --renew --all

No more click-click-click and putting-off-till-its-too-late-and-whoops-we-have-a-fine.