xshell로 서버에 접속해서 코딩 작업 중

한글을 사용하면 파일에서는 괜찮은데 실행 시 깨져서 나오는 문제 발생


사람들이 바꾸라는대로 바꿔도 해결되지 않았는데 결국 해결


[방법]

1. /etc/sysconfig/i18n 을 열어서 아래와 같이 수정 후 . /etc/sysconfig/i18n 실행


LANG="ko_KR.UTF-8"

SUPPORTED="en_US.UTF-8:en_US:en:ko_KR.UTF-8:ko_KR:ko"

SYSFONT="latarcyrheb-sun16"



2. xshell의 등록 정보 클릭 후 그림과 같이 터미널로 들어가서 인코딩 설정을 유니코드(UTF-8)로 설정




3. 이후에 작성한 파일들이 깨져서 나타날 시에는 ftp로 다운 받아 다시 저장하기로 인코딩을 utf-8로 저장하면 끝.


Posted by halloRa
,

출처: https://kldp.org/node/95323


$ paste 1.txt 2.txt > merge_1_2.txt

Posted by halloRa
,

출처: http://webdir.tistory.com/170


기본 설정된 상태의 CentOS에서 실제로 웹서비스를 하기 위해서는 

iptables의 설정 변경을 통해 외부 접속을 위한 포트를 설정해주어야 한다.


기본 httpd 사용을 위한 80번 포트 개방과 

node.js 실습을 위한 8080번 포트를  개방 해주기 위해서

/etc/sysconfig/iptables 를 열어서 아래와 같이 입력한다.


-A INPUT -p tcp -m tcp --dport 80 -j ACCEPT

-A OUTPUT -p tcp -m tcp --dport 80 -j ACCEPT

-A INPUT -p tcp -m tcp --dport 8080 -j ACCEPT 

-A OUTPUT -p tcp -m tcp --dport 8080 -j ACCEPT 

-A INPUT -j REJECT --reject-with icmp-host-prohibited


이 때 주의해야 할 것은 위의 4개 코드가 빨간 색의 코드보다 반드시 위에 적혀 있어야 한다.

Because,

iptables 규칙을 만들 때는 순서가 매우 중요하다.
예를 들어 만일 chain에서 로컬 192.168.100.0/24 서브넷에서 들어오는 모든 패킷을 drop하도록 지정한 후 (drop 하도록 지정된 서브넷에 포함되는) 192.168.100.13에서 들어오는 패킷을 모드 허용하는 chain (-A)을 그 후에 추가하면 뒤에 추가된 추가 규칙이 무시된다.
먼저 192.168.100.13를 허용하는 규칙을 설정한 후 서브넷을 drop하는 규칙을 설정해야한다.


이후에 

> service iptables restart

명령어를 실행해주면 2개의 포트가 열러서 정상적으로 외부접속이 가능해지는 것을 확인할 수 있다.



'프로그래밍 > LINUX' 카테고리의 다른 글

서버에서 한글이 깨질 때  (0) 2013.11.18
2개의 파일 column 합치기  (0) 2013.11.06
.bash_profile 설정 변경 후 bash reload  (0) 2013.07.29
C++ 파일과 mysql++을 이용한 컴파일  (0) 2012.09.14
mysql++ 설치하기  (0) 2012.09.14
Posted by halloRa
,

sys:1: DeprecationWarning: Non-ASCII character '\xc6' in file filterCIGAR.py on line 5, but no encoding declared; see http://www.python.org/peps/pep-0263.html for details 와 같은 에러 발생 시


# This Python file uses the following encoding: utf-8


의 문장을 해당 python 파일 맨 위에 삽입 시켜 주면 해결



--------------------------------------------------------------------------------------------------------------------

윈도우 PC에서 작업 시

출처: http://blog.naver.com/PostView.nhn?blogId=johoonx2&logNo=110154861377&parentCategoryNo=&categoryNo=17&viewDate=&isShowPopularPosts=true&from=search


#-*- coding: cp949 -*-
#-*- coding: utf-8 -*- 


2줄을 코드 페이지 상단에 입력하면 한글이 제대로 출력됨

[출처] [파이썬] 한글처리|작성자 johoonx2


2


'프로그래밍 > Python' 카테고리의 다른 글

Local PC에 파이썬 개발 환경 구축  (0) 2014.07.10
Posted by halloRa
,
출처: http://stackoverflow.com/questions/4608187/how-to-reload-bash-profile-from-the-command-line

> source ~/.bash_profile

or

> . ~/.bash_profile


Posted by halloRa
,

출처: http://stackoverflow.com/questions/3512603/compiling-multiple-packages-using-the-command-line-in-java (compiling multiple packages using the command line in Java)

Hi i have been using an IDE but now I need to run and compile from the command line.

The problem is that I have multiple packages and I have tried to find the answer but nothing has worked.

So I have

src/
  Support/ (.java files)
  Me/ (.java files) 
  Wrapers/ (.java files)  

