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
lang: ko | |
notification: | |
mail: | |
smtpService: Naver | |
smtpHost: smpt.naver.com | |
smtpPort: 587 | |
senderMail: mnhan0403@naver.com | |
receiverMail: mnhan0403@gmail.com | |
targets: | |
- jobhope/TechnicalNote |
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 java.util.Scanner; | |
public class Main2 { | |
public static void main(String[] args) { | |
Scanner scanner = new Scanner(System.in); | |
int count = scanner.nextInt(); | |
for (int index = 0; index < count; index++) { | |
System.out.println("Hello"); | |
} | |
} |
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
// Hashed Sharding 방식을 이용하여 테스트합니다. 다른 방식을 이용해도 무방합니다. | |
sh.enableSharding("sharding-test") | |
use sharding-test | |
db.items.createIndex({"index": "hashed"}) | |
sh.shardCollection("sharding-test.items", {"index": "hashed"}) | |
for (var n=1; n<=100000; n++) db.items.insert({index: n, name: "test"}) | |
db.items.count() // 10만개의 데이터가 정상적으로 작성되었는지 확인합니다 | |
// 각 Primary Shard 서버에 접속하여 아래의 명령어를 실행합니다. | |
use sharding-test |
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
sharding: | |
configDB: "configRepl/<server1 hostname or ip>:<port>,<server2 hostname or ip>:<port>,<server3 hostname or ip>:<port>" | |
net: | |
bindIpAll: true | |
port: 30000 // 없을 경우 27017이 기본 값 |
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
rs.initiate( { | |
_id : "configRepl", | |
members: [ | |
{ _id: 0, host: "<server1 hostname>:<port>" }, | |
{ _id: 1, host: "<server2 hostname>:<port>" }, | |
{ _id: 2, host: "<server3 hostname>:<port>" } | |
] | |
}) |
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
sharding: | |
clusterRole: configsvr | |
replication: | |
replSetName: “configRepl” | |
net: | |
bindIpAll: true | |
port: 20000 // 없을경우 27019이 기본 값 | |
storage: | |
dbPath: "/mongodb/config" |
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
process.cwd() // Call this line. Returned current path to string. |
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
// Javascript is not support enum type. | |
const State = { | |
SUCCESS: 1, | |
UNKNOWN: 2, | |
FAILED: 4 | |
}; | |
console.log(State.SUCCESS); // prints 1. | |
console.log(State.UNKNOWN); // prints 2. | |
console.log(State.FAILED); // prints 4. |
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
// in node application. | |
const pkg = require('./package.json'); // Declare this line. | |
pkg.version // package version | |
pkg.name // pacakge name | |
pkg.author // package author | |
// ... etc |
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
const regex = /url\((.*?)\) format\((\'|\")(.*?)(\'|\")\)/g; | |
const str = `CSS Input`; | |
let m; | |
while ((m = regex.exec(str)) !== null) { | |
// This is necessary to avoid infinite loops with zero-width matches | |
if (m.index === regex.lastIndex) { | |
regex.lastIndex++; | |
} | |
NewerOlder