dotdotdot

Today I figured out a simple but non-obvious way of automatically connecting to a remote shell when I create new screen windows. I’m using this in conjunction with a development server that does not have screen installed.

Let’s start at the beginning. My ~/.ssh/config file has many entries structured like so:

Host bob
    HostName robert.example.com
    User backstrom

This setup allows me to SSH to robert.example.com using the shortcut ssh bob. This shortcut could be made even shorter, though. I have a script (say, host-ssh) in my $PATH with the following content:

#!/bin/sh
HOST=$(basename $0)
ssh $HOST $@

Now I can ln -s host-ssh bob to symlink host-ssh to bob, and bob becomes a shortcut for ssh bob. At this point, the following commands work as expected:

adam@local:~$ ssh bob
backstrom@robert:~$ exit
adam@local:~$ bob
backstrom@robert:~$ exit
adam@local:~$ scp -q myfile bob:
adam@local:~$

So, onto screen. Imagine that my workstation has screen, but my remote server “bob” does not. I can mimic the functionality by running screen locally and connecting each window to bob in its own SSH session. (In the past I have done this via exec bob so I have one less exit to type during disconnects.) However, screen allows you to set a custom shell. You can leverage this to force an SSH connection to a specific server whenever a new window is created. Just launch screen with screen -s bob and every ^C-c will automatically run your new SSH shortcut. Seamless, if you have public keys set up.

Friday, April 4 will be my last day at Stonewall Cable, Inc. I’ve accepted a web development position with the local university, and my first day will be Monday, April 7 assuming there’s no dirt to be found in my background check.

I’ve had a great time at Stonewall. There are so many opportunities to get your hands dirty and be involved in all kinds of projects in a company this size. I’ve done such a wide variety of things here, from implementing more dynamic content onto the company website, to moving furniture and cutting heavy rubber matting for use as floor protectors. I’ve changed hats many times and found a good rhythm here, but I’m ready to switch gears and do the kind of work I’ve always hoped to do. It’s bittersweet, but I’m excited for the change.

So, thanks. It’s been a good time, and I’ll remember it fondly.

Python’s syntax relies on indentation for statement grouping. The convention is to use spaces, but I’ve always found tabs to be easier to work with in vim. My largest gripe: if I mis-tabbed, I had to press “delete” four times to erase all the spaces I created. Turns out, that needn’t be the case: vim can detect multi-space indentation and delete one “tab” at a time.

Here are some good resources I found while digging into this:

  1. Secrets of tabs in vim
  2. Notes on using Vim and Python — check out the autoindentation based on file name, just below the main table
  3. Converting tabs to spaces

Bonus: check out vimrc in the python “Vim” folder for other helpful files.

We’ve taken to using Dirvish to back up files here at work. It’s similar to Apple’s Time Machine backup mechanism: hard links provide directory snapshots while preserving disk space. This is most effective when most of your files are static, as the hard links can share these files across all your snapshots without using any additional disk space.

I didn’t find any documentation on expiring trees before their time, so: yes, you can edit a simple text file and expire a tree early. (Honestly, it may be acceptable to rm -rf a tree; I really don’t know. I’d rather let dirvish-expire do whatever cleanup it has to do, not being familiar with the code.) I happen to be removing some trees that didn’t back up correctly, as general maintenance.

Each backup tree contains a “summary” file. This file includes an Expire line:

Expire: +14 days == 2008-03-30 02:06:38

My original expire-rule expanded to 14 days from the date of backup, which was March 30. If I want to delete the tree right now, I can change the date after the equality test:

Expire: +14 days == 2007-03-30 02:06:38

Anything in the past is sufficient. Run dirvish-expire, and the tree will drop out of your vault.

First: Paul Ford reviews 763 MP3s in 4,578 words.

Second: numerical rating + single space + file name.

Useful for command line tomfoolery.

Update: while we’re on the subject, an interview.

Recently