반응형

DS218+ 기준으로 기술합니다.

 

0. 사전준비사항

- NAS에 ssh 접속 할 수 있도록 준비

- anaconda download(리눅스 64bit) : https://www.anaconda.com/download/#linux

 

<아나콘다 설치> - 꼭 아나콘다 아니어도 됨

1. bash 아나콘다설치파일.sh

2. yes yes 진행

3. 마지막에 bashrc PATH 등록하는 과정에서 no를 눌렀는데, yes를 하면 자동 생성해줄듯.

no를 눌렀기 때문에 .bashrc vi로 생성하였음(.bashrc가 없었음)

 

<주피터 노트북 설정>

 

1. ssh 접속해서 파이썬 실행

>>> from notebook.auth import passwd

>>> passwd()

패스워드 입력, 확인 후

>>> 'sha1:어쩌고저쩌고지지고볶고쏼라쏼라쏼라쏼라'

복사해둠

 

2. config 파일 생성

[~/work/python]# jupyter notebook --generate-config

Writing default config to: /Users/tommy/.jupyter/jupyter_notebook_config.py

 

3. config 파일 수정

IP 0.0.0.0으로 설정

PORT도 변경하였음(변경하지 않아도 무방)

패스워드 설정

외부에서 접속할 것이므로 웹브라우저 실행 X

외부접속허용

allow_origin, open_browser, password, port

 

 

4. ssh에서 jupyter notebook 실행하여 잘 올라오는지 확인(포트가 충돌나거나 하면 정상 실행되지 않는다)

정상 실행된다면, 종료하고 nohup으로 백그라운드 실행

 

 

<시놀로지 설정>

dsm에서 주피터 노트북이 사용하는 포트를 이용할 수 있도록 방화벽 정책을 설정해줘야 함

반응형
반응형

로컬에 있는 gz파일을 편집해야 되는데 압축을 풀어서 하자니 사이즈가 너무 크고(제일 작은게 20g 넘으니)

고민하다가 gzcat + awk 사용으로 방향을 잡았음

 

split 후 배열에 있는 단어와 특정 단어로 시작하는 여러개 단어 if 비교하고자 할 때

||로 나열하면 길어지고 가독성도 떨어져서 구글링하다가 공홈에서 봄

(https://www.gnu.org/software/gawk/manual/html_node/Comparison-Operators.html)

 

[awk 구문 안에서]

split($0, arr, ":"); for(i in arr) if(arr[i] ~ /^010|^011|^016|^018|^019/) print arr[i];

 

정말 뷰티풀한 기능이다

반응형

'Ecosystem' 카테고리의 다른 글

Git 기초  (0) 2019.07.17
macOS 에서 docker 사용하기  (0) 2019.05.13

반응형

https://docs.docker.com/docker-for-mac/install/

 

Install Docker Desktop for Mac

To download Docker Desktop for Mac, head to Docker Hub. Download from Docker Hub What to know before you install README FIRST for Docker Toolbox and Docker Machine users If...

docs.docker.com

1. 회원가입 후 도커 데스크탑 dmg파일 다운받기

2. 설치

블루스택이 설치되어 있는 경우 고래가 곤란해하므로 삭제(깔려져있는지도 잊고있었음-_-)

3. 설치 완료 확인

터미널에서 docker version

반응형

'Ecosystem' 카테고리의 다른 글

Git 기초  (0) 2019.07.17
[OS:Linux] awk split 후 if에서 정규식 사용  (0) 2019.05.22

반응형

superset에서 mysql접속하기 위해서 해야 할 것

 

1. mysqlclient 설치

mac OS에서 가상환경으로 진행하는 경우 해당링크 참조(https://gs-nogada.tistory.com/12)

 

2. SQLAlchemy URI 입력

mysql://아이디:비밀번호@db서버/데이터베이스

해야하는데 주의할 것은 접속할 아이디의 비밀번호가 sha2방식으로 암호화되어있으면 안된다는 것..

pymysql은 참고로 문제 없었음

 

sqlalchemy.exc.OperationalError: (MySQLdb._exceptions.OperationalError) (2059, "Authentication plugin 'caching_sha2_password' cannot be loaded: dlopen(/usr/local/Cellar/mysql-connector-c/6.1.11/lib/plugin/caching_sha2_password.so, 2): image not found") (Background on this error at: http://sqlalche.me/e/e3q8)

 

Error Messages — SQLAlchemy 1.3 Documentation

Parent instance is not bound to a Session; (lazy load/deferred load/refresh/etc.) operation cannot proceed This is likely the most common error message when dealing with the ORM, and it occurs as a result of the nature of a technique the ORM makes wide use

docs.sqlalchemy.org

ALTER USER 'username’@‘localhost’ IDENTIFIED WITH mysql_native_password BY ‘password’;

https://tableplus.io/blog/2018/07/failed-to-load-caching-sha2-password-authentication-plugin-solved.html

 

3. sqllab에서 sql 날리려고 하니 시원하게 에러 발생

NameError: name '_maybe_box_datetimelike' is not defined

어디서 많이 보던 에러임

/lib/python3.7/site-packages/superset/dataframe.py 수정 시 import부분 말고 함수 파라미터에도 있으므로 수정해준다.

 

잘 된다

반응형

+ Recent posts