본문 바로가기

Dev80

[Django] MVT (model-view-templete) MVT 구성요소 Model 사용될 데이터에 대한 정의를 담고 있는 django의 클래스 ORM으로 동작한다 model.py.에서 모델 클래스를 정의해서 사용한다 #model.py from django.db import models class Person(models, Model): first_name = models.CharField(max_length=30) last_name = models.CharField(max_length=30) class Meta: db_table = 'myapp_person' ORM (object-relational mapping) SQL을 사용하지 않고 데이터베이스 스키마를 구성하고 접근할 수 있다 객체를 사용해 데이터를 처리한다 URL conf 클라이언트로부터 요청을 받으.. 2024. 4. 11.
[vscode] Setting up SSH Host: Copying VS Code Server to host with scp vscode로 SSH 연결할때 특정 파일들을 다운로드해야 하는데 방화벽 이슈로 파일을 다운로드 받지 못할 때 다음과 같은 문장이 나오면 stuck된다. 이럴때는 직접 파일을 다운로드하고 세팅해줘야 해결할 수 있다.  1. On server, get the commit idls ~/.vscode-server/bin 옵션의 'Help' -> 'About'에서 확인할 수 있다.   2. Download tarball replacing $COMMIT_ID with the the commit number from the previous stepFor Stable Versionhttps://update.code.visualstudio.com/commit:$COMMIT_ID/server-linux-x64/stable.. 2024. 2. 19.
fatal: not a git repository (or any of the parent directories): .git git add . 를 했을때 fatal: not a git repository (or any of the parent directories): .git 이런 에러가 나와 git에 추가가 안된다 원인은 현재 폴더에 git에 대한 정보를 담은 파일이 없기 때문에 발생하는 에러이다. 해결방법 git init git remote add origin (github 아이디) 2024. 1. 4.
Container 생성시 gpu 할당 제한 모든 GPU 할당할때 docker run -it --gpus all 특정 GPU만 할당할때 docker run -it --gpus '"device=0,1,2"' 2023. 12. 27.
컨테이너 내부 통신 시 공유 메모리 부족 도커 컨테이너로 작업을 하다보면 [ERROR: Unexpected bus error encountered in worker. This might be caused by insufficient shared memory] 이런 에러가 나올때가 있다. 이건 컨테이너 내부 통신 시 공유 메모리 부족할때 발생하는 에러이다. 따로 추가 설정을 하지 않을 시 기본 --shm-size = 4mb이다 도커 컨테이너 안에서 부족한 공유메모리를 재 설정 해줘야한다. 공유 메모리만 설정했을때 오류가 다시 발생해서 ipc 옵션도 추가했다. ipc 옵션을 host로 주면 특정한 세그먼트만 메모리에 연길되지 않아 메모리 크기에 따른 에러가 없어진다. docker run -it --name test --shm-size=8G --ip.. 2023. 10. 12.
[FastAPI] 서버 실행할때 FastAPI로 백엔드를 구성하고 서버를 실행시킬 때 다음 명령어로 실행시킨다. 파일명이 main.py일때 uvicorn main:app 2023. 10. 4.
vscode ssh 연결 무한로딩일때 서버에 ssh 접속을 하려고 하니까 "Setting up ssh host $ip: copying vs code server to host with scp" 단계에서 stuck된 상태가 되었다.별거 다 해봐도 ssl 문제도 아닌거 같았는데 127.0.0.1 서버에 이미 할당된게 있는거로 보였다 $ vim ~/.config/code-server/config.yaml을 입력하면cert: False로 되어있었다True로 바꿔주니까 ssh 연결이 잘 되었다 2023. 6. 19.
로컬에서 CORS policy 관련 에러 해결 방법 js 기반으로 dashboar를 만들던 중 다음과 같은 에러가 자꾸 나타났다. "origin 'null' has been blocked by cors policy: cross origin requests are only supported for protocol schemes: http, data, isolated-app, chrome-extension, chrome, https, chrome-untrusted." CORS (cross-origin resource sharing) 은 동일한 출처에서만 리소스를 공유함을 의미한다 구글링을 해보니 크롬 브라우저에 " --disable-web-security --disable-gpu --user-data-dir=~/tmp" 를 추가하면 된다고 하는데 나는 안됐다.. 2023. 4. 24.
bash: jupyter: command not found root 경로 설정이 잘못되서 생기는 에러이다 $ export PATH=~/.local/bin:$PATH 로 해결할 수 있다 2023. 3. 21.
docker container 생성할때 $ docker run -it --gpus all --name js -v /home:/workspace/home -p 8001:8001 pytorch/pytorch:latest /bin/bash # docker run -it --gpus 접근할 gpu(device= index, all 전부) --name 컨테이너이름 -v 물리주소:가상주소 -p 물리/가상포트 이미지이름:태그 /binbash 2023. 2. 24.