분류 전체보기
-
vim upgrade 또는 업그레이드 내역 확인 하기!LINUX 2019. 7. 16. 00:33
vim upgrade or 업그레이드 내역 확인 하기! Vim과 Neovim 편집기에서 OS 명령어 실행 취약점 발견 2019.06.13 보안 연구원 Armin Razmjou는 최근 리눅스에서 가장 인기 있는 커맨드라인 텍스트 편집 유틸리티인 Vim과 Neovim에서 심각도 높은 임의 OS 명령 실행 취약점(CVE-2019-12735)을 발견 Vim 편집기 : 사용자들이 리눅스에서 텍스트, 스크립트, 문서를 포함한 파일을 생성하고, 열람하거나 수정할 수 있는 프로그램 Neovim 편집기 : 플러그인, GUI 등이 개선된 Vim 확장 버전 프로그램 이 취약점은 “modlines”를 처리하는 과정에서 발견됨+ modelines : 문서의 시작과 마지막 라인 근처에 파일의 제작자가 언급한 커스텀 설정 세트를 ..
-
Maven을 이용한 Springboot 프로젝트 repackage 하기JAVA 2019. 7. 15. 00:32
Maven을 이용한 Springboot 프로젝트 repackage 하기 다른 분이 작성한 Springboot 프로젝트를 패키징하게 되었다. 해당 프로젝트는 maven으로 되어 있었기에 큰 문제가 없을꺼라 생각했다. 내 업무 환경은 JDK 12가 설치되어 있었는데, spring-repackage를 하면 다음과 같은 오류가 발생하였다. ERROR] Failed to execute goal org.apache.maven.plugins:maven-jar-plugin:2.6:jar (default-jar) on project my-test-utils: Execution default-jar of goal org.apache.maven.plugins:maven-jar-plugin:2.6:jar failed: An ..
-
express에서 File Upload 구현 하기NodeJS 2019. 7. 14. 00:31
express에서 File Upload 구현 하기 업로드는 복잡하게 구현 하지 않고 모듈을 사용하면 쉽게 할 수 있다. express-fileupload를 이용하면 된다. # express 의 app.js 에서 다음과 같이 사용 const fileUpload = require('express-fileupload'); const cors = require('cors'); const fs = require('fs'); app.use(cors()); app.use(fileUpload()); app.post('/upload', (req, res, next) => { let uploadFile = req.files.file const fileName = r..
-
Google Docs Sheets 연동 하기NodeJS 2019. 7. 13. 00:30
google docs Sheets 연동 하기 이번에 진행되는 프로젝트에서 데이터를 Google Docs의 Sheets에 넣어 두고 해당 데이터를 활용하여 대시보드를 구현하게 되었다. Google Sheets API 소개에도 잘 나와 있듯이, API를 활용하여 쉽게 이용할 수 있다. Node.js Quickstart에서 제공되는 소스는 아래와 같다. const fs = require('fs'); const readline = require('readline'); const {google} = require('googleapis'); // If modifying these scopes, delete token.json. const SCOPES = ['http..
-
NodeJs에서 Parse Error: HPE_HEADER_OVERFLOW 발생NodeJS 2019. 7. 12. 00:29
NodeJs에서 Parse Error: HPE_HEADER_OVERFLOW 발생 x-ray(node moudle)를 이용해서 크롤링을 개발하고 있던 중, 다음과 같은 오류를 만나게 되었다. (node:63533) UnhandledPromiseRejectionWarning: Error: Parse Error at Socket.socketOnData (_http_client.js:442:20) at Socket.emit (events.js:189:13) at addChunk (_stream_readable.js:284:12) at readableAddChunk (_stream_readable.js:265:11) at Socket.Readable.push (_stream_readable.js:220:10) a..
-
express에서 stream을 이용하여 파일 다운로드 하기카테고리 없음 2019. 7. 11. 00:28
express에서 stream을 이용하여 파일 다운로드 하기 파일다운로드를 하기위해서는 스트림을 이용해야 한다. const mime = require('mime-types'); // set header for download let mimeType = mime.lookup('news_20190501.pdf'); res.setHeader('Content-disposition', 'attachment; filename=' + 'news_20190501.pdf'); res.setHeader('Content-type', mimeType); fs.createReadStream(__basedir + '/public/file..
-
nodejs package.json의 모듈 업데이트 하기NodeJS 2019. 7. 10. 00:25
nodejs package.json의 모듈 업데이트 하기! npm-check-updates을 이용하여 package.json에 등록된 모듈들을 의존성에 알맞게 최신 버젼으로 업데이트 할 수 있다. 설치 후 실행은 다음과 같다. # global로 npm-check-updates 설치 $> npm i -g npm-check-updates # 프로젝트(package.json과 동일한) 디렉토리에서 다음 명령어 실행 $> ncu -u Upgrading /Users/admin/myProject/package.json [====================] 17/17 100% app-root-path ^2.1.0 → ^2.2.1 cookie-parser ~1.4.3 → ~1.4.4 debug ~2.6.9 → ~4..
-
nodejs port forwarding 처리NodeJS 2019. 7. 9. 00:24
nodejs port forwarding 처리 https를 설정하고 나니, 기존 80 포트로 요청이 있을 경우, 443으로 redirect 하는 방법을 찾아보았다. 구글을 확인해보니, 다음과 같이 쉽게 처리 할 수 있었다. // Redirect from http port 80 to https var http = require('http'); http.createServer(function (req, res) { res.writeHead(301, { "Location": "https://" + req.headers['host'] + req.url }); res.end(); }).listen(80);구글과 함께면 뭐든 쉽다. 참조 링크 Automatic HTTPS connecti..