Do you know how to compile everything with javac?

share|improve this question

This should do it (may require additional classpath elements via the -cp command line switch):

javac Support/*.java Me/*.java Wrapers/*.java

But if your build process gets more complex (and it will!), you should look into using Apache Ant for build automation.

share|improve this answer

출처: http://blog.naver.com/PostView.nhn?blogId=jazz1234k&logNo=40101348073 (jar 파일 만들기, 실행하기 KR)


출처: https://coderwall.com/p/ssuaxa (jar 파일 만들기, 실행하기 EN)


$ javac HelloWorld.java $ echo Main-Class: HelloWorld > MANIFEST.MF $ jar cvmf MANIFEST.MF helloworld.jar HelloWorld.class

$ java -jar helloworld.jar


출처: https://coderwall.com/p/ssuaxa (jar 파일 만들기, 실행하기 EN)


출처: https://blogs.oracle.com/olaf/entry/jdev_including_a_classpath_in (MANIFEST.MF 파일 만들 때)


----------------------------------------------------------------------------


$ javac -d bin src/.../data/*.java src/.../RNASim/*.java src/.../utils/*.java

를 이용하여 컴파일 후


$ vi MANIFEST.MF 

하여


Class-Path: /home/njkoo/program/RNAseqSim/bin/ /home/njkoo/program/RNAseqSim/includes/commons-math-2.2.jar

Main-Class: edu.unc.csbio.RNASim.MainCmdline


와 같이 입력 후 저장


$ jar cvmf MANIFEST.MF RNAseqSim-version.jar bin/.../data/*.class bin/.../RNASim/*.class bin/.../utils/*.class

를 이용하여 jar 파일을 생성하면


$ java -jar RNAseqSim-version.jar 

명령어를 이용하여 프로그램 실행 가능


혹은 jar 파일을 만들지 않고


$java -cp ./bin/:./includes/commons-math-2.2.jar edu.unc.csbio.RNASim.MainCmdline config.txt


$java -cp /home/njkoo/program/RNAseqSim/bin/:/home/njkoo/program/RNAseqSim/includes/commons-math-2.2.jar edu.unc.csbio.RNASim.MainCmdline config.txt


와 같은 명령어를 그냥 사용하여도 실행 가능.



'프로그래밍 > JAVA' 카테고리의 다른 글

JTable에서 열(row) 삭제하기  (0) 2012.11.14
[mysql]  (0) 2012.10.12
Table 만들기  (0) 2012.09.12
Border  (0) 2012.09.12
MFC와 같이 group 묶어주는 titled border  (0) 2012.09.11
Posted by halloRa
,

출처: http://stackoverflow.com/questions/5461972/boostfiltering-streambuf-with-gzip-decompressor-how-to-access-line-by-line



ifstream fin_unmapped_read(output.c_str(), ios_base::in | ios_base::binary);

filtering_streambuf<input> in;

in.push(bzip2_decompressor());

in.push(fin_unmapped_read);

//boost::iostreams::copy(in, cout);


std::istream incoming(&in);
getline(incoming, transfer);


Posted by halloRa
,

출처: http://rasskang.tistory.com/31


cpp 파일들을 array list로 할 경우

첫 번째 방식 사용 불가 -> *.cpp와 같은 확장자 포맷으로 인하여

두 번째 방식을 사용하여야 한다.

'프로그래밍 > SCRIPT' 카테고리의 다른 글

PHP] 파일 읽기  (0) 2011.06.22
PHP] php error 출력 설정  (0) 2011.06.19
html, PHP] form 사용하기  (0) 2011.06.18
php와 mysql 연동  (0) 2011.06.18
Posted by halloRa
,

출처: http://www.daniweb.com/software-development/java/threads/26217/deleting-rows-from-a-jtable


((DefaultTableModel)테이블명.getModel()).removeRow(row_index);

'프로그래밍 > JAVA' 카테고리의 다른 글

리눅스 상에서 jar 파일 만들기  (0) 2013.07.11
[mysql]  (0) 2012.10.12
Table 만들기  (0) 2012.09.12
Border  (0) 2012.09.12
MFC와 같이 group 묶어주는 titled border  (0) 2012.09.11
Posted by halloRa
,

[mysql]

프로그래밍/JAVA 2012. 10. 12. 15:58

mysql 작업 시 query를 날려 getResultSet()하였을 때

resultSet이 empty인 것을 확인하기 위한 방법


boolean empty = true;

while(rSet.next()){

...

empty = false;

}


if(empty) { ... }

'프로그래밍 > JAVA' 카테고리의 다른 글

리눅스 상에서 jar 파일 만들기  (0) 2013.07.11
JTable에서 열(row) 삭제하기  (0) 2012.11.14
Table 만들기  (0) 2012.09.12
Border  (0) 2012.09.12
MFC와 같이 group 묶어주는 titled border  (0) 2012.09.11
Posted by halloRa
,