-FOR MAC OSX 
1.HOMEBREW를 설치 한다.

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

2.gollum git hub 사이트로 가서 설치 법을 확인! https://github.com/gollum/gollum/wiki 
3.brew install icu4c 
4.sudo gem install charlock_holmes -- --with-icu-dir=/usr/local/opt/icu4c 
5.sudo gem install gollum 
6.실행: gollum --port 8099 [폴더명] -> 폴더명을 지정해주지 않으면 실행하는 곳에 파일을 만든다. 
7.해당 폴더에 git init를 해주지 않으면 제대로 동작하지 않는다.
8.가끔

incompatible character encodings: UTF-8 and ASCII-8BIT 

에러가 발생한다.
9.나 같은 경우 집에서 윈도우로 이미 PUSH 한 데이터를 내려 받아 MAC에서 다시 PUSH 할 경우 이러한 문제가 발생했다.
10.gollum-rugged_adapter를 설치해 주면 된다.
11.brew install cmake
12.brew install pkg-config
13.sudo gem install gollum-rugged_adapter
14.gollum --adapter rugged

잘됨.

push git은 비공개인 비트버킷을 이용하여 백업한다.

source tree 앱을 활용 중

'Hun Site > IT' 카테고리의 다른 글

Hadoop DATANODE Java Heap Warning  (0) 2016.08.24
HIVE 성능 향상 방안  (0) 2016.08.18

윈도우10 시작프로그램을 설정하는 방법은 아래와 같다.


1. 키보드의 윈도우 + R을 눌러 '실행 프로그램'을 실행한다.

2. '실행 프로그램'에 shell:startup을 실행한다.

3. 시작 프로그램 폴더에 필요한 바로가기 파일(.lnk)을 넣는다.


클라이언트 코드

package com.blog.naver.fiesta77.client;

import java.net.Socket;
import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.IOException;

public class ClientTest {
  private static final String CONN_HOST = "www.host.com";
  private static final int    CONN_PORT = 12345;
  public static void main(String[] args) {
    Socket socket = null;
    try {
      socket = new Socket(CONN_HOST, CONN_PORT);
      DataInputStrean in = new DataInputStream(socket.getInputStream());
      DataOutputStream out = new DataOutputStream(socket.getOutputStream());

      int message = in.readInt();
      System.out.printf("recv message is %d\n", message);
      message *= 10;
      out.writeInt(message);
    } catch (IOException e) {
      e.printStackTrace();
    } finally {
      if (socket != null) try { socket.close(); } try (IOException e) {}
    }
  }
}


코드 분석


클라이언트 소켓 프로그래밍은 서버 소켓 프로그래밍과 별반 차이가 없다.
자바의 net 패키지가 워낙에 쉽게 소켓 프로그래밍을 할 수 있도록 만들어서인데
ServerSocket 대신 Socket 객체를 생성할 때 접속할 호스트와 포트만 넘겨주면 끝이다.
그 이후는 서버 프로그래밍과 마찬가지로 InputStream과 OutputStream으로 데이터를 넘겨주면 끝이다.
(Stream은 바이너리 형식이므로 만약 String을 사용할 예정이라면 Reader를 사용하면 된다.)

+ Recent posts