Posts with the tag Cheat:
2021-01-30
148 words
Cheat
Cheat sheet for Docker. It consists of Dockerfile like FROM, RUN, ENTRYPOINT, VOLUME and Docker command like docker build, docker image, docker run.
Index
DockerFile Cheat Sheet Docker Command Cheat Sheet Dockerfile 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 just like a recipe for building images.
[Picture 1] DockerFile Cheat Sheet Docker Command Cheat Sheet Docker is working like linux.
2021-01-11
507 words
Cheat
Cheat sheet for Java Regex: Changing plain text, extracting substring. Index Change plain text to Korean Phone Number format Extracting SubString Change plain text to Korean Phone Number format 1 2 3 4 5 6 7 8 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); } 맨처음에는 패턴들에 통째로 replaceAll을 걸었는데 그럼 결과가 그냥 DEST_PHO
2020-12-12
4240 words
Cheat
Linux command를 위한 Cheat Sheet: zcat, grep, jar, apt-cache, pgrep, route, ip, watch, wc, ss etc. Index If operation 2021 Cheat Sheet 2020 Cheat Sheet If operation IF operation 2021 Cheat Sheet 압축을 풀지 않고 압축 파일 확인하는 방법 1 2 3 4 5 zcat test2.log.gz # pagination with zcat # cat 커맨드 처럼 less를 뒤에 써주면 된다. zcat test2.log.gz | less 가끔 압축되어있는
2020-10-07
1223 words
Cheat
Cheat sheet for Java stream: computIfPresent, computeIfAbsent, disjoint, joining.
Index
Map Stream Map computeIfPresent - update value 1 2 3 4 5 Map<String, Integer> test = new HashMap<>(){{ test.put("ME", 25); test.put("Mom", 67); }}; test.computeIfPresent("Me", (k, v) -> v + 1); computeIfAbsent - put k, v when the key is not there 1 test.computeIfAbsent("Sister", k -> 25); Once, I wanted to use computeIfPresent and computeIfAbsent at once. My intend was putting (key, value) in specific map when ther is no key. And later, when the map meet the same key again, then update value.
But I missed the point. Thoese two method cannot be used at the same time.
2020-09-24
1830 words
Cheat
Cheat sheet for Git: log, diff, branch, switch, checkout, restore, commit, reset etc. Index Git Cheat Sheet Git Cheat Sheet make annotated tag 1 git tag -a v1.0.0 -m "leave message here for tag" git log 1 2 3 4 5 6 7 8 # show log with one line git log --oneline # show log with graph tree git log --graph # show log with both git log --oneline --graph compare file between two branches 1 2 3 git diff branch1..branch2 -- "file_name" ex) diff 2021_0405_user..master -- build.gradle change branch name 1 git branch -m "branch_name" making branch with