전체 글 183

[k8s] nginx forward proxy (정방향 프록시)

추후 적용 예정 : https://kubernetes.github.io/ingress-nginx/deploy/baremetal/ 출처 : https://www.baeldung.com/nginx-forward-proxy k8s 서버에 nginx ingress를 설치했다. nginx ingress는 로컬의 30000번 대 포트를 사용할 수 있다. 그럼 매번 http/https 접속할때 마다 포트 작성 할 수 없지 않은가? 그래서 k8s에 생자로 nginx 설치하고 forward proxy를 구성했다. 구성 방법은 간단 출처 링크에 있다. sudo apt update sudo apt install nginx sudo vi /etc/nginx/sites-available/default sudo systemctl..

Infra/IaC 2023.11.09

[Python] Logic Gate 클래스 만들기

클래스 연습 겸 Logic Gate 만들기 class LogicGate: def __init__(self, w1, w2, b): self.w1 = w1 self.w2 = w2 self.b = b # __call__ : 함수를 지정하지 않고 호출가능. 그러므로 하나만 설정 가능 # self.함수(x1, x2) -> self(x1, x2) 로 사용하게 됨. def __call__(self, x1, x2): z = self.w1 * x1 + self.w2 * x2 +self.b if z > 0: return 1 else: return 0 class ANDGate: def __init__(self): self.gate = LogicGate(0.5, 0.5, -0.7) def __call__(self, x1, x..

개발/AI 2023.11.07

[AutoViz] EDA를 도와줄 시각화 툴

!pip install AutoViz !pip install xlrd import warnings warnings.filterwarnings('ignore') import pandas as pd from autoviz.AutoViz_Class import AutoViz_Class AV = AutoViz_Class() # 데이터 불러오기 file = "csv 파일" df = pd.read_pickle(file) df.head() # AutoViz 실행 save_viz_dir = 'eda_viz' # 폴더 이름. chart_format 형식으로 저장될 파일 위치. dftc = AV.AutoViz(filename='', sep=',' , depVar='Attrition_Flag', # 타겟 데이터 컬럼명 df..

개발/AI 2023.10.31

[명령어] swap 추가/삭제

# root 진행 # swap 추가 설정 mkdir /swap dd if=/dev/zero of=/swap/swapfile count=8192 bs=1M # 파일 생성에 다소 시간 소요됨 chmod 600 /swap/swapfile mkswap /swap/swapfile swapon /swap/swapfile echo -e "/swap/swapfile swap swap defaults 0 0" >> /etc/fstab # swap off swapoff -a # 전체 swapoff /swap/swapfile # 파일명 지정 # swap 파일 삭제 # sudo cp /etc/fstab ~/fstab_bak # 백업 rm -rf /swap/swapfile sed -i -e '/swapfile/d' /etc/f..

System/명령어 2023.10.30

[명령어] 캐시 비우기 : sudo sync && sudo sysctl -w vm.drop_caches=2

리눅스 서버 캐시 비우기 : sudo sync && sudo sysctl -w vm.drop_caches=2 1. 캐시 비우기 전 동기화 작업 : sudo sync 2. 캐시비우기 : sudo sysctl -w vm.drop_caches=2 1번 성공 후 2번 진행 : sudo sync && sudo sysctl -w vm.drop_caches=2 drop_caches 옵션 상세 설명 링크 : https://www.kernel.org/doc/Documentation/sysctl/vm.txt drop_caches Writing to this will cause the kernel to drop clean caches, as well as reclaimable slab objects like dentries..

System/명령어 2023.10.30

[k8s] Ubuntu 22.04 설치 정리 231029

# 개인 메모장이므로 소스 버전과 사설IP 등 수정이 필요합니다. # 환경 : proxmox, VM(ubuntu 22.04.3) # 매우 의존한 자료... : https://tech.hostway.co.kr/2022/08/30/1374/ # OS 세팅 # VM 생성 과정에 사용자를 'worker' 생성 # 사용자(worker) sudo NOPASSWD 권한추가 echo 'worker ALL=(ALL) NOPASSWD:ALL' | sudo tee -a /etc/sudoers > /dev/null # 초기 패키지 설치 sudo apt-get update sudo apt-get install -y net-tools gcc vim sysstat ca-certificates curl gnupg apt-transp..

Infra/IaC 2023.10.29