Computer Science
-
github action 및 github 변동 내역 slack에 알림주기.Computer Science/Slack 2022. 8. 11. 20:29
github 변동사항을 slack에 알려주는 것은 쉽다. slack에서 app 추가 -> github 앱을 등록해준다. 해당 app을 원하는 채널에 추가해준뒤, /github subscribe owner/repo 를 통해 해당 repo의 변경점을 추적하도록 해준다. https://slack.com/intl/ko-kr/help/articles/232289568-Slack%EC%9A%A9-GitHub Slack용 GitHub GitHub는 소프트웨어 개발자 팀이 협업하여 코드를 작성하고 프로젝트를 관리할 수 있도록 지원합니다. GitHub를 Slack과 연결할 경우 선택하는 Slack 채널... slack.com github action이 종료 되면 해당 정보를 slack에 알려줄려고 한다. github a..
-
AWS codeDeploy error log 확인Computer Science/Aws 2022. 8. 9. 03:56
aws codeDeploy error 는 /var/log/aws/codedeploy-agent 아래에 파일들로 로그가 남는다. The overall deployment failed because too many individual instances failed deployment, too few healthy instances are available for deployment, or some instances in your deployment group are experiencing problems. 라는 오류가 aws deploy에서 나올 때가 있는데, 혹 ec2 iam을 deploy-agent가 적용이 안되어 있을 수 있다. sudo service codedeploy-agent restart 를 통..
-
spring boot datadog json으로 log 남기기.Computer Science/Spring boot 2022. 8. 5. 16:31
datadog.yaml에서 log 기능을 우선 enable 해준다. /etc/datadog-agent/datadog.yaml 에 대부분 위치해 있다. logs_enabled: true 로 변경 해준뒤 저장하고, datadog-agent/con.d 에 java.yaml 파일을 만들어준다. #Log section logs: - type: file path: "/path/to/your/java/log.log" service: java source: java sourcecategory: sourcecode # For multiline logs, if they start by the date with the format yyyy-mm-dd uncomment the following processing rule #..
-
Server 기동 여부 등 slack에 알리기.Computer Science/Slack 2022. 8. 5. 01:44
slack api 사이트에 들어가서 your app에 들어간다. https://api.slack.com/apps create new app을 해주어 해당 app이 작동할 workspace를 선택해준다. OAuth & Permissions Scopes를 먼저 설정해주어야 한다. Bot Token - bot의 접근 권한. - chat:write를 추가해 chat을 할 수 있는 권한을 주고, - channels:read 를 추가해 무슨 채널이 있는지 읽을 권한 을 준다. //User Token - user의 데이터에 bot이 접근 할 수 있는 권한. 그런뒤 install workspace를 진행해준다. token 값이 나온다. 해당 값은 github등에 보여지게 되면 재발급 받아야하니 주의하자. 그런뒤 sla..
-
AWS Secrets Manager를 이용하여 DB 비밀번호 등 암호화하기.Computer Science/Aws 2022. 8. 2. 21:48
//amazon secret management implementation 'org.springframework.cloud:spring-cloud-starter-bootstrap:3.1.3' implementation 'org.springframework.cloud:spring-cloud-starter-aws-secrets-manager-config:2.2.6.RELEASE' boot strap을 먼저 실행한 후 aws secrets manager에 접속하여 가져오는 방식이다. 고로 우선 위에 2가지를 implement해준다. secrets manager에 secret들을 저장해준다. 기본이 secret 아래로 되어 있기에 prefix를 /secret/으로 하고 프로젝트에 쓰일 명을 입력해준다. 그 다음..
-
useState를 통한 component에서 변경되는 값 관리하기Computer Science/React 2022. 8. 2. 19:51
리액트 16.8 버전 이후로 함수형 component에서 상태를 관리할 수 있게 됨에 따라 사용이 가능하다. Hooks 라는 기능이 16.8에 도입되면서 사용 가능한 Hooks 중 하나이다. import { useState } from 'react'; const [championName, setChampionName] = useState('' "); 첫 번째 인자값이 관리되고 있는 값이고 두 번째 인자는 함수로 써 첫 번째 값을 변경할 수 있다. const onChange = (e) =>{ setChampionName(e.target.value); } onChange 함수를 두어 들어 온 값을 두 번째 인자를 이용하여 변경 할 수 있다.
-
[library] 한글 검색 기능.Computer Science/JavaScript 2022. 8. 2. 19:45
https://www.npmjs.com/package/hangul-chosung-search-js#cdn-%EB%B0%A9%EC%8B%9D-%EC%82%AC%EC%9A%A9-%EB%B0%A9%EB%B2%95 hangul-chosung-search-js hangul-js를 이용한 한글 초성(+중성+종성) 검색 라이브러리입니다.. Latest version: 1.1.3, last published: 2 years ago. Start using hangul-chosung-search-js in your project by running `npm i hangul-chosung-search-js`. There are no other www.npmjs.com npm install hangul-chosung-sear..
-
React CORS 처리Computer Science/React 2022. 8. 1. 23:19
교차 출처 리소스 공유(Cross-Origin Resource Sharing)은 한 출처에서 실행 중인 웹 application이 다른 출처의 자원에 접근할 수 있는 권한을 추가 http 헤더를 이용하여 알려주는 체제이다. XMLHttpRequest 와 Fetch API는 동일 출처 정책을 따르기에 이부분을 염두해두어야한다. 해결방법. 중간에 프록시서버를 두면 되지만 react는 간단하게 해결이 가능하다. package.json에 "proxy" : "http://~" 를 적용시키고 해당 url을 사용하는 fetch api에서 url의 호스트를 지워준뒤 사용하면 된다. "http://~/test" -> "/test" 만약 여러 경로를 사용해야 하는 경우. npm install http-proxy-middl..