Skip to content

Instantly share code, notes, and snippets.

@rgbkrk
Last active December 23, 2015 07:19
Show Gist options
  • Save rgbkrk/6599713 to your computer and use it in GitHub Desktop.
Save rgbkrk/6599713 to your computer and use it in GitHub Desktop.
clip to key
#!/bin/sh
#
# Take a clipboard saved Server Private Key from Rackspace's deployment panel, clean it up.
#
# Requires OS X. Hipster jeans optional.
#
# Usage:
# clipkey ~/key
#
# Takes whatever is in your clipboard, puts it in the file specified as the first argument,
# trims off the junk Rackspace adds, and tightens permissions.
#
# Yes, this is ridiculous. Hopefully the cloud control panel gets better.
# If only I could make pull requests on it.
#
set -e
pbpaste | sed 's/Server Private Key: //' > $1
chmod go-rwx $1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment