Host Aliases in SSH

So you've probably got one or two hosts that you frequently ssh to that have long hostnames. You'd prefer to just alias this to something really short. There's a couple ways to do this:

  1. Hosts file alias. Problem: may overwrite something useful for other network connections.
  2. Shell alias. Problem: too many aliases.
  3. Good shell tab-completion. Problem: I can never get zsh to do intelligent ssh host completion.
  4. SSH configured alias.

So to create an alias for a system add to ~/.ssh/config the following:

Host <alias>
    HostName <real system fqdn>

Some examples:

Host s
    HostName scottr.org
Host b
    HostName 192.168.1.1

After a Host entry can be host specific configuration, and Host can be a pattern (Host *.slashdot.org). So for a host you could disable host key checking, or use a specific key file. Comes in pretty handy.

Permalink | 2 comments | Posted: Apr 18, 2008 | Tags: tips shell

Full Code Navigation: Cscope

Not long ago we discussed ctags here, and how it can quickly let you navigate your code, helping you find definitions of variables and functions. You'll have taken notice that sometimes you want to navigate in the reverse: where is this function called, who includes this file, etc. Cscope builds a database of such information (and more). We can include it with ctags and have very impressive code searching.

If you want a detailed introduction, there is a great cscope and vim tutorial available. I'll just give you a quick run down of using it.

  1. At the base of your C or C++ source tree run cscope -R -b -q

  2. Add this to your .vimrc:

    if has("cscope")
      set cst
      set csto=1
      if filereadable("cscope.out")
        cs add cscope out
      endif
    endif
    
  3. Start Vim in the same directory as the generated cscope.out file. (If not, just ...

Continue Reading

Permalink | Posted: Apr 18, 2008 | Tags: programming tips vim

Oggify 2.0 rc 1

I'm announcing the release of Oggify version 2.0 release canidate 1 (tar). New features: 0. I have added a small number of unit tests, which should provide more stability with updates. Additionally I've done a huge refactor of the design, which will make things much easier for me. One feature remains: re-tagging. I'm think that'll be rc 2.

Permalink | Posted: Apr 23, 2008 | Tags: python oggify

Oggify 2.0 rc 2

Just a version bump of Oggify to RC 2 (tar). Re-encoding works again.

Also, if anyone has time, let me know in the comments if the standard python setup.py install worked for you with Oggify. Mention you distro, etc if you could.

Permalink | 1 comment | Posted: Apr 27, 2008 | Tags: python oggify

Entries for March, 2008

Entries for May, 2008

Tags

42 | django | python | oggify | OSCON | OSCON07 | osx | utosc | mythtv | security | reading | music | gaming | programming | tips | shell | vim | pyobjc | cocoa

Calendar

<< Apr >>
Mo Tu We Th Fr Sa Su
31 1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30 1 2 3 4

Search

This space reserved for a search box

RSS Feeds

A Django site. Hosted on a Slicehost Slice