본문 바로가기
반응형

Web Programing!301

[Spring boot]스케줄러(scheduler) [Spring boot]스케줄러(scheduler) 정해진 시간에 주기적으로 반복적인 일을 수행하는 경우가 많습니다.@Scheduled 어노테이션으로 몇 가지의 설정을 통해 반복 작업을 실행할 수 있습니다. 1. Application 상단에 @EnableScheduling 추가 @SpringBootApplication@EnableCaching@EnableSchedulingpublic class WebApplication {} 2. 선언import org.springframework.scheduling.annotation.EnableScheduling;import org.springframework.scheduling.annotation.Scheduled;import org.springframework.s.. 2019. 4. 10.
[POSTGRESQL] 계정 생성하기 계정 생성 1. postgresql 콘솔 로그인 # su - postgres -c psql 2. 사용자 생성 - CREATE ROLE postgres=# create role '계정명' login password '비밀번호' superuser; 3. DB 생성 - CREATE DATABASE postgres=# create database db명 owner=계정명; (나가기) postgres=#\q 4.접근권한 추가 # vi /var/lib/pgsql/data/pg_hba.conf (내용추가) # Hive local all all md5 host all all 0.0.0.0/0 md5 2019. 4. 3.
[리눅스] grep에 color 넣기, 여러단어 찾기 [리눅스] grep에 color 넣기, 여러단어 찾기 color 넣기 --color 옵션을 주면 해당 찾고자 하는 단어에 지정된 색으로 표시해준다. 여러단어 찾기 grep 경우 - "REQ\|RES" egrep 경우 - '(REQ|RES)' 혹은 "REQ|RES" ex ) tail -f 파일명 | grep "REQ\|RES" --color tail -f 파일명 | egrep '(REQ|RES)' --color tail -f 파일명 | egrep "REQ|RES" --color 2019. 3. 30.
[JAVA ]spring url 이미지 다운로드 [JAVA ]spring url 이미지 다운로드 //URL로 이미지 가져오기 URL url = new URL("가져오고자하는 이미지URL"); InputStream in = new BufferedInputStream(url.openStream()); ByteArrayOutputStream out = new ByteArrayOutputStream(); byte[] buf = new byte[1024]; int n = 0; while (-1!=(n=in.read(buf))) { out.write(buf, 0, n); } out.close(); in.close(); byte[] response = out.toByteArray(); //폴더 생성 File fileDir = new File("원하는 경로", "파.. 2019. 3. 29.
반응형