OSX: Shortcuts for Subnet Masks with TextExpander

I’m always looking for ways to improve my writing speed and accuracy. One way is to use specific keyboard shortcuts for tasks that are repetitive and prone to inaccuracy. So, using Cmd-C / Cmd-V for for Copy and Paste makes a whole load of good sense as it’s faster & more accurate than using the mouse to click through multiple menus, and put the cursor where it needs to be.

However, keyboard shortcuts are kind of limited. A more flexible approach is to use a program that can substitute short sets of text into much longer pieces. To do this, I use a program called TextExpander to keep a library of ‘snippets’ for expansion into a range of useful actions.

For example, I have a text snippet etmd and whenever I type these four letters, it is automatically expanded to EtherealMind.

The possibilities are endless, and I’m hoping to share a few different ideas and get feedback from you to help me build my collection of useful shortcuts.

Masks

Here I want to share my TextExpander library for handling Subnet Masks and Inverse Subnet masks for IPv4. I’ve always thought of subnet masks as binary masks, and really the use of Base10 numbers is to make it easy for people to learn. Thus I tend to think ‘/24′ not ’255.255.255.0′. But using /24 as a shortcut didn’t work because I use that all the time when writing documentation. So I’ve adapted to using the following example shortcuts:

Expanding Subnet Masks
Expanded Text Keyboard Shortcut
255.255.255.0 ,24
255.255.255.128 ,25
255.255.255.192 ,26

To create inverse masks I’ve decided to use the ! character to denote the inverse condition ( thus loosely adopting the Unix convention where ! acts as the inverse or negative condition ).

Expanding Inverse Subnet Masks
Expanded Text Keyboard Shortcut
0.0.0.255 !24
0.0.0.127 !25
0.0.0.63 !26

Importing TextExpander Snippets

All you need to do is download this zip file, extract and double click and it will install to TextExpander on your Mac.

IOS Masks 20110303.textexpander.zip

I look forward to hearing feedback on this. I have quite a few other IOS snippets but want to see if people are interested in the idea before I write it up. Let me know.

Creating your own Snippets Manually

For those people who aren’t familiar with TextExpander here are a couple of screenshots showing how I created these manually.

Caption Text.

Defining Snippet in TextExpander.(Click for a full size image)

Caption Text.

Defining Snippet in TextExpander..(Click for a full size image)

 

About Greg Ferro

Greg Ferro is a Network Engineer/Architect, mostly focussed on Data Centre, Security Infrastructure, and recently Virtualization. He has over 20 years in IT, in wide range of employers working as a freelance consultant including Finance, Service Providers and Online Companies. He is CCIE#6920 and has a few ideas about the world, but not enough to really count.

He is a host on the Packet Pushers Podcast, blogger at EtherealMind.com and on Twitter @etherealmind and Google Plus

You can contact Greg via the site contact page.

  • http://bill.crazyriver.com Bill K

    Nice little snippet idea, Love Textexpander but I really never get around to thinking about what I do so frequently that a snippet would help…

  • http://te-snippets.com Alexander Poslavsky

    Hi Greg!

    I added a link to your TextExpander library on http://te-snippets.com a new TE snippet site.

  • mrdoro

    Hello Greg!
    Super snippet idea, I started testing the Textexpander and its amazing!

  • http://www.sudonetworks.com Steve Williams

    Hi Greg,

    Nice collection, thanks for sharing!

    /steve

Subscribe For Weekly Updates by Email

Get a Weekly Summary of Latest Articles and Posts to your Email Inbox Every Sunday

Thanks for signing up. Look for the email from MailChimp & make sure you confirm your email address. You may need to check your spam or gmail settings to be sure of receiving the email.

Note: You can unsubscribe at any time using the link at the bottom of every email.