Giter Site home page Giter Site logo

new-gwit's Introduction

new-gwit

blank

desription

  • 기존 gwkit의 검색이 마음에 들지 않아, 가볍게 python으로 TUI를 만들었습니다.
  • urwid라던가, 더 좋은 프레임워크가 있는 것 같은데 공부하는데 시간이 많이 소요될 것 같아 간단하게 curses로 만들었습니다.
  • 범용적인 실행을 위해 눈물이 나지만 python 2.7로 작성하였습니다.

기능

  • 서버 추가
    • ctrl + n 누르면 서버를 추가할 수 있습니다.
    • 정보 입력 후, enter 를 누르면 추가되며, 취소하고 싶으면 ctrl + c 를 누릅니다. register
  • 리스트 탐색
    • 화살표 위 아래로 서버를 선택할 수 있습니다.
    • 서버 선택 후, enter 를 누르면 rlogin 으로 접속합니다.
    • 접속하는 사용자는 / 키를 눌러 변경할 수 있습니다. list
    • 원하는 단어로 필터링 할 수 있습니다. 스페이스바로 구분되어 and 조건으로 필터링 합니다.
    • 필터링 단어는 대소문자 구분 없이 host, tag, description 에 포함 하는 것들을 필터링합니다.
    • 필터링 된 단어는 빨간색으로 강조 됩니다. filter
  • 서버 수정
    • 서버 선택 후 ctrl + e 를 누르면 정보를 수정할 수 있습니다.
    • 정보 수정 후, enter 를 누르면 추가되며, 취소하고 싶으면 ctrl + c 를 누릅니다. modify
  • 기존 gwkit의 known_host 마이그레이션
    • ctrl + l 을 누르고 known_host 파일 경로를 입력합니다. migrate

설치

  • gwkit.py 을 그냥 실행하면 됩니다.
    • python gwkit.py 을 실행하거나, 실행권한을 주고 ./gwkit.py 하시면 됩니다.
  • 내부적으로 서버 목록 관리를 위해 gwkit.py 와 동일한 dir 에 server_list.json 파일을 저장합니다.
    • 아래와 같은 형식이므로 직접 수정하셔도 됩니다.
      [
          {
              'host': '',
              'description': '',
              'tags': ['']
          }
      ]

라이센스

  • 그런거 없습니다. 마음대로 가져다가 수정해서 쓰세요.....

copyright @handraker https://github.com/handraker/new-gwit

기능추가 @viewrain

  • sso 로그인 기능추가
  • 서버리스트 Fetch 기능 추가

사용법

  • 기존 실행파일에 init argument 입력
    • python gwkit.py init
  • sso login

image

주의사항

  • Tips 의 나의서버그룹 정보를 가져와서 json 에 맵핑합니다.

    • 호스트명 : Host
    • 서버그룹명 : Description
    • 태그 : Tags
  • 한글이 존재할 경우 인코딩 이슈가 발생합니다.

    • 로직내 검색기능은 리눅스 환경에서 한글은 추천하지 않습니다. 만약 Tips 상에 한글이 존재한다면, 영문으로 변경 후 init 부탁드립니다.

image

init 후 자동으로 등록됩니다.

image

new-gwit's People

Contributors

byounggeol-cho avatar gunjasal avatar handraker avatar kihyo-jeong avatar seo-seokho avatar swtalk avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

new-gwit's Issues

유니코드 파싱 안되는 문제

init 명령으로 server_list.json을 구성한 다음 실행하니 다음과 같이 파싱 에러가 발생합니다.

$ ./gwkit.py
Password for *********@NHNENT.COM:
Traceback (most recent call last):
  File "./gwkit.py", line 686, in <module>
    curses.wrapper(main)
  File "/usr/lib64/python2.6/curses/wrapper.py", line 43, in wrapper
    return func(stdscr, *args, **kwds)
  File "./gwkit.py", line 598, in main
    server_list_win = ServerListWindow(context)
  File "./gwkit.py", line 124, in __init__
    self.servers = sorted(json.load(f), key=lambda s: s['host'])
  File "/usr/lib64/python2.6/json/__init__.py", line 267, in load
    parse_constant=parse_constant, **kw)
  File "/usr/lib64/python2.6/json/__init__.py", line 307, in loads
    return _default_decoder.decode(s)
  File "/usr/lib64/python2.6/json/decoder.py", line 319, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/lib64/python2.6/json/decoder.py", line 336, in raw_decode
    obj, end = self._scanner.iterscan(s, **kw).next()
  File "/usr/lib64/python2.6/json/scanner.py", line 55, in iterscan
    rval, next_pos = action(m, context)
  File "/usr/lib64/python2.6/json/decoder.py", line 217, in JSONArray
    value, end = iterscan(s, idx=end, context=context).next()
  File "/usr/lib64/python2.6/json/scanner.py", line 55, in iterscan
    rval, next_pos = action(m, context)
  File "/usr/lib64/python2.6/json/decoder.py", line 183, in JSONObject
    value, end = iterscan(s, idx=end, context=context).next()
  File "/usr/lib64/python2.6/json/scanner.py", line 55, in iterscan
    rval, next_pos = action(m, context)
  File "/usr/lib64/python2.6/json/decoder.py", line 155, in JSONString
    return scanstring(match.string, match.end(), encoding, strict)
ValueError: Invalid \escape: line 1 column 7691 (char 7691)

에러가 발생한 데이터를 확인해보니 다음과 같이 유니코드가 포함되어 있었습니다.

{
    "host": "cnfmnt-esh001", 
    "description": "ToastCloud_IaaS_ES_\xec\x8a\xa4\xed\x86\xa0\xeb\xa6\xac\xec\xa7\x80", 
    "tags": []
}

유니코드 처리가 안되면 실행도 안되니 수정해야할 것 같네요.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.