• [Docker] Docker cheat sheet (img)

    Dockerfile command cheat sheet I have to make image before running docker container with the image. How to get images I need? I can just pull images from my/someone else’s docker hub repository or I can even make one all by myself. Do this, I must write Dockerfile. Dockerfile is...


  • [Spring] Spring boot unit test with Junit5

    I know I have to do unit test … Making test code is always big burden for me. No time for writing test code, and also don’t know how. What is @SpringBootTest and Junit?? I always felt something like that when thinking about test, but I do think I have...


  • [Linux] Host and url name convention

    Today, I had to be through very awful exception. There is an api server I have to (my server have to) send a request to update meta data. (For performance issue, this server just cached meta data and uses it till updated) Usually it’s quite simple. Make request with RestTemplate...


  • [Spring] Loading resource inside of jar and outside of jar

    Roughly 4 months age, I was assigned to make function with excel. It was like this. I had made a template excel in advance and my colleagues downloaded it and filled it. After that, I read it and inserted data to database. And this week, I was assigned new function...


  • [Linux] Write shell script to rotate log

    UPDATE VERSION OF SHELL SCRIPT WITH PASSWORD One month ago, I make this shall script with hard coded user password and I knew that was a bad idea. It’s is well known fact that leaving password somewhere or some files can be a huge problem with security later. So I...


  • [Linux] Linux command & shell script cheat sheet

    Linux Shell Script if operation cheat sheet Linux command 2021 압축을 풀지 않고 압축 파일 확인하는 방법 (포스팅에는 zcat만 썼는데 찾아보니 zless도 있다고 한다). 가끔 압축되어있는 gz 파일을 확인할 일이 생긴다. 압축된 파일을 보려면 압축을 풀고, 그 다음에 조회를 해야 한다고 생각했지만 zcat 커맨드를 사용하면 압축을 풀지 않고도 확인을 할...


  • [MySQL] View and a little bit of UNION/JOIN

    MySQL view and a little bit of union and join Today, I faced my big mistake with new updated function which is made by me as well. The situation is something like this. We have a message service firing with multiple condition such as accomplish of today’s step count or...


  • [Front] Divide layout in thymeleaf.

    How do I feel about not divide html layout. Suffocating with 2000 line! At first I didn’t know the importance about splitting html and making layout. But when I saw 2000 line html files with so many duplicated code (mostly nav, header, side-bar) I felt like I should change my...


  • [Front] Upload file with Drag and Drop!

    drag and drop (front) Taking file with more action Few days ago, I had to make a function that is about taking excel file from client side and reading it to save to our database. I usually go as simple as possible in terms of HTML/CSS, but this time I...


  • [Java] Regex cheat sheet for myself

    plain 숫자 스트링을 전화번호 형식으로 바꾸기 public static void testNumber(String src) { Pattern SRC_PHONE_FORMAT = Pattern.compile("(\\d{3})(\\d{4})(\\d{4})"); Pattern DEST_PHONE_FORMAT = Pattern.compile("$1-$2-$3"); String dest = src.replaceFirst(SRC_PHONE_FORMAT.toString(), DEST_PHONE_FORMAT.toString()); System.out.println(dest); } 보통 정규식으로는 내가 원하는 형태로 값이 들어왔나 체크하느라 쓰는 경우가 많았고, 값을 바꾸는데 정규식을 이용한적이 드물어서 처음에 어떻게 해야 하나 많이 헷갈렸는데 방법을...