본문 바로가기
반응형

전체 글128

Nginx - index 페이지 기본 탐색기 적용하기 server { ... content ... location / { autoindex on; } } fancy index를 활용하면 날짜 포맷도 바꿀 수 있음 sudo apt-get -y install libnginx-mod-http-fancyindex server { ... content ... location / { autoindex on; fancyindex on; fancyindex_time_format "%Y-%m-%d %H:%M:%S"; } } reference : https://installati.one/install-libnginx-mod-http-fancyindex-ubuntu-18-04/?expand_article=1 2024. 2. 29.
Django 에서 GROUP_CONCAT 커스텀 사용 시 order_by, separator 추가하기 class CustomConcat(Aggregate): function = 'GROUP_CONCAT' allow_distinct = True def __init__(self, expression, distinct=False, **extra): # order by = group_concat 의 정렬 기준 # separator = group_concat 의 구분자(default = ",") expr_separator = '' expr_order_by = '' order_by = extra.get('order_by') separator = extra.get('separator') if order_by: expr_order_by = f' ORDER BY {order_by} ' if separator: expr_.. 2024. 2. 27.
Python 이중 for loop 를 itertools 를 활용하여 개선하기 a = [1,2,3,4] b = ['A', 'B'] 의 두 리스트에 대해 (1,A), (1,B), (2,A), (2,B), ... 반복을 하려면 무지성으로 구현했을 때 for x in a: for y in b: function(x, y) 처럼 구현할 수 있다. 하지만 itertools 의 product 를 활용하면 좀 더 깔끔하게 구현이 가능하다 [function(x, y) for x, y in product(a, b)] 2024. 2. 26.
Nginx 프록시 대상에게 Client IP 정보 넘겨주기 location { ... proxy_set_headerX-Real-IP$remote_addr; proxy_set_headerX-Forwarded-For$proxy_add_x_forwarded_for; ... } 위와 같이 세팅하면 proxy 대상 서버에서는 x-forwarded-for header를 읽으면 IP가 찍혀 있다. 2024. 2. 20.
Gunicorn 에서 print() output 이 로깅 되지 않을 때 해결법 # myapp.service StandardOutput=journal StandardError=journal 을 추가하면 print() 문구가 노출된다 2023. 11. 22.
아반떼 HD 에어컨 필터 교체하기 차량을 가져오자마자 느낀 것은 방향제가 있음에도 가끔 에어컨 바람을 통해 들어오는 쿰쿰한 냄새. 오래 된 차량에서 나는 그 익숙한 냄새가 났던 것이다. 친구야 이 차량이 첫 차였기에 크게 불편함을 느끼지 못했다고 하는데, 첫 차를 중고 모닝으로 시작했던 나는 이 냄새의 근원이 너무 명확했다. 바로 에어컨 필터가 너무 찌들어서 제대로 필터링을 하지 못한다는 것. 그래서 곧바로 에어컨 필터 교환을 시작했다. 에어컨 필터는 신아 PM2.5 현대자동차 에어컨 활성탄 필터 라고 검색하면 쿠팡에 바로 나오는데, 로켓와우로 구매했다. 에어컨 필터 교환은 매우 간단한데, 글로브박스를 열고 그 안에 있는 필터만 바꿔 끼우면 끝이다. 먼저 작업 공간을 넓히기 위해 여기 두 클립을 벌려줘야 한다. 클립은 벗기기 쉬운데 화살.. 2023. 9. 18.
반응형