inblog logo
|
code-sudal
    flutter

    VsCode 플러그인 세팅

    윤주헌's avatar
    윤주헌
    Oct 01, 2024
     VsCode 플러그인 세팅
    Contents
    1. 설치스프링 파일 만들기!아이콘 이쁘게 하기서버 실행 되는지 확인콘솔이 터미널로 떠서 변경 (디버그 콘솔로)디버그 콘솔 이쁘게 변경 폰트 바꾸기아이콘 변경(파일 옆에 있는 아이콘)단축키테마 색 바꾸기 디버그 콘솔 서버 키고 끄기필요 없이 import된 것 지우기롬북 설치컨트롤러 만들기테스크 코드 단축키 같은 것!!
    vs코드에 자바 버전 확인!
    java —version
    notion image

    1. 설치

    notion image
     
    notion image
    이거 깔아야 하는데 난 깔려있드라 뭐징(단축키 설정때문에 설치 하는 것)
    notion image
    아이콘이 이뻐짐
    notion image
     
    notion image
    format on
    notion image
     
    notion image
    notion image
    설정 방법인데 workspace에서 하면 지금 파일에서만 설정 가능하고 다른 파일가면 또 설정해줘야함
    User에서 설정하면 전부 설정됨
    Jetbrains fleet theme 들어가서 스크롤 내리면 빨간 상자 안에 있는게 보일 거임 그래서 복 붙
    notion image
     
    그냥 Workspace settings에 넣어주기
    "editor.fontFamily": "JetBrains Mono, Consolas, 'Courier New', monospace",
    "editor.fontSize": 14,
    "editor.lineHeight": 1.6,
    이렇게
    폰트 이뻐짐
    notion image

    workspace에 넣으면 파일 바꾸면 설정 저장 안됨 그래서 디폴트나 유저에 넣어줘야 한다!!

    스프링 파일 만들기!

     
    notion image
    notion image
    notion image
    notion image
    notion image
    notion image
    notion image
    web이 @ 만들어 주는애
    빨간 박스의 애들 다 클릭하거나 앤터 쳐서 추가해주자
    notion image
    시작 하려면
    notion image
    파일 따로 만들어서 하기( 마음대로 )
     
    notion image
    notion image
    notion image
     
    여기에 settingsJson이 들어간다
    notion image
     
     

    아이콘 이쁘게 하기

    설치
    notion image
    결과
    notion image
    help.md → 파일 수정하려면 f2
    이름 README로 바꾸기, HELP.md 안쪽 내용 다 지우기
    notion image

    서버 실행 되는지 확인

    notion image
    서버 켜보자
    파일 들어가서 우클릭 런 자바 클릭 Or shift f9
    notion image
    notion image
     
    404뜨면 된다 서버 돌아가고 있다는 것임
    서버 끄기
    notion image

    콘솔이 터미널로 떠서 변경 (디버그 콘솔로)

    서버를 시작하면 아래 콘솔이 터미널로 뜬다
    디버그 콘솔로 바꿀꺼임
    notion image
    유저로 선택
    notion image
    콘솔 치고 스크롤 내려서 자바 디버그 세팅으로 이동
    notion image

    디버그 콘솔 이쁘게 변경

    application.preperiance파일을
    yml로 변경
    notion image
    넣기
    spring: output: ansi: enabled: always
    이렇게
    notion image
    이뻐짐
    notion image

    폰트 바꾸기

    유저 세팅파일로 간다
    notion image
     
    붙여넣기
    "editor.fontFamily": "JetBrains Mono, Consolas, 'Courier New', monospace", "editor.fontSize": 16, "editor.lineHeight": 1.6,
    notion image

    아이콘 변경(파일 옆에 있는 아이콘)

    notion image
     
    테마 선택 가능
    notion image
    notion image
     
     

    단축키

    테마 색 바꾸기

    ctrl + `(백틱(키보드 왼쪽 위에 있는 물결표 쪽)

    디버그 콘솔 서버 키고 끄기

    shift + f9 누르면 서버 실행
    shift + f5 서버 끄기

    필요 없이 import된 것 지우기

    누르면 필요없는 import된것 지워짐
    💡
    alt shift o

    롬북 설치

    notion image

    컨트롤러 만들기

    java\com\example\demo여기서 오른쪽 클릭하고 new File
    notion image
     
    notion image
    탭 하면 리턴타입으로 가서 계속 탭 해주면 된다!

    그래이들 추가

    라이브러리 추가하기
    notion image
     
    마븐 레파지토리 들어가기
    Maven Repository: jbcrypt
    Maven Repository: jbcrypt
    https://mvnrepository.com/search?q=jbcrypt
    notion image
    0.4 클릭
    notion image
    그래이들 클릭
    notion image
    notion image
    그래이들 리로드 오른쪽 클릭하기
    (나름 최신버전이라 오른쪽에 있는듯 옛 버전은 그래이들 창 위에 리로드창 있음)
    notion image

    그래이들 안될 시@

    💻
    그레이들 추가했는데 오류시 (1)

    라이브러리 됐는지 확인 방법, 솔트 설명

    BC쳤을 때 BCrypt 나오는지 확인
    package com.example.demo; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RestController; @RestController public class IndexController { @GetMapping("/") public ResponseEntity<?> home() { return new ResponseEntity<>("ok", HttpStatus.OK); } @GetMapping("/user") public ResponseEntity<?> user() { String rawPassword = "1234"; String encPassword = BC return new ResponseEntity<>("user", HttpStatus.OK); } }
    notion image
     
    해시에 소금 뿌리기
    notion image
     
    솔트넣는법
    897의 원본이 a_metacoding 이여서
     
    위험한게 salt 털리면 큰일남!
    salt도 현재 시간 등 나만 알고 있는 알고리즘 넣어서 다르게 한다!!
    매번 다르게 salt다르게 만들어서 알고리즘만 알 수 있게
    notion image
     
     
    다시 검증 해야 하잖아
    @GetMapping("/verify") public ResponseEntity<?> verify() { String rawPassword = "1234"; String dbPassword = "$2a$10$JPL/lnIokpo4Wd5nSgFfs.ug.hPRuMC2MKJOdtWP.8hhzNx3euZlW"; boolean isSame = BCrypt.checkpw(rawPassword, dbPassword); return new ResponseEntity<>(isSame, HttpStatus.OK); }
    notion image
     
     
    솔트코드
    package com.example.demo; import org.mindrot.jbcrypt.BCrypt; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RestController; @RestController public class IndexController { @GetMapping("/") public ResponseEntity<?> home() { return new ResponseEntity<>("ok", HttpStatus.OK); } @GetMapping("/user") public ResponseEntity<?> user() { String rawPassword = "1234"; String salt = BCrypt.gensalt(); String encPassword = BCrypt.hashpw(rawPassword, salt); System.out.println("salt : " + salt); System.out.println(encPassword); return new ResponseEntity<>(encPassword, HttpStatus.OK); } @GetMapping("/verify") public ResponseEntity<?> verify() { String rawPassword = "1234"; String dbPassword = "$2a$10$JPL/lnIokpo4Wd5nSgFfs.ug.hPRuMC2MKJOdtWP.8hhzNx3euZlW"; boolean isSame = BCrypt.checkpw(rawPassword, dbPassword); return new ResponseEntity<>(isSame, HttpStatus.OK); } }
    자세한 솔트 설명은 여기
    너무 좋아
    비밀번호 털렸다고? 암호화. 해시함수. 5분 설명.
    프로그래밍은 몰라도. 요건 배워두면 인생에 도움이 될 수 있음. 누구나 이해할 수 있도록 쉽게 패스워드 암호화에 대해서 설명해봤어요~! 그나저나 오늘 좀 늦었네요......일주일에 1회 영상 올리는데도 이렇게 힘들다니. 하아. 다른 유튜버분들 존경합니다 -0-... - #코알못 #해킹 #프로그래밍 #코딩 - 📌니콜라스와 코딩 공부하기 https://nomadcoders.co - 📌 Learn to code for free! https://en.nomadcoders.co
    비밀번호 털렸다고?  암호화. 해시함수. 5분 설명.
    https://youtu.be/67UwxR3ts2E?si=-1mlm8Pj8QRdokDJ
    비밀번호 털렸다고?  암호화. 해시함수. 5분 설명.

    테스크 코드 단축키 같은 것!!

    notion image
    처음하면 java 클릭하면 됨
    notion image
     
    { "Code Split": { "prefix": "mcs", "body": [ "/**", "* $1", "* $2", "**/" ], "description": "Code Split" }, "Junit Test Method": { "prefix": "tt", "body": [ "@Test", "public void $1_test() throws Exception {", " // given", " $2", "", " // when", "", "", " // then", "", "}" ], "description": "Junit Test Method" }, "Log": { "prefix": "logd", "body": [ "log.debug(\"디버그 : $1\"$2);" ], "description": "logd" }, "Sysout": { "prefix": "syst", "body": [ "System.out.println(\"테스트 : $1\"$2);" ], "description": "sysout" }, "ReturnMapping": { "prefix": "rr", "body": [ "return new ResponseEntity<>(new ResponseDto<>(1, \"\", null), HttpStatus.OK);", ], "description": "ResponseMapping" }, "ErrorMapping": { "prefix": "err", "body": [ "return new ResponseEntity<>(new ResponseDto<>(-1, \"\", null), HttpStatus.BAD_REQUEST);", ], "description": "ResponseMapping" }, "GetMapping": { "prefix": "getm", "body": [ "@GetMapping(\"/$1\")", "public ResponseEntity<?> $2(){", " $3", "return new ResponseEntity<>(new ResponseDto<>(1, \"\", null), HttpStatus.OK);", "}", ], "description": "Mapping" }, "PostMapping": { "prefix": "postm", "body": [ "@PostMapping(\"/$1\")", "public ResponseEntity<?> $2(){", " $3", " return new ResponseEntity<>(new ResponseDto<>(1, \"\", null), HttpStatus.CREATED);", "}", ], "description": "Mapping" }, "PutMapping": { "prefix": "putm", "body": [ "@PutMapping(\"/$1\")", "public ResponseEntity<?> $2(){", " $3", " return new ResponseEntity<>(new ResponseDto<>(1, \"\", null), HttpStatus.OK);", "}", ], "description": "Mapping" }, "DeleteMapping": { "prefix": "delm", "body": [ "@DeleteMapping(\"/$1\")", "public ResponseEntity<?> $2(){", " $3", " return new ResponseEntity<>(new ResponseDto<>(1, \"\", null), HttpStatus.OK);", "}", ], "description": "Mapping" }, "Logger": { "prefix": "logf", "body": [ "private final Logger log = LoggerFactory.getLogger(getClass());" ], "description": "Logger Field" }, "MapToList": { "prefix": "mapToList", "body": [ "$1.stream().map((e)-> e).collect(Collectors.toList());" ], "description": "MapToList" }, "AssertThatEquals": { "prefix": "asse", "body": [ "assertThat($1).isEqualTo($2);" ], "description": "AssertThatEquals" }, }
    ncs tt err getm postm
    단축키다!!
     
    $1이 커서가 그쪽으로 감
     
    이런게 쉘 문법이다!!
     
    이런거 배우려면
    강사님 유튜브 aws 강의 보면 됨!!
    배우고 나면
    git bash로 가능!!
    Share article

    code-sudal

    RSS·Powered by Inblog