본문 바로가기

분류 전체보기222

맥 켜고 끄는 시간 설정 예전에는 GUI로 제공되던게 이제는 터미널로 설정해야 한다 켜기와 끄기 시간 셋팅 (월~일) pmset repeat wakeorpoweron MTWRFSU 07:00:00 shutdown MTWRFSU 19:00:00 스케줄 확인 pmset -g sched 2024. 3. 25.
맥에서 기본 파이썬 변경 brew 설치 https://brew.sh/ 파이썬 최신 버전 설치 brew install python 프로필 파일에 라인 추가 vi ~/.zprofile export PATH="$(brew --prefix python)/libexec/bin:$PATH" 프로필 갱신 source ~/.zprofile 버전 확인 python -V --- pip 사용시 문제가 있으면 아래 명령어 실행 python3 -m pip config set global.break-system-packages true 2024. 3. 25.
스플렁크로 리텐션 구하기 | multisearch [ search index="log_pd_com" uri_path=/pd/install earliest=-22d@d latest=-21d@d | eval type="install" ] [ search index="log_pd_com" uri_path=/pd/playing earliest=-21d@d latest=-14d@d | eval type="section_1" ] [ search index="log_pd_com" uri_path=/pd/playing earliest=-14d@d latest=-7d@d | eval type="section_2" ] [ search index="log_pd_com" uri_path=/pd/playing earliest=-7d@d latest=-.. 2024. 2. 14.
비즈니스용 원드라이브 문서 다운로드 from O365 import Account # pip install o365 TENANT_ID = '...' CLIENT_ID = '...' SECRET_ID = '...' # https://developer.microsoft.com/en-us/graph/graph-explorer # 공유 받은 파일 : https://graph.microsoft.com/v1.0/me/drive/sharedWithMe 주소로 쿼리 전송 # 내 파일 : https://graph.microsoft.com/v1.0/me/drives/{drive-id}/items/{item-id}/children 주소로 쿼리 전송 FILE_ID = '...' DRIVE_ID = '...' #응답 항목 중 parentReference crede.. 2024. 2. 13.
스플렁크에서 nps 계산하는 쿼리 https://channel.io/ko/blog/nps_basic 수많은 기업에서 선택한 NPS 알아보기 - 기본편 고객 만족도 지표 고민 중이신가요? 최근 많은 글로벌 기업에서 선택한 NPS의 개념 및 계산 방법부터 장,단점까지 알아보도록 해요. channel.io index="log_test_com" uri_path IN (/test/nps) | stats count by _time, uuid, point | sort - _time `comment("최신 응답이 최상단")` | streamstats count as response_number by uuid `comment("동일 유저의 여러 개 응답에 넘버링")` | where response_number=1 `comment("최신 응답만 필터링").. 2024. 1. 25.
스플렁크 join 대체 https://community.splunk.com/t5/Splunk-Search/Alternative-method-to-using-Join-command/m-p/532978 join은 느리고 결과값 개수가 제한되어 권장되지 않는다 --- 다음 두가지는 결과가 동일하다 join 방식 index="log_pd_com" uri_path IN (/pd/install) | stats dc(clientip) as inst_device by clientip | join type=left clientip [ search index="log_pd_com" uri_path IN (/pd/uninstall) | stats dc(clientip) as uninst_device by clientip] join 대신 stats.. 2024. 1. 22.
스플렁크 서브서치 mylookup.csv 테이블 구조 user_id,username,email 1,user1,user1@example.com 2,user2,user2@example.com 3,user3,user3@example.com 쿼리 a처럼 작성하면 b와 같이 실행된다 쿼리a index=your_index [| inputlookup mylookup | table username ] | stats count 쿼리b index=your_index (username=user1 OR username=user2 OR username=user3) | stats count 2023. 12. 18.
ORM 방식으로 db에 데이터 추가하 # db_connect.py from sqlalchemy import create_engine def get_db_engine(): # 데이터베이스 연결 설정 engine = create_engine( "postgresql://postgres:pw@test.com:5432/db" ) return engine # main.py from sqlalchemy import Column, String from sqlalchemy.orm import sessionmaker, declarative_base from db_connect import get_db_engine # DB 연결 엔진 가져오기 engine = get_db_engine() # sessionmaker : 필수는 아니지만 관리상 권장 Session .. 2023. 12. 15.
keycloak 설치 * 가이드 https://www.keycloak.org/getting-started/getting-started-docker * 도커 컴포즈 version: '3' services: keycloak: image: quay.io/keycloak/keycloak:23.0.0 ports: - "8080:8080" environment: - KEYCLOAK_ADMIN=admin - KEYCLOAK_ADMIN_PASSWORD=admin command: ["start-dev"] * 테스트를 위해 https 요구사항 끄기 (컨테이너 내부에서 실행) cd /opt/keycloak/bin ./kcadm.sh config credentials --server http://localhost:8080 --realm maste.. 2023. 11. 24.