Skip to content

Instantly share code, notes, and snippets.

View namkyu's full-sized avatar

Namkyu Lee namkyu

View GitHub Profile
@namkyu
namkyu / jquery.md
Last active July 30, 2018 08:26
jquery #javascript

ajax

function callAjax(requestUrl, method, callbackFunction, data) {
	$.ajax({
		url : requestUrl,
		type : method,
		data : data,
		dataType : "html",
		async : false,
 success : function (result, status, xhr) { 
@namkyu
namkyu / spring_boot_desc.md
Last active May 8, 2018 01:06
spring boot #spring_boot

auto configuration

새로운 프로젝트 마다 반복적인 설정을 해결하기 위한 고민에서 시작

설정 클래스는 다 어디 갔을까?

 - mvc, jpa, datasource 설정들
 - EnableAutoConfigurationImportSelector 에서 설정을 등록한다.
  > META-INF/spring.factories 위치에 설정 파일 리스트 읽어온다.
@namkyu
namkyu / basic.md
Last active May 2, 2018 07:40
basic command #linux

버전 확인

cat /etc/*release

hostname 변경

# hostnamectl set-hostname docker
@namkyu
namkyu / cmd.md
Last active February 7, 2018 05:40
linux utils #linux_utils

여러대의 원격 장비에 command를 실행하고 싶을 때 (실행에 대한 output 가능) 서버파일리스트의 포멧은 계정@172.19.136.18 과 같이 기록한다.

cmd.sh

#!/bin/sh

if [ $# -lt 2 ]
then
 echo "Usage : $0 {명령어} {서버파일리스트}"
@namkyu
namkyu / shell_script.md
Last active February 5, 2018 09:21
shell script #linux

Parameter

Example 1

파라미터 0번째는 bash 파일명이 출력된다.

#!/bin/bash

echo "The script name : $0"
echo "The value of the first argument to the script : $1"
@namkyu
namkyu / elasticsearch_rolling_restarts.md
Last active February 6, 2018 23:39
elasticsearch rolling restarts #elasticsearch

1. shard allocation 옵션을 disabled 처리

$ curl -XPUT 'localhost:9200/_cluster/settings?pretty=true' -d '{
    "transient" : {
        "cluster.routing.allocation.enable" : "none"
    }
}'

2. 노드 shutdown

@namkyu
namkyu / scp.md
Last active February 7, 2018 00:38
scp command #linux
@namkyu
namkyu / MariaDB.md
Created December 21, 2017 00:26
mariadb command #db

host 정보 확인

SELECT @@hostname;
@namkyu
namkyu / elasticsearch_configuration.md
Last active January 8, 2018 06:54
elasticsearch configuration #elasticsearch

master node

cluster.name: nklee-data-cluster
node.name: nklee-data-master1
node.master: true
node.data: false
index.number_of_shards: 5
index.number_of_replicas: 1
network.host: 0.0.0.0
transport.tcp.port: 9300
@namkyu
namkyu / settingsAndMappings.md
Last active December 20, 2017 06:27
elasticsearch settings, mappings json file #elasticsearch

settings.json

{
  "number_of_replicas": "1",
  "number_of_shards": "5",
  "refresh_interval": "1s",
  "index.store.type": "fs"
}

mappings.json