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
$ vim /etc/systemd/system/mysql.service | |
[Service] | |
LimitNOFILE = infinity | |
LimitCore = infinity | |
LimitMEMLOCK = infinity | |
$ systemctl daemon-reload | |
$ service mysql restart | |
$ ps -ef | grep mysql | awk '{print $2}' | head -n1 | xargs -I{} cat /proc/{}/limits |
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
0. lvm 설치 | |
$ yum install lvm2 -y | |
1. 디스크 먼저 추가 | |
(/dev/xvdb 라고 가정) | |
2. fdisk 로 해당 디스크 파티셔닝 및 파일시스템을 Linux LVM (8e) 타입으로 변경 | |
$ fdisk /dev/xvdb | |
Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel | |
Building a new DOS disklabel with disk identifier 0xe866154b. |
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
[client] | |
default-character-set = utf8mb4 | |
no-auto-rehash # faster cli interaction but no autocomplete | |
show-warnings # show warnings when it happens | |
prompt=\u@\h:\d\_\R:\m:\\s> # make cli prompt better ex) root@localhost:(profile) 17:08:55> | |
pager="less -n -i -F -X -E" # using less for long result rows | |
[mysqld] | |
# default | |
character-set-server = utf8mb4 |
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
import org.hibernate.proxy.HibernateProxy; | |
import org.hibernate.proxy.LazyInitializer; | |
import com.ngr.api.model.BaseModel; | |
/** | |
* | |
* public interface BaseModel<T> { | |
* public T getId(); | |
* } |
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
def testScreenshot() { | |
System.setProperty("webdriver.chrome.driver", "C:\\Users\\Greg\\Downloads\\chromedriver79.exe") | |
new File("screenshot.png").withOutputStream { | |
ChromeOptions options = new ChromeOptions() | |
options.headless = true | |
WebDriver driver = new ChromeDriver(ChromeDriverService.createDefaultService(), options) | |
try { | |
driver.get("https://www.google.com") | |
it.write(driver.getScreenshotAs(OutputType.BYTES)) | |
} finally { |
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
offset reset (0.8.2 기준) | |
topic을 지워봐야 zookeeper에 보존된 low-level offset을 초기화 할 수 없음. | |
따라서 zookeeper shell에 접근해서 low-level offset을 초기화해야함. | |
[root@sv-kafka-dev01 bin]# ./zookeeper-shell.sh sv-zkdev1a.idincu.net:2181/kafka | |
Connecting to sv-zkdev1a.idincu.net:2181/kafka | |
ls /consumers |
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
$ netsh int ipv4 add excludedportrange protocol=tcp startport=2375 numberofports=1 |
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
#!/bin/bash | |
# | |
# How to restore? | |
# $ zcat backup.sql.gz | mysql -h{} -u{} -p --database {dbname} | |
# | |
# --set-gtid-purged=OFF → https://stackoverflow.com/a/49059063/1378965 | |
# --column-statistics=OFF → https://serverfault.com/a/912677/538646 | |
# --single-transaction → https://dev.mysql.com/doc/refman/5.7/en/mysqldump.html#option_mysqldump_single-transaction | |
# --no-create-db → https://dev.mysql.com/doc/refman/5.7/en/mysqldump.html#option_mysqldump_no-create-db | |
# --skip-add-drop-table → https://dev.mysql.com/doc/refman/5.7/en/mysqldump.html#option_mysqldump_add-drop-table |
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
CriteriaBuilder cb = new CriteriaBuilder(); | |
// = SELECT * FROM entity WHERE JSON_EXTRACT("json_column", "$.path") | |
Root<entity> root; | |
cb.equal( | |
cb.function("JSON_EXTRACT", Integer.class, root.get("json_column"), "$.path"), | |
100); |
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
package util; | |
import org.apache.commons.io.IOUtils; | |
import org.apache.http.client.ResponseHandler; | |
import org.apache.http.client.config.CookieSpecs; | |
import org.apache.http.client.config.RequestConfig; | |
import org.apache.http.client.methods.HttpUriRequest; | |
import org.apache.http.impl.client.CloseableHttpClient; | |
import org.apache.http.impl.client.DefaultHttpRequestRetryHandler; | |
import org.apache.http.impl.client.HttpClients; |