728x90
반응형

IT 156

port 8080 was already in use (윈도우에서)

앱이 실행중일 때 인텔리제이를 끄면서 terminate를 해야 했는데 disconnect를 눌러버림 인텔리제이를 다시 켜서 실행하려니 port 8080 was already in use 두둥.... 윈도우 명령어는 안익숙해서 뭐라고 쳐야 하는지 찾아봄 ㅠ 해당 포트 사용중인 프로세스 찾기 > netstat -ano 프로세서가 너무 많아서 8080만 찾을때 (리눅스의 grep) > netstat -ano | findstr 8080 종료시키기 > taskkill /f /pid 0000

IT/서버 2021.10.28

Spring Security에서 컨트롤러 메서드 별 권한 지정 (@Secured, @PreAuthorize)

원래 antMatchers로 지정하던 권한 @Secured와 @PreAuthorize 어노테이션으로 그자리에서 지정하기 기존 @RequiredArgsConstructor @EnableWebSecurity public class SecurityConfig extends WebSecurityConfigurerAdapter { @Override protected void configure(HttpSecurity http) throws Exception{ http //... .and() .authorizeRequests() .antMatchers("/auth/test").hasRole("USER")// 이렇게 config에서 모아서 지정하는 방식 .anyRequest().permitAll() // ... } }..

쿠키 생성, 삭제

쿠키 만들기 @PostMapping("/test") public String test(HttpServletRequest request, HttpServletResponse response){ Cookie testCookie= new Cookie("testCK", "asdf"); testCookie.setPath("/"); testCookie.setMaxAge(60*60*24*15); //시간 0으로 하면 쿠키삭제 //시간 -1로 하면 쿠키 계속보존 // 만든 쿠키는 response에 담아서 보내줌 response.addCookie(testCookie); return "ok"; } 쿠키 지우기 @PostMapping("/test") public String test(HttpServletRequest req..

mysql 외부 접속

뭐 이런거나 GRANT ALL PRIVILEGES ON *.* TO '아이디'@'%' IDENTIFIED BY '패스워드'; 이런거 등 INSERT INTO mysql.user (host,user,password,ssl_cipher, x509_issuer, x509_subject) VALUES ('%','아이디',password('패스워드'),'','',''); GRANT ALL PRIVILEGES ON *.* TO '아이디'@'%'; FLUSH PRIVILEGES; 계정 만들때 패스워드 잘못했으면 사용자 암호 바꾸기 ALTER USER 'user-name'@'localhost' IDENTIFIED BY 'NEW_USER_PASSWORD'; FLUSH PRIVILEGES; 별짓 해도 다 안되면 한번 확인..

IT/db 2021.10.13

영상 스트리밍 : rtmp와 ffmpeg 그리고 hls

HLS (HTTP Live Streaming) HLS : http 기반 스트리밍 프로토콜 하나의 긴 영상파일을 일정한 구간별로 작게 잘라 ts파일로 만들어 하나씩 전송 이때 ts파일들의 메타정보를 가지고 있는 m3u8을 함께 제공 클라이언트는 m3u8 파일을 참고하여 전송받은 ts파일을 순차적으로 재생시킴 → 전체 영상을 모두 받지 않아도 바로 영상 재생이 가능 * 유사 프로토콜 : mpeg-dash FFmpeg : 코덱과 트랜스코딩 코덱 : 압축 알고리즘. Encoder와 Decoder를 둘 다 가지고 있거나 하나만 가지고 있음 - Encoder : 압축하는거 - Decoder : 압축한 걸 다시 푸는거 트랜스코딩 : 인코딩 형식을 변화시키는 것. flv 파일을 mp4 파일로 바꾸는 등 FFmpeg은 ..

IT/서버 2021.09.16
300x250
반응형