Skip to content

Instantly share code, notes, and snippets.

@GINK03
Created July 22, 2018 19:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save GINK03/8547c388639c310bb33c07a4f30ccc87 to your computer and use it in GitHub Desktop.
Save GINK03/8547c388639c310bb33c07a4f30ccc87 to your computer and use it in GitHub Desktop.
ssh short cut
#!/usr/bin/env python3
import os
import sys
import re

try:
  number = [arg for arg in sys.argv if re.search(r'^\d{1,}$', arg)][0]
  SSHKEY=os.environ['SSHKEY']
  os.system(f'sshpass -p "{SSHKEY}" ssh gimpei@192.168.14.{number}')
except Exception as ex:
  print('something wrong', ex)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment