Home Link

Hello, my name is Brett Terpstra, and it’s nice to meet you. Elegant solutions to complex problems. Curious?

Posts tagged ‘bash’

Dec 28
2011

Here’s a quick riff on an older bash alias I use which will allow you to easily scan system messages from Terminal.

I’ve long had an alias in my ~/.bash_profile called console. It simply tailed the system log with ‘alias console=‘tail –f /var/log/system.log’.

Dec 24
2011

As I’ve mentioned before, I keep todo.taskpaper files in my web and code project folders. These allow me to keep track of bugs, ideas, notes, etc., and the archive it creates helps me remember what I did, when I did it and how it worked. I like having them separated per project; it’s the way my one-track mind works. I like the plain-text format because I can use any variety of…

Oct 04
2011

I’m not up for doing a full Bash autocomplete tutorial tonight, but wanted to share something I figured out instead of eating lunch. Here it is with a modicum of explanation.

I’ve been using Jon Stovell’s quit script to stop running applications with various save options as part of tweaking a safer universal computing setup with Dropbox. For various reasons I found myself…

Sep 25
2011

I was playing around with some readline options this morning, after reading this post on Reddit Commandline. A few of them wouldn’t work for me, so I did some research into the version of Bash that comes with OS X.

Jul 07
2011

Here’s another simple Bash function that I’ve used so much recently I thought I should share. It’s called oft, which stands for Open File Type, and can be used as a standalone shell script or as a function in your .bash_profile. When run, it looks in the current directory for files with extensions that match (or partially match) the first argument and opens them.

Jun 24
2011

I store all of my writing as separate Markdown files. A basic tagging system adds more “searchability,” and I can quickly locate any file with Spotlight. Given the amount of time I spend in Terminal (well, iTerm 2 these days), I use mdfind quite a bit to do the Spotlight searching. This function just makes it a little more convenient to search for and quickly edit an existing document.

May 20
2011

It starts out with mdfind and all of the creative scripting you can do with it. You start finding batches of files with something in common and you do things with them or to them. It sounds genocidal; it’s not. It’s very productive after the initial script setup.

Take, for example, a little script I run to add thumbnails to weblocs I have laying around. It looks something like this:

Entries (RSS) and Comments (RSS), or Subscribe by Email