This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ethtool 설치 | |
$ apt install ethtool | |
# 어탭터와 맥 주소 IP 확인 | |
$ ip addr | |
root@proxmox:~# ip addr | |
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000 | |
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 | |
inet 127.0.0.1/8 scope host lo | |
valid_lft forever preferred_lft forever |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
BigDecimal a = new BigDecimal("0.4"); | |
BigDecimal b = new BigDecimal("0.40"); | |
// 객체의 레퍼런스 주소에 대한 비교 연산자, 무의식적으로 값의 비교를 위해 사용하면 오동작 | |
// false | |
a == b; | |
// 값의 비교를 위해 사용, 소수점 맨 끝의 0까지 완전히 값이 동일해야 true 반환 | |
// false | |
a.equals(b); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// https://www.baeldung.com/java-stacktrace-to-string | |
String stacktrace = ExceptionUtils.getStackTrace(e); | |
// commons-lang3 jar 구현체 | |
public static String getStackTrace(Throwable throwable) { | |
StringWriter sw = new StringWriter(); | |
PrintWriter pw = new PrintWriter(sw, true); | |
throwable.printStackTrace(pw); | |
return sw.getBuffer().toString(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// https://www.tabnine.com/code/java/methods/org.apache.commons.httpclient.methods.PostMethod/getRequestEntity | |
((StringRequestEntity)post.getRequestEntity()).getContent(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// https://stackoverflow.com/questions/11401897/get-the-current-domain-name-with-javascript-not-the-path-etc | |
function getDomain(url, subdomain) { | |
subdomain = subdomain || false; | |
url = url.replace(/(https?:\/\/)?(www.)?/i, ''); | |
if (!subdomain) { | |
url = url.split('.'); | |
url = url.slice(url.length - 2).join('.'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# http version | |
$ http --version | |
# https://stackoverflow.com/questions/37215565/sending-nested-json-object-using-httpie | |
$ echo '{ "user": { "name": "john", "age": 10 } }' | http httpbin.org/post | |
$ http PUT localhost:8080/user <<<'{ "user": { "name": "john", "age": 10 }}' |
xstream 1.4.18 이상 부터 권한 문제 이슈 https://stackoverflow.com/questions/30812293/com-thoughtworks-xstream-security-forbiddenclassexception
NewerOlder