본문 바로가기

분류 전체보기179

excel to pdf python(엑셀을 pdf로 변환하기)_linux environment not window 리눅스에 libreoffice를 설치해야함. pip 가 아님.Dockerfile :RUN apt-get install -y libreoffice변환한다음 crop작업이 포함됨def excel_to_pdf(excel_file, output_pdf): try: # Excel을 PDF로 변환 subprocess.run(['libreoffice', '--headless', '--convert-to', 'pdf', '--outdir', os.path.dirname(output_pdf), excel_file], check=True) # PDF 경로 설정 cropped_pdf = output_pdf.replace('.pdf', '-cropped.pdf') # PDF 크롭 작업 subprocess.run.. 2024. 8. 28.
자바스크립트 AES암호화 및 복호화, 파이썬에서 복호화 자바스크립트 const handleCertification = () => { if (inputUser === '' || inputPassword === '') { sweetAlert('', '아이디와 비밀번호를 입력해주세요.', 'warning', 'center') return } // AES-256 암호화 const secretKey = CryptoJS.enc.Utf8.parse('abcdabcdabcdabcdabcdabcd'); // zY7wR8uH2kP4mQ9tV3xB1nC6jW5sL8oT'라는 문자열을 UTF-8로 인코딩하고, 이 값을 CryptoJS 라이브러리의 // Utf8.parse 메서드를 사용하여 WordArray 형태로 변환합니다. 이 변환된 WordArray가 AE.. 2024. 8. 22.
next14) use server에서 use client 컴포넌트를 import해서 사용하는 방법 비디오 동영상 불러오는 것을 client모드로 가져왔음. 서버모드 컴포넌트'use server'// MUI Importsimport Card from '@mui/material/Card'import CardContent from '@mui/material/CardContent'import Chip from '@mui/material/Chip'import Divider from '@mui/material/Divider'import List from '@mui/material/List'import ListItem from '@mui/material/ListItem'import Typography from '@mui/material/Typography'import useMediaQuery from '@mui/.. 2024. 8. 18.
react에서 리랜더링 없이 url에 쿼리 수정하기 const handlePagination = page => { setCurrentPage(page.selected) const currentUrlParams = new URLSearchParams(window.location.search) currentUrlParams.set('currentPage', page.selected) window.history.replaceState(null, '', `?${currentUrlParams.toString()}`) } 2024. 8. 1.
which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by" 에러내용 File "/usr/local/lib/python3.12/site-packages/MySQLdb/connections.py", line 261, in query2024-07-30 14:59:00     _mysql.connection.query(self, query)2024-07-30 14:59:00 django.db.utils.OperationalError: (1055, "Expression #6 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'deeplounge_a.guest.race' which is not functionally dependent on columns in GROUP BY clause; .. 2024. 7. 30.
background color가 프린트할 때 종이에 안나올 때 css 로 할 경우 .scheduleTable-cell {border: 1px solid black;padding: 2px;min-width: 1.5rem;text-align: center;-webkit-print-color-adjust: true;} inline으로 2024. 7. 2.
장고 date가 'null' 로 들어가서 나는 에러 해결 장고 date가 'null' 로 들어가서 나는 에러 해결에러메세지: [2024-07-02 17:48:25,232] INFO [machinesiteapp.views:273] [user:super(super) app:F] site edit false : {'site_build_date': [ErrorDetail(string='Datetime has wrong format. Use one of these formats instead: YYYY-MM-DDThh:mm[:ss[.uuuuuu]][+HH:MM|-HH:MM|Z].', code='invalid')], 'audit_start_date': [ErrorDetail(string='Datetime has wrong format. Use one of these fo.. 2024. 7. 2.
moment로 날짜 나타내기 console.log(data?.site_edit?.audit_start_date) 찍어보면 2024-06-17T00:00:00 형태로 나옴.  1. importimport * as moment from 'moment' 2. 사용하기moment(data?.site_edit?.audit_start_date).format("YYYY년 MM월 DD일")  Flatpickr로 날짜 짝기 ( { .. 2024. 6. 28.
ModuleNotFoundError: No module named 'binance.um_futures' 다운받아야할 것pip install binance-futures-connector 아래 모듈도 필수라고 한다pip install binance-futures 이외 pip listPackage Version------------------------- -----------aiohttp 3.9.5aiosignal 1.3.1APScheduler 3.10.4attrs 23.2.0binance-futures 0.0.1binance-futures-connector 4.0.0certifi 2024.6.2charset.. 2024. 6. 27.
foreign key를 null=true로 했는데 Column 'form_id' cannot be null이 나온다(mac) 뽀린키 속성을 없앤다 Find the name of the foreign key constraint (you can see it in the error message or by looking up the table structure), and then drop it:ALTER TABLE machine_report_attachment DROP FOREIGN KEY machine_report_attac_form_id_b4c038bd_fk_machine_r;form_id속성을 다시 부여한다 Now, modify the column to be nullable as initially intended:ALTER TABLE machine_report_attachment MODIFY form_id BIGINT NULL.. 2024. 6. 26.
mysql접속할 수 없는상태에서 비밀번호 변경 mysql 멈추기mysql.server stop 안전모드에서 시작sudo mysqld_safe --skip-grant-tables --skip-networking & mysql접속mysql -u root 비밀번호 재설정FLUSH PRIVILEGES;USE mysql;alter user 'root'@'localhost' identified with caching_sha2_password by '변경할 비밀번호';FLUSH PRIVILEGES; 재시작mysql.server restart; 2024. 6. 26.
It is impossible to change a nullable field 'address' on machinesite to non- 장고 null=True를 제거하고 에러가 뜬다 nullable without providing a default. This is because the database needs something to populate existing rows.Please select a fix: 1) Provide a one-off default now (will be set on all existing rows with a null value for this column) 2) Ignore for now. Existing rows that contain NULL values will have to be handled manually, for example with a RunPython or RunSQL operation.. 2024. 6. 17.
docker-compose 자주쓰는 명령어 0. 컨테이너 아이디 보는법: docker ps  1. 도커파일 내로 들어가기docker exec -it 컨테이너ID /bin/bash 나오기: exit 하고 엔터.  2. 서비스의 로그 실시간으로 보기 docker logs -f 컨테이너ID 3. docker-compose-local.yml을 실행시키기docker-compose -f docker-compose-local.yml up -d 4. makemigrations를 장고 컨테이너 안에서 수행하기docker-compose -f docker-compose-local.yml run backend python manage.py startapp machinesiteapp 5. 장고 migrate를 컨테이너 안에서 수행하기 docker-compose -f d.. 2024. 6. 12.
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)에러해결(mac) ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) 났다.  해결방법:brew services start mysql 쳤더니 해결완료. 끝. 2024. 6. 12.
깃허브 git clone 시 아이디, 비밀번호 설정 git config --global user.name '깃허브아이디'git config --global user.password '발급한 토큰' 2024. 6. 11.
opencv streaming 카메라로 받아서 localhost에서 띄우기 서버 # 필요한 패키지 import# SERVERimport socket # 소켓 프로그래밍에 필요한 API를 제공하는 모듈import struct # 바이트(bytes) 형식의 데이터 처리 모듈import pickle # 객체의 직렬화 및 역직렬화 지원 모듈import cv2 # OpenCV(실시간 이미지 프로세싱) 모듈# 서버 ip 주소 및 port 번호ip = '127.0.0.1'port = 5000# 1. 소켓 객체 생성server_socket = socket.socket(socket.AF_INET,socket.SOCK_STREAM)# 2. 바인딩server_socket.bind((ip, port))# 3. 접속 대기 server_socket.listen(10)# 4. 접속 수락(클라이언트 연결안.. 2024. 5. 30.
생소켓으로 비디오 스트리밍 받아오는 과제2 SERVER# 필요한 패키지 import# SERVERimport socket # 소켓 프로그래밍에 필요한 API를 제공하는 모듈import struct # 바이트(bytes) 형식의 데이터 처리 모듈import pickle # 객체의 직렬화 및 역직렬화 지원 모듈import cv2 # OpenCV(실시간 이미지 프로세싱) 모듈# 서버 ip 주소 및 port 번호ip = '127.0.0.1'port = 5000# 1. 소켓 객체 생성server_socket = socket.socket(socket.AF_INET,socket.SOCK_STREAM)# 2. 바인딩server_socket.bind((ip, port))# 3. 접속 대기 server_socket.listen(10)# 4. 접속 수락(클라이언트 .. 2024. 5. 29.
opencv 과제1 Final!!import cv2import argparseimport osimport numpy as npimport uuidimport globfrom errors import CropVariableMiss, IsNotNumber, MainFileNotFoundError, MergeFileNotFoundError, OnlyPlusNumber, ResizeNumberEmpty, StartPointSmallThanFinalPointdef isNumberCheck(number): try: if isinstance(float(number), (float, int)): return True else: return False except ValueError: return Fa.. 2024. 5. 28.
Flutter) dart 기본 문법(변수선언, 연산자, 루프, 함수, 클래스, 비동기) 1. 변수선언 main() { // 위에 Run을 클릭하면돼 // 화면 출력 print("Hello World!"); // 끝에 ;붙임. // 변수선언 // var는 데이터에 의한 추론형 변수 선언. var name = "유빚"; print(name); name = "관우"; print(name); // 상수(안바뀌는애들) 선언 const age = "Jang"; print(age); // 정수 int intNum1 = 30; print(intNum1); int intNum2 = 20; print(intNum2); // 사칙연산 print(intNum1 + intNum2); print(intNum1 - intNum2); print(intNum1 * intNum2); print(intNum1 / intNu.. 2024. 3. 30.
메모리의 구조, 트랜지스터 키고 끄는 원리, 변수가 메모리에서 어떻게 크기를 차지하는지, CPU가 어떻게 처리하는지 내 맥OS의 메모리 크기: 터미널에 sysctl hw.memsize | awk '{print $2/1024/1024/1024 " GB"}' 쳤더니 8GB나옴. 아래 코드를 치면 실행하기 전에는 HDD에 있다가 실행하면 RAM에 올라가게 된다 a = 15 print(a) 메모리 : 전기신호를 저장할 수 있는 트렌지스터로 구성됨. 이 트렌지스터는 전구와 같은 역할을 하는데 켜 있는 것은 1, 꺼있는 것은 0으로 해석됨. 재료공학 관점에서 트렌지스터를 어떻게 키고 끌 수 있나?(쳇 GPT) RAM (랜덤 액세스 메모리)은 전기적 신호를 이용하여 데이터를 읽고 쓸 수 있는 휘발성 메모리입니다. RAM에서는 페르미 에너지 레벨을 조절하여 트랜지스터를 키고 끌 수 있습니다. RAM은 주로 MOSFET (금속-산화물.. 2024. 3. 16.
python에서 Input # 예제1 name = input('enter your name') grade = input('enter your grade') company = input('enter your company') print(name, grade, company) #예제2 input으로 받은것은 무조건 str타입으로 나온다 number = input('Enter number: ') name = input('Enter number: ') print('Type of number', type(number), number * 3) print('Type of number', type(name)) # 예제3 (계산) first_number = int(input('Enter Number 1..')) second_number = int.. 2024. 3. 11.
ubuntu에서 puppeeer사용 중 오류 how to handel this issue? --> ailed to launch the browser process! /home/ubuntu/.cache/puppeteer/chrome-headless-shell/linux-121.0.6167.85/chrome-headless-shell-linux64/chrome-headless-shell: error while loading shared libraries: libgbm.so.1: cannot open shared object file: No such file or directory TROUBLESHOOTING: https://pptr.dev/troubleshooting Troubleshooting | Puppeteer Chromium currently .. 2024. 2. 16.
NextJS로 tailwind시작하기 1. yarn add -D tailwindcss@latest postcss@latest autoprefixer@latest 2. yarn tailwindcss init -p tailwind.config.js 파일이 생김. 3. 아래 붙여넣음. /** @type {import('tailwindcss').Config} */ module.exports = { purge: ['./pages/**/*.{js,ts,jsx,tsx}', './components/**/*.{js,ts,jsx,tsx}'], content: [], theme: { extend: {}, }, plugins: [], }; 이렇게 하면 최종 프로덕션 빌드에서 모든 사용하지 않는 스타일을 효과적으로 제거하여 파일 크기를 크게 줄일 수 있다고함. .. 2023. 12. 13.
nestjs cli 설치하기(MAC) & nestJS프로젝트 만들기 명령어 : sudo yarn global add @nestjs/cli nestJS프로젝트 만들기 : nest new nestjs-test 폴더 만들고 바로 그 폴더에 셋팅하려면? 2023. 11. 25.
워드프레스 폰트 변경 1. 구글폰트로 변경하기 아스트라 테마에서는 플러그인을 받지 않아도 구글폰트는 모두 설치되어 있다. 사용자 정의하기 - 글자에서 바꿀 수 있다. 글로벌에서 Performance -> Load Google Fonts Locally 활성화. Preload Local Fonts 활성화한다. --> 이거는 이제 지원 안하는 듯..? 2. 아스트라 이외의 테마에서 구글폰트를 쓰는 경우 플러그인 -> 새로추가 -> easy google font 검색 -> install -> 활성화 -> 사이트 방문 -> Customize -> Typograpy 섹션 -> 선택. 3. 커스텀 폰트 사용하기 이 플러그인을 다운, 활성화 한다 설정 밑에 Use Any Font라는 메뉴 나옴. 클릭하고 Geneate Free API Ke.. 2023. 11. 8.
저장 시 prettier 작동하도록 설정하는 법 (format on save) 2023. 10. 18.
기존 EC2에 새로 만든 pem key 등록하기 AWS 콘솔로 서버 접속. vi ~/.ssh/authorized_keys 내 pem키가 있는 위치에서 ssh-keygen -y pem키 이름 써 넣음. 나오는 rsa~~ 이 내용을 authorized_keys 파일에 붙여넣음. 끝. 2023. 10. 13.
리액트 앱을 도커 환경에서 테스트 해보자 이미지 생성 : docker build -f dockerfile.dev . 도커에서 테스트 실행 : docker run -it 이미지이름 npm run test ex) docker run -it jenny/docker-react npm run test docker-compose에 추가시켜서 테스트 해보기. version: '3' services: react: build: context: . dockerfile: Dockerfile.dev ports: - "3000:3000" volumes: - /usr/src/app/node_modules - ./:/usr/src/app #현재 디렉토리에 있는 모든 파일들을 usr/src/app에서 참조하겠다 stdin_open: true #이거 없으면 리액트 끌때 버그.. 2023. 10. 8.
react docker로 배포하기 npx create-react-app react-docker 프로젝트 생성. docker build -f Dockerfile.dev . (포트 맵핑 후 실행) docker run -it -p 3000:3000 jenny/docker-react (볼륨을 이용한 실행) docker run -it -p 3000:3000 -v /usr/src/app/node_modules -v $(pwd):/usr/src/app jenny/docker-react 도커 컴포즈로 리액트를 간단하게 실행해보기. version: '3' services: react: build: context: . dockerfile: Dockerfile.dev ports: - "3000:3000" volumes: - /usr/src/app/node_.. 2023. 10. 8.
docker 명령어 익히기 docker 컨테이너 실행하는 방법 : docker run 이미지이름(run 역할 : 컨테이너 생성 밑 실행) 도커 클라이언트에서 서버로 보내주고 -> 서버가 로컬에 이미지가 있는지 확인 -> 없다면 도커허브에서 찾아서 실행 파일 스냅샷을 컨테이너의 하드디스크에 넣어주고 명령어도 넣어준다. docker run 이미지이름 ls : 맨 마지막에 ls가 붙으면 기존에 시작명령어를 무시하고 여기에 있는 커맨드를 실행함. 항상 가능한 것은 아니다. ls를 실행할 수 있는 파일이 이미지 안에 있어야만 한다 ex) docker run hello-world ls : 불가. 현재 실행중인 컨테이너 나열 : docker ps 원하는 항목만 보는 방법 : docker ps --format 'table{{.Names}}\ta.. 2023. 10. 8.