[Labs-l] SSH to labs instances with less typing

Platonides platonides at gmail.com
Sat Mar 12 22:42:08 UTC 2016


Aaron Halfaker wrote:
> Hey folks,
>
> I have spent a little time today working out a cute little bash alias
> trick for reducing my typing when connecting to various instances in
> labs.  Adding the following code to your /.bash_alias/ (or just
> /.bashrc/) file will change $ ssh <your instance>.eqiad.wmflabs to $
> labs <your instance>.
>
>
>     labs_ssh() {
>        ssh $1.eqiad.wmflabs
>     }
>     alias labs=labs_ssh
>
>
> And there you have it.  It's not much, but this helped my sanity a
> little bit and I wanted to share.

Note that if you name the function labs, you won't need the alias. And 
you probably want to keep the ability to provide parameters to ssh, so:

labs() {
   hostname="$1.eqiad.wmflabs"
   shift
   ssh "$hostname" "$@"
}



More information about the Labs-l mailing list