Updating rsync on OS X

I recently needed to move a few directorys of tens- or hundreds-of-thousands of files to my Synology. Perfect use for rsync!

Unfortunately, rsync on OS X is stuck at 2.6.9, and I wanted to take advantage of some of the new features of 3.1.0. Specifically better handling of OS X metadata, and progress indication.

Fortunately, this walks you through a quick build and installation of rsync 3.1.0 in your /usr/local/bin folder. The benefit is that you can install your new version alongside the OS X included version (which is installed in /usr/bin/). Then you can add a couple aliases to your .bash_profile to treat them appropriately.

My aliases are as follows:

alias oldrsync="/usr/bin/rsync"
 alias rsync="/usr/local/bin/rsync"
 alias nrsync="/usr/local/bin/rsync -a  --info=progress2"

The first makes the system-installed 2.6.9 version refrencable by using the command oldrsync. The second makes the version in /usr/local/bin/ (which is 3.1.0, in my case) the one that runs when I type rsync. Finally, the third references the new version of rsync with a couple flags I almost always use.

Source: http://selfsuperinit.com/2014/01/04/an-upd...

Cheaters to launch an SSH Session

I'm a stalwart Terminal fan for my Engineering tasks. I don't understand why so many colleagues prefer a Terminal emulator like SecureCRT when we have native SSH built right into the OS. Something a lot of SecureCRT guys hold over my head is the nested folders with saved SSH sessions.

It dawned on me this morning that I could duplicate that functionality in something I'm already using: Brett Terpstra's Cheaters.

I won't get into an in-depth review of Cheaters, here. Simply put, it's a small app that launches a web view of a locally-hosted set of websites. Brett's suggestion is to use it as a place to keep cheatsheets (hence the name), like a virtual cubicle wall.

I used a little grep and sed on our existing hosts file, and came up with a Markdown list of links to the hostnames of our devices, using the following syntax:

[hostname.domain.com](ssh://hostname.domain.com)

I spent a couple minutes sorting the list into a reasonable hierarchy, then I used this nice little tutorial to create expanding lists using CSS and jQuery. I ran my Markdown list through Brett's own Marked 2, and copied the HTML to a new cheatsheet.

I took the CSS and javascript from the tutorial linked above, and dropped them into the appropriate folders inside of my Cheaters folder. In my new cheatsheet, I linked the specific CSS and javacscript:

<head data-preserve-html-node="true">
    <link data-preserve-html-node="true" rel="stylesheet" href="css/expandolist.css">
    <script data-preserve-html-node="true" type="text/javascript" src="js/expandolist.js"></script>
</head>

I didn't need to worry about jQuery, since Cheaters already uses it. I added the appropriate ID's to the div that holds the list, and to the first ul element. That's really all there was to it. Now I have a nice, organized, expandable list that lives in my menubar, which I can use to launch SSH sessions right in Terminal without having to remember specific hostnames. Not bad for 45 minutes of effort.

My Cheaters SSH list

My Cheaters SSH list

The Terminal

Craig Hockenberry put together a really good list of Terminal tips and tricks useful for developers. Many of these require only a little thought to be useful for network engineers, as well. Being able to do stuff like this is a big part of why I've always been a fan of using Terminal directly, in OS X, to ssh to remote devices, as opposed to using a GUI like SecureCRT.