AWS
-
개요매일 정오에 이번 달 aws 요금이 얼마나 나왔는지 알려주는 봇을 만드는 과정이다.친절하게 한화로도 알려주게끔 만들었다.무분별한 수정과 배포를 환영합니다.준비물1. ssh 접속이 가능하고 docker, docker-compose가 정상 설치된 서버2. 채팅을 올리려는 채널의 discord 봇 webhook url3. 요금을 보려는 aws 계정의 access keydiscord 봇 webhook url 만드는 방법을 모른다면? Discord - 봇 만들기개요discord 기본 봇을 만드는 과정을 담은 글이다.1. 채널 편집 페이지2. 연동 - 웹후크3. 웹후크 만들기웹후크 url이 필요없다면 이름과 프로필 사진만 바꾸면 된다.웹후크 url이 필요할 경우 아래dev-kimchi.tistory.comaws..
Discord - AWS 요금 알림 봇개요매일 정오에 이번 달 aws 요금이 얼마나 나왔는지 알려주는 봇을 만드는 과정이다.친절하게 한화로도 알려주게끔 만들었다.무분별한 수정과 배포를 환영합니다.준비물1. ssh 접속이 가능하고 docker, docker-compose가 정상 설치된 서버2. 채팅을 올리려는 채널의 discord 봇 webhook url3. 요금을 보려는 aws 계정의 access keydiscord 봇 webhook url 만드는 방법을 모른다면? Discord - 봇 만들기개요discord 기본 봇을 만드는 과정을 담은 글이다.1. 채널 편집 페이지2. 연동 - 웹후크3. 웹후크 만들기웹후크 url이 필요없다면 이름과 프로필 사진만 바꾸면 된다.웹후크 url이 필요할 경우 아래dev-kimchi.tistory.comaws..
2024.07.31 -
개요aws CloudShell에서 python 파일을 실행하던 중 해당 오류를 만났다.Traceback (most recent call last): File "/home/cloudshell-user/discord-cost-bot/cost_send.py", line 4, in from currency_converter import CurrencyConverterModuleNotFoundError: No module named 'currency_converter'해결방법CurrencyConverter 라이브러리 설치우선 CurrencyConverter 라이브러리를 설치하지 않았다면 설치를 진행하자.pip install CurrencyConverter하지만 정상적으로 라이브러리를 설치했음에도 똑같은 ..
Python - No module named 'currency_converter' error개요aws CloudShell에서 python 파일을 실행하던 중 해당 오류를 만났다.Traceback (most recent call last): File "/home/cloudshell-user/discord-cost-bot/cost_send.py", line 4, in from currency_converter import CurrencyConverterModuleNotFoundError: No module named 'currency_converter'해결방법CurrencyConverter 라이브러리 설치우선 CurrencyConverter 라이브러리를 설치하지 않았다면 설치를 진행하자.pip install CurrencyConverter하지만 정상적으로 라이브러리를 설치했음에도 똑같은 ..
2024.07.31 -
개요aws 비용 발송 discord 봇을 만들던 중 한화로 변환해서 보여주면 좋겠다는 생각이 들어 만들어보았다.코드# 환율 변환 라이브러리from currency_converter import CurrencyConverter# 환율 데이터 zip 파일을 반환해주는 europa.eu 사이트 urlurl = 'https://www.ecb.europa.eu/stats/eurofxref/eurofxref-hist.zip'# 환율 변환 클래스 인스턴스 생성, 유로화 환율 데이터를 제공하는 zip 파일을 사용하여 초기화c_list = CurrencyConverter(url)# 1달러를 한화로 변환한 결과 출력print(c_list.convert(1, 'USD','KRW'))
Python - 달러 환율 계산개요aws 비용 발송 discord 봇을 만들던 중 한화로 변환해서 보여주면 좋겠다는 생각이 들어 만들어보았다.코드# 환율 변환 라이브러리from currency_converter import CurrencyConverter# 환율 데이터 zip 파일을 반환해주는 europa.eu 사이트 urlurl = 'https://www.ecb.europa.eu/stats/eurofxref/eurofxref-hist.zip'# 환율 변환 클래스 인스턴스 생성, 유로화 환율 데이터를 제공하는 zip 파일을 사용하여 초기화c_list = CurrencyConverter(url)# 1달러를 한화로 변환한 결과 출력print(c_list.convert(1, 'USD','KRW'))
2024.07.31 -
준비물도메인도메인과 서버 연결80, 443 port 열기작업 디렉토리 구조nginx/default.conf 파일 생성docker-compose.yml 파일 생성~.ssh/project├── my-project # backend 서비스 파일├── nginx│ └── default.conf└── docker-compose.ymlDocker 설치# 필수 패키지 설치sudo apt-get updatesudo apt-get install apt-transport-https ca-certificates curl software-properties-common# Docker GPG key 추가curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg -..
Linux - Docker + nginx + ssl 인증 받기준비물도메인도메인과 서버 연결80, 443 port 열기작업 디렉토리 구조nginx/default.conf 파일 생성docker-compose.yml 파일 생성~.ssh/project├── my-project # backend 서비스 파일├── nginx│ └── default.conf└── docker-compose.ymlDocker 설치# 필수 패키지 설치sudo apt-get updatesudo apt-get install apt-transport-https ca-certificates curl software-properties-common# Docker GPG key 추가curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg -..
2024.06.24 -
Docker 설치# 필수 패키지 설치sudo apt-get updatesudo apt-get install apt-transport-https ca-certificates curl software-properties-common# Docker GPG key 추가curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg# Docker 저장소 추가echo \ "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https..
Ubuntu - Docker + nginx + spring boot 띄우기Docker 설치# 필수 패키지 설치sudo apt-get updatesudo apt-get install apt-transport-https ca-certificates curl software-properties-common# Docker GPG key 추가curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg# Docker 저장소 추가echo \ "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https..
2024.06.24 -
문제클라우드 서버에서 ./gradlew build 명령어 사용 시 빌드가 정상적으로 끝나지 않음해결방법저렴이 클라우드 서비스는 메모리가 작아서 발생하는 이슈로 가상 메모리를 할당하여 해결했다.명령어# 1. dd 명령을 사용하여 루트 파일 시스템에 스왑 파일을 생성(약 1분 정도 시간이 걸림)sudo dd if=/dev/zero of=/swapfile bs=128M count=32# 2. 스왑 파일의 읽기 및 쓰기 권한을 업데이트sudo chmod 600 /swapfile# 3. Linux 스왑 영역을 설정sudo mkswap /swapfile# 4. 스왑 공간에 스왑 파일을 추가하여 스왑 파일을 즉시 사용sudo swapon /swapfile# 5. 절차가 성공적으로 완료되었는지 확인sudo swapon..
Linux - 클라우드 서버에서 Gradle build시 무한로딩 해결방법(Swap)문제클라우드 서버에서 ./gradlew build 명령어 사용 시 빌드가 정상적으로 끝나지 않음해결방법저렴이 클라우드 서비스는 메모리가 작아서 발생하는 이슈로 가상 메모리를 할당하여 해결했다.명령어# 1. dd 명령을 사용하여 루트 파일 시스템에 스왑 파일을 생성(약 1분 정도 시간이 걸림)sudo dd if=/dev/zero of=/swapfile bs=128M count=32# 2. 스왑 파일의 읽기 및 쓰기 권한을 업데이트sudo chmod 600 /swapfile# 3. Linux 스왑 영역을 설정sudo mkswap /swapfile# 4. 스왑 공간에 스왑 파일을 추가하여 스왑 파일을 즉시 사용sudo swapon /swapfile# 5. 절차가 성공적으로 완료되었는지 확인sudo swapon..
2024.06.20 -
명령어pkill -9 -f '프로세스명'# Ex. pkill -9 -f 'testSpring-0.0.1-SNAPSHOT.jar'
Linux - 프로세스명으로 실행 중인 프로세스 죽이기명령어pkill -9 -f '프로세스명'# Ex. pkill -9 -f 'testSpring-0.0.1-SNAPSHOT.jar'
2024.06.05 -
컨테이너 생성 및 실행# 컨테이너 생성sudo docker run -dit -p 80:8080 --name my-container ubuntu:20.04# 컨테이너 접속sudo docker exec -it my-container /bin/bashnginx 다운로드# ubuntu 패키지 업데이트apt-get update# nginx 다운로드apt-get install nginxnginx 다운로드 중 입력창이 나올 경우 순서대로 y(설치 확인) - 6(아시아 선택) - 69(서울 선택) 입력nginx 설정 파일 수정# vim 다운로드apt-get vim# nginx 파일 수정으로 이동vi /etc/nginx/sites-enabled/default이동 후 수정할 항목server { listen 8..
Docker - nginx 서버 구동컨테이너 생성 및 실행# 컨테이너 생성sudo docker run -dit -p 80:8080 --name my-container ubuntu:20.04# 컨테이너 접속sudo docker exec -it my-container /bin/bashnginx 다운로드# ubuntu 패키지 업데이트apt-get update# nginx 다운로드apt-get install nginxnginx 다운로드 중 입력창이 나올 경우 순서대로 y(설치 확인) - 6(아시아 선택) - 69(서울 선택) 입력nginx 설정 파일 수정# vim 다운로드apt-get vim# nginx 파일 수정으로 이동vi /etc/nginx/sites-enabled/default이동 후 수정할 항목server { listen 8..
2024.06.04