5월, 2018의 게시물 표시

구름IDE에 마인크래프트 서버, 파이 썬 API 설치

0. goorm.io 접속 1. 새 컨테이너 생성 2. JAVA -> JAVA 빈 프로젝트 3. https://nostarch.com/programwithminecraft 에서 Download the setup files for Mac OS (Minecraft Tools Mac.zip) 다운로드 4. SFTP로 접속하여 Minecraft_Tools_Mac.zip 파일 전송 5. $ unzip Minecraft_Tools_Mac.zip 6. $ mv Mincraft_Tools_Mac Minecraft_tools 7. apt-get update 8. apt-get upgrade 9. apt-get install python-pip 10. apt-get install python3-pip 11. $ ./Install_API.command 12. $ start.command 13. 구름 대시보드 -> 해당 컨테이너 -> 네트워크 관리 -> minecraft-python.run.goorm.io:25565 추가 14. 구름 대시보드 -> 해당 컨테이너 -> 포트포워딩 -> 내부포트: 25565 15. 생성된 외부아이피와 포트로 마인크래프트 서버 접속 xxx.xxx.xxx.xxx:xxxxx

macOS, 파이썬 API 마인크래프트 서버 설치

맥을 기준으로 한 설치 및 설정입니다. 1.마인크래프트설치 - http://minecraft.net 에서 구입하여 설치합니다. 2.파이썬 3.5.6 설치 및 설정 -brew설치 $ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install )” -파이썬 설치 및 확인 $ brew install python3 $ python3 —version 3.JDK SE설치 - http://www.oracle.com/technetwork/java/javase/downloads/index.html 접속 후 1.8 이상 다운로드 및 설치 -자바 설치 확인 $ java -version 4.마인크래프트 파이썬 API, SPYGOT 설치 - https://nostarch.com/programwithminecraft 접속 -Download the setup files for Mac OS (Minecraft Tools Mac.zip) 다운로드 및 압축풀기 -Install_API.command 설치 $ ./Install_API.command -server 폴더 이동 후 서버 실행 $ ./start.command 크레이그 리처드슨 저, ‘Learn to Program with Minecraft: Transform Your World with the Power of Python’ 원서 및 번역서를 기반으로 한 포스팅 게시물임을 알려드립니다. https://play.google.com/store/apps/details?id=vdream.vd.com.vdream

아마존 클라우드, 우분투 터미널에서 한글 사용

$ locale $ sudo apt-get install language-pack-ko $ sudo locale-gen ko_KR.UTF-8 $ sudo dpkg-reconfigure locales $ vi /etc/default/locale — LANG="ko_KR.UTF-8” LANGUAGE="ko_KR:ko:en_US:en” —

ubuntu,모든 uwsgi 프로세스 죽이기

sudo pkill -f uwsgi -9

구름IDE 무료계정으로 Python, Flask+UWSGI+Supervisor, MySQL 연동하기 (3)

$ / workspace/service_flask/run.sh ctrl + c $ service mysql restart $ service nginx restart $ service supervisor restart $ supervisorclt URL 브라우저에서 실행 -> http:// gyunseul10-smmpt.run.goorm.io

구름IDE 무료계정으로 Python, Flask+UWSGI+Supervisor, MySQL 연동하기 (2)

$ apt-get update $ apt-get install mysql-server $ mysql -uroot -p use mysql; create database dbname default character set utf8; grant all privileges on dbname* to userid@localhost identified by 'password'; flush privileges; quit; create table status_log ( seq int(11) not null auto_increment, status varchar(50) not null, name varchar(50) not null, primary key(seq) )charset=utf8; insert into status_log(status,name) values('check','gyunseul9'); $ cd /workspacce $ mkdir env $ cd .. $ mkdir log $ cd log $ mkdir uwsgi $ vi ./env/uwsgi_servie.ini --- [uwsgi] chdir=/home/service/service_flask chmod-socket=666 callable=app module=api socket=/tmp/uwsgi_service.sock virtualenv=/workspace/service_flask master=true processes=5 max-requests=1000 harakiri=10 lazy-apps=true logto=/workspace/service_flask/log/uwsgi/uwsgi_service.log enable-threads = true --- $ cd /workspace $ chmod +x run.sh $ vi /etc/nginx/sites-available/default --- server { listen

구름IDE 무료계정으로 Python, Flask+UWSGI+Supervisor, MySQL 연동하기 (1)

1. 구름 IDE 무료계정 가입 2. '새 컨테이너 생성' - 소스: 템플릿 - 이름: 마음에 드는 이름으로 - 설명: 비워도 됨 - 소프트웨어 스택 선택: Python -> Pyton 프로젝트 3. 생성하기 4. 생성된 컨테이너 '실행' 버튼 클릭 5. IDE 페이지로 이동 6. 왼쪽 상단 (+) '서브 프로젝트 추가' 버튼 클릭 7. 서브 프로젝트 이름을 'service_flask'로 입력 8. IDE 브라우저 맨 상단의 '창' > '새 터미널 창' 선택 9. 프로젝트 루트 폴더 이동 -> $ cd /workspace 명령어 입력. 10. 깃허브 소스 복사 -> $ git clone https://github.com/gyunseul9/service_flask.git 11. 독립적 가상의 파이썬 실행환경 만들기 -> $ pip3 install virtualenv 12. 독립적 가상의 파이썬 실행환경 만들기 -> $ virtualenv service_flask 13.  프로젝트 폴더 이동 -> $ cd service_flask 14. 가상환경으로 접근 -> $ . bin/activate 15. 플러그인 설치 -> $ pip3 install flask, mixpanel, pymysql, newrelic, uwsgi 16. 프로세스 모니터링 관리 프로그램 설치 -> $ apt-get install supervisor * 구름IDE 무료계정으로 Python, Flask+UWSGI+Supervisor, MySQL 연동하기 (2) 에서 계속.

macOS Vim 설정

1. 색상 설정 > download python.vim  > http://www.vim.org/scripts/script.php?script_id=790 $ cd ~/.vim $ mkdir syntax $ mv ~/Download/python.vim ~/.vim/syntax $ cd ~/ $ vi .vimrc — syntax on filetype plugin indent on  — 2.탭 설정 $ cd ~/ $ mkdir .vim $ cd .vim $ mkdir ftplugin $ vi ~/.vim/ftplugin/python.vim — set tabstop=8 set softtabstop=4 set shiftwidth=4 set textwidth=100 set expandtab set smartindent cinwords=if,elif,else,for,while,try,except,finally,def,class set nocindent — 3. Tagging 및 소스코드 브라우징 $ brew install ctags-exuberant $ ctags —help > http://pythoninreal.blogspot.kr/2013/12/vim-python.html