미니옵빠의 code stubs
Language codeshttps://en.wikipedia.org/wiki/List_of_ISO_639-1_codes Region codeshttps://en.wikipedia.org/wiki/ISO_3166-1
파라메터가 2개 이상이면 object 로 관리하면 좋음 function fn({business, businessDays, businessCategory}) 이러면 Function callers 에서 변수명을 강제하는 효과가 있음 function fn(business, businessDays, businessCategory) { // TODO }const a = '', b = '', c = ''createContentBusiness(a, b, c) // 이렇게 호출 가능. call 시 변수명을 의미없게 지어버림 function fn({business, businessDays, businessCategory}) { } const a = '', b = '', c = ''createContentBusiness(..
Elasticsearch > indices 의 settings 값을 변경하려고 할 때, 아래와 같은 오류 메시지를 뿌리며 적용 안되는 경우가 있음. "reason": "Can't update non dynamic settings [[index.codec]] for open indices [[......]]" 예를 들어, compression 설정 변경 등이 해당됨 PUT indexName/_settings"settings": { "index.codec": "best_compression"} 이 때는 해당 index 를 닫고, 변경 후 다시 오픈하면 됨. POST indexName/_close PUT indexName/_settings"settings": { "index.codec": "best_compr..
FileBeat 에서 Logstash로 전송 시, 정상 전송이 완료되었음에도 아래와 같이 오류 메시지가 뜨는 경우가 있음. 2018-01-22T17:23:44+08:00 ERR Failed to publish events caused by: write tcp xx.xx.xx.xx:xxxx -> x.x.x.x.:xxxx: write: connection reset by peer 데이터 전송에는 문제가 없는데 찝찝하니 없애보자. Logstash 내 beats plugin 버전이 낮아 발생하는 이슈로, 아래와 같이 Logstash 폴더에서 plugin 업데이트를 해주면 됨 bin/logstash-plugin update logstash-input-beats Ref: https://github.com/elast..
xz 파일 압축 해제 시 아래와 같은 메시지 등을 보이며 압축 해제가 불가할 때가 있음 - xz: (stdin): 메모리를 할당할 수 없습니다- xz: (stdin): Cannot allocate memory- unxz: node-v8.11.1-linux-x64.tar.xz: 메모리를 할당할 수 없습니다- unxz: node-v8.11.1-linux-x64.tar.xz: Cannot allocate memory swap free 메모리 부족 이슈로, 아래와 같이 cache 영역을 clear 해주면 됨. sync; echo 3 > /proc/sys/vm/drop_caches root 권한이 없어 어려울 경우도 있으므로, xz 가 아닌 gz / tar 등 다른 압축 파일을 받아 사용하는 것이 마음 편함 re..
원글https://codeburst.io/https-chidume-nnamdi-com-npm-module-in-typescript-12b3b22f0724 따라하면 된다 How to Create and Publish an npm module in TypeScriptIntroductionIn this article, We are going to see how we can build a module with TypeScript usable by both JavaScript developers and TypeScript developers.Most npm modules come without a Type definition, so TypeScript developers will have to run an add..
Publishing 모듈 다 만든 후 1. yarn login // npm 의 ID/PW/Email 입력 2. yarn publish Un publish a package 1. npm login // npm 의 ID/PW/Email 입력 2. npm unpublish --force yarn 에는 unpublish command 가 없어 npm unplubish 를 해야 됨
아래 Article 참고하여 설정https://rjzaworski.com/2016/12/testing-typescript-with-jest 몇가지 추가 참고할 것 jest.config.js 내 아래와 같이 간략히 설정 가능 transform: { '^.+\\.ts$': 'ts-jest' }, jest.config.js 내 moduleFileExtensions 항목에 아래와 같이 ts, tsx 추가 필요 moduleFileExtensions: [ 'js', 'jsx', 'json', 'ts', 'tsx' ], 참고: https://facebook.github.io/jest/docs/en/configuration.html#modulefileextensions-array-string
mongod.conf systemLog: destination: file path: "/myhome/logs/mongodb/mongod.log" logAppend: truestorage: dbPath: "/myhome/apps/mongodb/data/db" journal: enabled: trueprocessManagement: fork: truenet: bindIp: 0.0.0.0 port: 27017setParameter: enableLocalhostAuthBypass: false 실행은 이런 식으로 ./mongod --config mongod.conf ref: https://docs.mongodb.com/manual/reference/configuration-options/index.html
MongoDB 초기 설치 후 실행, Client 접속 시 외부에서 IP로 접근되지 않음. loopback 으로만 접속 가능. 아래와 같이 설정하면 내부, 외부 다 접속 가능함 ./mongod --bind_ip 0.0.0.0 또는 ./mongod --bind_ip_all * 가능하면 Configuration File을 이용하여 선언하자. Elasticsearch 도 그렇고 요새는 이런 방식이 대세임 ref: https://docs.mongodb.com/manual/reference/program/mongod/#cmdoption-mongod-bind-ip