본문 바로가기

세계정복의주인장

(1151)
lambda docker 이미지에 mecab 설치 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 FROM public.ecr.aws/lambda/python:3.8 # install build libs RUN yum groupinstall -y "Development Tools" \ && yum install -y which openssl # setup package RUN yum install -y glibc ld-linux.so.2 curl git patch RUN yum install -y gcc-c++ java-1.8.0-openjdk-devel python3 python3-..
mecab 설치 후 libmecab.so.2 파일 에러 mecab 이 아래와 같이 에러가 났다면!! Python 3.6.6 |Anaconda, Inc.| (default, Oct 9 2018, 12:34:16) [GCC 7.3.0] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import MeCab Traceback (most recent call last): File "/tmp/mecab-python-0.996/MeCab.py", line 18, in swig_import_helper fp, pathname, description = imp.find_module('_MeCab', [dirname(__file__)]) File "/root/minicond..
openapi chatGPT 사용기 https://openai.com/api/pricing/ Pricing OpenAI is an AI research and deployment company. Our mission is to ensure that artificial general intelligence benefits all of humanity. openai.com Ada 는 가장 빠른 모델이고 Davinci 는 가장 강력한 모델 가격은 1,000 토큰당 사용량이된다. 토큰은 답변으로 나온 단어 조각으로 생각할 수 있다. 여기서 1,000개의 토큰은 약 750개의 단어입니다. 처음 가입하면 $18달러를 준다. 이정도면 3개월 내내써도 문제 없을꺼 같다. 바로 사용 가능하도록 에디터창이 있다. https://beta.openai.com/..
역행자 https://www.youtube.com/watch?v=n123UqppM_Q 1단계 자의식 해체 2단계 정체성 만들기 3단계 유전자 오작동 4단계 뇌 자동화 5단계 역행자의 지식 6단계 경제적 자유를 얻는 구체적 루트 7단계 역행자의 쳇바퀴 ☝ 하루 2시간 동안 책을 읽거나 글을 쓴다. 뇌를 업그레이드 하는 가장 좋은 방법이다. 하루에 한번, “5분의 생각” 시간을 갖는다. 여백의 사간을 통해 좋은 결정을 쌓는다. 적극적으로 논다. 무조건 7시간 이상 숙면한다. 1단계 자의식 해체 💡 나는 물건을 살때 어떻게 행동하는가? 검색을 했다. 해당 검색어로 지식인 작업을 하고 블로그를 쓰자. 나와 같은 고민을 하는 사람들은 키워드로 검색할 것이다. 블로그나 지식인을 타고 온 사람들에게 신뢰를 주기 위해선 전문..
postgresql SQL Error [42P10]: ERROR: there is no unique or exclusion constraint matching the ON CONFLICT specification 문제점 다음과 같이 insert on conflict 구문일때 실행시 에러가 발생했다. INSERT INTO frame (id, chnl_id, frame_body_cntt, create_at, updated_at) VALUES ('A0016','A','오렌지', now(), now()) ON CONFLICT (id) DO nothing; 해결책 공식문서를 보자!! https://www.postgresql.org/docs/current/sql-insert.html INSERT INSERT INSERT — create new rows in a table Synopsis [ WITH [ RECURSIVE ] with_query [, ...] ] INSERT … www.postgresql.org on conf..
airflow ModuleNotFoundError: No module named 'slacker’ 문제점 airflow를 docker-compose로 관리하며 사용중이며 python 패키지를 추가해야하는데, docker 빌드시 requirement.txt에 패키지를 추가 했지만 airflow에서는 설치가 안되엇다고 계속 에러 메시지가 뜬다. 심지어 도커 빌드시 설치가 되는것을 확인했다!!! dockerfile에서 설치하려는 나의 노력을 볼수있다! 하지만 소용이 없었다. FROM apache/airflow:2.1.3 USER root RUN apt-get update \ && apt-get install -y --no-install-recommends \ openjdk-11-jre-headless \ && apt-get autoremove -yqq --purge \ && apt-get clean \ &..
selenium into aws lambda selenium을 비용을 최소로 하기 위해서 lambda에 docker 를 이용하는 방법을 이용했다. 해당 작업의 기초적인 소스 코드를 공유하고자 한다. 프로젝트 구성은 다음과 같다. (venv는 무시해도 된다.) 해당 파일들은 github에 올려놨으니 받아서 사용해도 된다. https://github.com/uiandwe/lambda-selenium-docker GitHub - uiandwe/lambda-selenium-docker Contribute to uiandwe/lambda-selenium-docker development by creating an account on GitHub. github.com chrome-deps.txt : chrome 설치에 필요한 yum 패키지 리스트 instal..
'utf-8' codec can't decode byte 0xff in position 0: invalid start byte 해당 사항은 이미지에 대한 건 입니다. 일반적인 텍스트일 경우 다르게 동작 할 수 있습니다. 크롤링 중 리턴 값이 바이트형식으로 되어 있다. 'utf-8' codec can't decode byte 0xff in position 0: invalid start byte 다른 인코드 형태인가 해서 euc-kr / cp949 / utf-16도 해봤지만 모두 에러가 발생했다. 사실 에러가 발생하는 요청은 이미지로 정상적인 이미지인 부분은 변환이 불가능 하여 에러가 발생하였고, 이미지가 아닐경우에 을 리턴하는 형태의 api 였다 (이 무슨…괴랄한..) req.content.decode('utf-8', 'ignore') 를 한다면 이미지의 경우 깨진 string으로 변환되고 html일 경우엔 정상적으로 string..