목록전체 글 (182)
취미가 좋다
Given a non-empty array of integers nums, every element appears twice except for one. Find that single one. You must implement a solution with a linear runtime complexity and use only constant extra space. Example 1: Input: nums = [2,2,1] Output: 1 Example 2: Input: nums = [4,1,2,1,2] Output: 4 Example 3: Input: nums = [1] Output: 1 Constraints: 1
![](http://i1.daumcdn.net/thumb/C150x150/?fname=https://blog.kakaocdn.net/dn/qbI9e/btraWSMxAKw/DCQ4JenGEst2K5LM9bn0W0/img.jpg)
https://leetcode.com/problems/convert-sorted-array-to-binary-search-tree/ Convert Sorted Array to Binary Search Tree - LeetCode Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com Given an integer array nums where the elements are sorted in ascending order, convert it to a height-balanced binar..
https://leetcode.com/problems/best-time-to-buy-and-sell-stock/ Best Time to Buy and Sell Stock - LeetCode Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com You are given an array prices where prices[i] is the price of a given stock on the ith day. You want to maximize your profit by choosing ..
![](http://i1.daumcdn.net/thumb/C150x150/?fname=https://blog.kakaocdn.net/dn/bstR8m/btraRwvkJPy/siL4SQd4JEfDnuUo4ShlVK/img.png)
사용하지 않는 docker 리소스 정리 사용하지 않는 컨테이너, 이미지, 네트워크, 볼륨을 삭제하면 메모리나 디스크 낭비를 줄일 수 있다. 아래의 명령어로 차례대로 컨테이너, 이미지, 네트워크, 볼륨을 확인한다. docker ps -a docker images docker network ls docker volume ls 아래의 명령어로 불필요한 리소스를 삭제한다. docker rm container_id docker rmi image_id docker network rm network_id docker volume rm volume id docker system prune docker system prune 명령어는 아래의 여러 가지 것들을 삭제한다. -a에 옵션을 붙이면 더 많은 것들을 삭제한다. c..
Docker-compose 란? 여러 컨테이너를 편리하게 실행하기 위해 만들어진 도구이다. yaml 파일을 정의해서 사용한다. (YAML 이란 데이터를 저장하는 파일 포맷으로, XML / JSON 보다 사람이 읽기 더 편하다는 장점이 있다.) docker-compose 로 memo application 실행하기 기존 커맨드는 아래와 같다. docker build . -t wellshs/docker-memo:latest docker run -d -p 5000:5000 wellshs/docker-memo:latest 위의 과정을 docker-compose로 실행하기 위해, 아래의 docker-compose.yaml 파일을 생성한다. version: "3.9" services: flask: build: con..
컨테이너가 호스트의 리소스(disk, memory)를 너무 많이 쓰면 발생하는 문제들이 있다. 메모리가 부족하게 되면, 호스트의 커널에서 잘 안쓰는 듯한 프로세스를 삭제하게 된다. 만약 이 프로세스가 필요한 프로세스였다면 문제가 된다. 특정 컨테이너가 cpu를 과하게 사용하게 되면, 다른 컨테이너가 동작하지 않을 수 있다. 만약 프로세스가 살아있는지 검사하는 외부 프로세스가 있을 때, cpu를 할당받지 못해서 응답을 못하는 프로세스가 죽었다고 판단하는 문제가 발생할 수도 있다. 디스크가 부족하게 되면, 새로운 프로세스를 생성하지 못하는 문제가 발생할 수 있다. docker stats stats 명령어로 각 컨테이너가 사용하고 있는 리소스를 확인할 수 있다. memory 제한하기 docker run -i ..