본문 바로가기

전체 글

(319)
GCP를 이용한 Gemini 검색 정리 Discord 봇 https://github.com/fdoom/GCP-Gemini-Search GitHub - fdoom/GCP-Gemini-Search: Search Gemini with Cloud Run Productions on Google Cloud PlatformSearch Gemini with Cloud Run Productions on Google Cloud Platform - fdoom/GCP-Gemini-Searchgithub.com1. 코드import functions_frameworkimport os, requestsfrom google import genaifrom google.genai.types import Tool, GoogleSearch, GenerateContentConfigGOOGLE_AP..
blog: wrk2 성능 테스트(백업용) docker run -it ubuntuapt updateapt-get install -y build-essential libssl-dev zlib1g-dev gitgit clone https://github.com/giltene/wrk2.gitcd wrk2makedocker를 사용해서 임의의 ubuntu 환경에서 테스트를 진행한다.2개의 스레드 사용해서 100개의 동시 연결을 유지하며 테스트를 30초 동안 실행하는데 초당 2000개의 요청을 목표로 하는 테스트이다.root@c440b1e088f9:/wrk2# ./wrk -t2 -c100 -d30s -R2000 https://image.noteit.cyou/image/display/20240913095044bedb854a-ba7d-4d44-8d6a-19e0..
blog 구조 (백업용) blog 프로젝트는 다음과 같은 구조로 svelte kit으로 프론트를 구성하며 spring boot를 기반으로 백엔드를 구성한다. 서버의 사양은 Respberry Pi 5 8GB 모델이다.blog image server의 경우 따로 분리되었는데 그 이유는 blog 프로젝트가 docker 기반으로 jenkins로 CI/CD를 진행하는데 그것또한 docker로 구성되었는데 한마디로, docker in docker 구조로 구성되어 있어서 볼륨 마운트 시 적용하기가 어렵기에 백업이 중요한 db와 이미지 서버의 경우 따로 분리되어서 구성한다. 따라서 변경이 잦은 프로젝트와 변경이 적은 프로젝트로 분리되었다.Nginx로 리버스 프록시 구조로 라우팅을 설정하고 Mysql에는 주요 데이터베이스로서 동작되며 Redis..
docker port 충돌 에러 Cannot start Docker Compose application. Reason: compose [start] exit status 1. Container [컨테이너명1] Starting Container [컨테이너명1] Started Container [컨테이너명2] Starting Error response from daemon: Ports are not available: exposing port TCP 0.0.0.0:3000 -> 0.0.0.0:0: listen tcp 0.0.0.0:3000: bind: An attempt was made to access a socket in a way forbidden by its access permissions.docker compose up --bu..
Docker 내의 pytorch 이미지 컨테이너에서 GPU 인식 문제(NVIDIA 그래픽 드라이버 문제) 몇 달 전에 테스트한 도커를 이용한 프로젝트가 갑자기 작동을 하지 않게 되었는데 설정이 꼬여서 그런가 싶어서 2일 동안 포맷 설정을 반복했는데 드라이버 문제일지도 모른다는 깃허브 글을 보고 테스트했던 시기의 드라이버로 변경하니 자연스럽게 해결되었습니다.NVIDIA 그래픽 드라이버에 대해서는 잘 몰랐었는데 이렇게 버전이 나눠져 있기에 권장 버전이나 인증된 버전을 선택하는 것이 더 안전해보여서 권장 드라이버로 설치했습니다. 저와 같이 고통받고 있다면 한 번 시도해보는 것도 좋을 것 같습니다.https://www.nvidia.co.kr/Download/Find.aspx?lang=kr Advanced Driver Search official NVIDIA driversAdvanced Driver Search of..
라즈베리파이5 xrdp 원격 접속 시 웹 브라우저 깨짐 현상 해결 방법 라즈베리파이5에서 rasberry Pi OS(Raspbian)에서 루트 계정 즉 설치 시 처음 만든 계정으로 xrdp를 이용해서 접속 시 생기는 문제점인데 바로 파이어폭스와 크로미움 두 브라우저 모두 화면이 깨져서 나오는데 간단한 해결방법이 있다. $ sudo adduser "새로운 유저명" 위 명령어를 통해서 새로운 유저를 생성한다. 그리고 해당 유저의 password 기입 후 나머지 내용은 입력하지 않고 Enter를 눌러도 상관없다. 그리고 원격으로 다시 접속 시 새로 추가한 유저를 사용하면 웹 브라우저는 문제없이 동작된다. 그런데 새로 추가된 사용자 계정을 통해서 sudo 명령어를 사용하지 못하는데 sudoers 파일에 sudo 명령에 대한 설정이 존재하는데 해당 내용에 추가해야 한다. $ su "..
백준 알고리즘 - 12891번: DNA 비밀번호 [Java] 문제: https://www.acmicpc.net/problem/12891 12891번: DNA 비밀번호 평소에 문자열을 가지고 노는 것을 좋아하는 민호는 DNA 문자열을 알게 되었다. DNA 문자열은 모든 문자열에 등장하는 문자가 {‘A’, ‘C’, ‘G’, ‘T’} 인 문자열을 말한다. 예를 들어 “ACKA” www.acmicpc.net 1. 코드 import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.*; public class Main { static int answer; static String[] DNA = {"A", "C", "G", "T"}; publ..
LeetCode 42 Trapping Rain Water Hard [Java] 문제: https://leetcode.com/problems/trapping-rain-water/ Trapping Rain Water - LeetCode Can you solve this real interview question? Trapping Rain Water - Given n non-negative integers representing an elevation map where the width of each bar is 1, compute how much water it can trap after raining. Example 1: [https://assets.leetcode.com/upl leetcode.com 1. 코드 class Solution { public int trap(int[] ..