2014년 5월 8일 목요일

[PowerBuilder] Install - cannot to license Server

[Web Ref] http://infocenter.sybase.com/help/index.jsp?topic=/com.sybase.infocenter.dc37771.1250/doc/html/den1245251349437.html

신규 설치를 하거나 추가로 설치 하는 경우 이런 문제가 있을 줄을 몰랐다. 결론적으로 IPv4와 IPv6에 대한 지원이 모두 되는 기준이나 기본적으로 IPv4를 제공한다. 하여 비활성화를 처리 하고 나면 제대로 설치가 진행이 된다.

나와 같은 뻘짓(?)을 하지 마시라고 공유

** 윈도우 환경에서 설치시 오류..
hen starting the SySAM license server, you may see this error:
lmgrd is not running: Cannot connect to license server 
system. (-15,570:10035 "WinSock: Operation would block")
This version of Sybase IQ includes Internet Protocol Version 4 (IPv4) and Internet Protocol Version 6 (IPv6) versions of the SySAM license server software. You can choose the version of the license server based on your environment using the sysam configure command. By default the IPv4 version of the license server is configured for use.
The IPv4 version of the license server cannot be used properly, if you have enabled IPv6 on the license server host. If this is the case, you can:
  • Disable IPv6 TCP/IP protocol on the license server host.
  • Use another Windows host that does not have IPv6 enabled.
  • Use a UNIX host for the license server. You can use the IPv4 version of the license, even if both IPv4 and IPv6 are enabled on UNIX.

2014년 5월 3일 토요일

[Using R] R Install & RStudio Install for Windows


* 설치 환경
 - Windows 7 Professional K 64Bit
 - R 3.1.0
 - RStudio 0.98


1. R 다운로드


2. R Project



윈도우 32/64 Bit 가 모두 포함되어 있는 파일이다. (윈도우용인 경우) 그런데 간혹 자신의 비트에 맞도록 설치하다 보면 (64Bit인경우) 찾을 수 없는 오류가 나는 현상을 많이 보아 왔다. 가급적이면 32/64 비트 관련 파일 체크를 건드리지 말고 설치 하길 바란다. 

이후 진행되는 여러가지 패키지 사용이나 활용을 위해서 한가지 주의 해야 할 부분은 윈도우 설치 시 계정명(사용자명)을 한글로 사용한 경우 기본 워크스페이스가 연결되거나 DLL이 로드될때 오류가 나는 현상을 종종 보아 왔다 설치 하여 사용하는 경우는 계정명을 영문으로 하시길 바란다. 


 3. RStudio Download





설치 후 기본 화면을 구성한다. R 사용을 위해서 반드시 필요 한것은 아니나 여러가지 툴 가장 좋은 기능을 제공하는 것으로 생각된다. 환경에 따라 R Server, RStudio 를 구축 하는 경우 웹환경에서도 사용자별로 제공이 가능 하다. 





동장방식에 대한 설명을 좀더 붙여 보고자 그림을 그리려다 우연히 오래전 자료를 보고 참여하여 그림을 한장 붙인다. 이 그림은 (주)센소메트릭스에서 발행한 "R의 설치 및 기본 사용법"을 참고 하였음을 알린다.

R의 작동 방식


기본적으로 R 시스템은 입력되는 스크립트와 저장되는 변수들을 메모리에 저장하였다가 결과를 보여주는 형태로 이뤄진다. 입력되는 데이터는 로컬에 존재하는 파일(이미지포함) 인 경우도 있고  인터넷 상에 있는 외부 데이터인 경우도 있다. 간혹 로드되는 데이터가 사이즈가 많은 경우 사용하는 클라리언트 메모리 사양에 따라 결과를 확인하지 못하고 정지 되는 경우가 많으므로 이에 따른 적절한 조치가 필요 하다.

* Sample Source
Ref  - http://cran.r-project.org/web/packages/doParallel/index.html

install.package("doParallel")
library("doParallel")

cl <- makePSOCKcluster(2)
registerDoParallel(cl)

m <- matrix(rnorm(9), 3, 3)
foreach(i=1:nrow(m), .combine=rbind)

stopCluster(cl)

2014년 4월 30일 수요일

[Linux] CentOS 6.5 - Samba Server Configuration

* Samba는 주로 윈도우즈 사용자와 함께 파일서버 형태로 구성하는 경우 많이 사용을 하게 된다. 팀내 공유문서 및 파일 구성을 위해서 7년만에 CentOS를 접하면서 새로 설정 하는 것들을 찾다가 이것 저것 함께 정리 하게 되었다.

원문주소
" Easy Samba server installation on CentOS 6.5 " 

Samba is a client/server system that implements network resource sharing for Linux and other UNIX computers. With Samba, UNIX files and printers can be shared with Windows clients and vice versa. Samba supports the Session Message Block (SMB) protocol. Nearly all Windows computers include SMB support with their internal network subsystems (NetBIOS in particular).

With an appropriately-configured Samba server on Linux, Windows clients can map drives to the Linux filesystems. Likewise, the Samba client on UNIX can connect to Windows shares by their UNC name. Although differences among various operating systems (such as filesystem naming conventions, end-of-line conventions, and authentication) can limit interoperability, Samba offers a generally serviceable mechanism for resource sharing on a heterogenous network.


* 설치를 위해서 체크 및 버전을 확인 한다.

1. [root@orabackup ~]# yum install samba samba-client samba-common

2. [root@orabackup ~]# smbd --version



* 서비스를 자동으로 올려주기 위해서 아래의 문장을 처리 한다. 그러나 보통 한글판 CentOS6.5 버전을 설치 할때 보통의 특별한 체크를 하지 않았다면 "Basic Server" 버전 이상의 설치 체크에선 이미 등록되어 있다. 다만 자동 시작의 레벨 체크가 되어 있지 않으므로 그부분에 대한 설정 변경만 한다면 자동 실행을 큰 무리 없을 것이다.

여하튼 그것이 있든 없든 사용할 수 있는 구문 임

1. [root@orabackup ~]# chkconfig smb on
2. [root@orabackup ~]# chkconfig nmb on


* 방화벽 설정이 보통은 열려 있지 않으므로 방화벽 설정

1. [root@orabackup ~]# iptables -I INPUT 4 -m state --state NEW -m udp -p udp --dport 137 -j ACCEPT
2. [root@orabackup ~]# iptables -I INPUT 5 -m state --state NEW -m udp -p udp --dport 138 -j ACCEPT
3. [root@orabackup ~]# iptables -I INPUT 6 -m state --state NEW -m tcp -p tcp --dport 139 -j ACCEPT
4. [root@orabackup ~]# service iptables save

또는 설정파일을 직접 열어서 VI로 수정하여 서비스를 재시작 하여도 동일한 결과를 얻을 수 있다.



1. [root@orabackup ~]# vi /etc/sysconfig/iptables

* 아래내용 추가
-A INPUT -m state --state NEW -m udp -p udp --dport 137 -j ACCEPT
-A INPUT -m state --state NEW -m udp -p udp --dport 138 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 139 -j ACCEPT

2. [root@orabackup ~]# service iptables restart


3. [root@orabackup ~]# cat /etc/sysconfig/iptables



* 윈도우에서 네트워크 드라이브로 접속(인증)할 사용자/그룹 정보와 폴더를 생성한다.

1. [root@orabackup ~]# useradd its
2. [root@orabackup ~]# groupadd smbgrp
3. [root@orabackup ~]# usermod -a -G smbgrp its
4. [root@orabackup ~]# smbpasswd -a its
5. [root@orabackup ~]# cd /home/its
6. [root@orabackup ~]# mkdir its_files
7. [root@orabackup ~]# chown -R its:smbgrp its_files/
8. [root@orabackup ~]# chmod -R 0770 its_files/


* Samba 설정 파일을 아래와 같이 변경하여 마무리 한다.



* 마무리한 서비스를 재시작 한다.

1. [root@orabackup ~]# service smb restart
2. [root@orabackup ~]# service nmb restart


* 네트워크 드라이브 연결은 윈도우에 처리 하며 별도의 설명을 붙이지 않겠음

1. \\서버해당아이피\its_files
2. 상위에서 만든 아이디/패스워드로 접속하여 연결 완료



2014년 4월 18일 금요일

[Linux] vi command - 주요명령어 메모

1. 시작과 종료에 관련된 명령어
명령어 입력 상태에서 입력해야 합 [Shift + :]
wq 저장하고 종료
w [filename] 주어진 파일 이름으로 저장
w! [filename] 주어진 파일 이름으로 저장/덮어쓰기 후 종료
w! 저장후 편집종료
q 저장하지 않고 종료
q! 저장하지 않고 강제종료
e 종료하지 않고 다른 파일 편집
e! 편집한 내용 저장하지 않고 최종 저장된 상태로 파일 열기


2. 입력과 수정을 할 때 사용하는 명령어
i 문자 앞에서부터 입력
a 현재 문자 뒤에서부터 입력
o 현재라인 아래에 입력
s 커서가 있는 단어를 지우고 입력하기
S 커서가 있는 행을 지우고 입력하기
cw 커서 위치의 한 단어를 수정하기
co 커서 위치부터 줄의 처음까지 수정하기
c 커서 위치부터 줄의 끝까지 수정하기
cc 커서가 있는 줄을 수정하기
cj 커서가 있는 줄과 그 다음 줄을 수정하기


3. 삭제할 때 명령어
dw 한 단어 삭제
dd 한 라인 삭제
dj 커서가 있는 줄과 그 다음 줄을 삭제
dk 커서가 있는 줄과 그 앞줄을 삭제
do 커서 위치부터 줄의 처음까지 삭제
x 커서의치의 글자 삭제
D 한줄삭제
X 커서 바로 앞의 글자 삭제

4. 복사할 때 명령어
y 문자 복사
yy 한라인 복사
yw 커서 위치부터 단어의 끝까지 복사하기
yj 커서가 있는 줄과 그 다음줄을 복사하기
yo 커서 위치부터 줄의 처음까지 복사하기
yk 커서가 있는 줄과 그 앞줄을 복사하기
y$ 커서 위치부터 줄의 끝까지 복사하기
p 현재 줄 다음에 버퍼의 내용을 붙임
P 현재 줄 앞에 버퍼의 내용을 붙임

2014년 4월 17일 목요일

[Using R] Sentiment Analysis Sample Source

# 아래 내용은 이전 포스팅인
트위터 글(데이터) 수집하기 에서 만들어진것이 R실행 코드에서 연결되어야 실행 가능 합니다.

install.packages("plyr")
library(plyr)

hilton.text <-laply(hilton.tweets,function(t)t$getText())
head(hilton.text,3)

#긍정 단어 파일 스캔
pos.word=scan("positive-words.txt",what="character",comment.char=";")

#부정 단어 파일 스캔
neg.word=scan("negative-words.txt",what="character",comment.char=";")

#수작업으로 추가 할수도 있음 (Sample)
pos.words<-c(pos.word,"upgrade")
neg.words<-c(neg.word,"wtf","wait","waiting","epicfail","mechanical")


#
install.packages("plyr")
install.packages("stringr")
library(plyr)
library(stringr)

score.sentiment =
function(sentences, pos.words, neg.words, .progress='none')
{
  require(plyr)
  require(stringr)

  # we got a vector of sentences. plyr will handle a list
  # or a vector as an "l" for us
  # we want a simple array ("a") of scores back, so we use
  # "l" + "a" + "ply" = "laply":
  scores = laply(sentences, function(sentence, pos.words, neg.words) {
 
    # clean up sentences with R's regex-driven global substitute, gsub():
    sentence = gsub('[[:punct:]]', '', sentence)
    sentence = gsub('[[:cntrl:]]', '', sentence)
    sentence = gsub('\\d+', '', sentence)

    # and convert to lower case:
    sentence = tolower(sentence)
 
    # split into words. str_split is in the stringr package
    word.list = str_split(sentence, '\\s+')

    # sometimes a list() is one level of hierarchy too much
    words = unlist(word.list)
 
    # compare our words to the dictionaries of positive & negative terms
    pos.matches = match(words, pos.words)
    neg.matches = match(words, neg.words)
 
    # match() returns the position of the matched term or NA
    # we just want a TRUE/FALSE:
    pos.matches = !is.na(pos.matches)
    neg.matches = !is.na(neg.matches)
 
    # and conveniently enough, TRUE/FALSE will be treated as 1/0 by sum():
    score = sum(pos.matches) - sum(neg.matches)
 
    return(score)
  }, pos.words, neg.words, .progress=.progress )

  scores.df = data.frame(score=scores, text=sentences)
  return(scores.df)
}

#함수 실행
hilton.text<-hilton.text[!Encoding(hilton.text)=="UTF-8"]
hilton.scores=score.sentiment(hilton.text,pos.words,neg.words,.progress='text')

#실행결과 값을 히스토그램으로 표현
hist(hilton.scores$score)
hilton.scores$hotel='Hilton'
hilton.scores$code='HL'


[Using R] R을 사용하여 트위터 데이터 수집하기 - Twitter Oauth for R

트위터에 대한 데이터를 기준으로 간단한 감성분석 샘플을 만들어 보자. 참고된 스크립트는 데이터베이스 진흥원 빅데이터 아카데미에서 사용한 샘플 소스 임을 밝힌다. 트위터에 있는 글을 수집하기 위해서는 어플리케이션을 하나 임시로 만들어서 데이터 가져오기 위한 준비를 몇가지 해야 한다. 샘플은 영문으로 된 것을 기준으로 하며 한글로 된 데이터를 가져오는 부분은 추가로 포스팅에 업데이트 될 예정이다. 크게 다리지는 않지만 몇가지 작업들이 추가 된다.

1. twitter 계정 만들기 ( 별도 계정 생성은 설명을 붙이지 않는다 )

2. twitter에 접속 한 후 application 생성이 필요

    https://apps.twitter.com/ 접속 후 로그인


3. "Create New App" 클릭 




"Create your Twitter application" Click 

## 2016년 3월 - 기존 트위터 계정에서 모바일 번호 인증이 되어 있지 않으면 하지 못하도록 변경된 것 같다. 결국에 또 정보 제공 해주고 나서야 다시 가능 
그래서 첨부된 이미지에 이름이 달라졌습니다. " ozzang98_RTest " 로 등록 


4. 생성된 Application 정보를 참고하여 R 스크립트에 적용 한다. 


 * 최근에 Access Token 버튼이 추가 되어 Create New Access Token 을 추가 하여야 한다. 추가 하고 나면 아래의 그림과 같이 활성화가 된다. 

5. 설정이 끝나고 나면 이 정보를 가지고 R 에서 스크립트를 실행한다. 

* 실행환경 윈도우7 64비트, R 3.2.0, RStudio 0.98.1103 

# 기본적인 패키지 설치를 위한 구문 
install.packages("twitteR")
library(twitteR)
library(ROAuth)
library(RCurl)

#트위터 접근을 위한 정보 설정을 아래와 같이 함 
requestURL= "https://api.twitter.com/oauth/request_token"
accessURL= "https://api.twitter.com/oauth/access_token"
authURL ="https://api.twitter.com/oauth/authorize"


#상위의 4번 첨부 그림안에 있는 API KEY (본인의 설정에 따라 값이 다름) 
consumerKey="izSShtegtepjWqL1dTWZPg"  

#상위의 4번 첨부 그림안에 있는 API secret 값 
consumerSecret="u03nOZBzqsLrPEVWM2iFbCbDAkbrixPLsTpzZ1MQQ4"


twitCred=OAuthFactory$new(consumerKey=consumerKey,
                                          consumerSecret=consumerSecret, 
                                          requestURL=requestURL, 
                                          accessURL=accessURL, authURL=authURL)

#저장위치 수동지정(기본 Workspace 위치) 
setwd("C:/Users/John/Downloads")
download.file(url="http://curl.haxx.se/ca/cacert.pem",destfile="cacert.pem")
twitCred$handshake(cainfo="cacert.pem")

#이 단계에서 콘솔에 출력되는 URL을 입력하고 어플리케이션 승인을 해야 한다. 


# [그림 참조] PIN 번호 입력을 하고 나면 그 다음 스크립트를 실행 가능 함 


## 입력은 Console 창에서 입력하기 바란다. 

##save(list="twitCred",file="twitteR_credentials")
##load("twitteR_credentials")

registerTwitterOAuth(twitCred) #True 인증 완료 




## 2016년 3월 25일 추가 변경 
## 인증 방법 및 적용이 변경된 것 같으나 정확한 사유는 확인 하지 못했습니다. 
하여 혹시 관련 내용을 적용하시고자 하신다면 하단 내용으로 진행하시길 권장 합니다. 
#install.packages("twitterR")
#install.packages("ROAuth")
#install.packages("base64enc")
library(twitteR)
library(ROAuth)
library(base64enc)

consumer_key <- '3esVC69GlJcmxL4VezZ7CdKwu'
consumer_secret <- 'gwtwk1oMqQvi6ZfqPphQb9uJctCDIIldGxYymU9OcCAJDbkouQ'
access_token <- '133360027-x7e4FuoCVA4AsEFBMjhs4kvx3HN86ajsRQmG7mwJ'
access_secret <- 'ak2qVw9ioIXyLmUw1UqWHNHohJRRPfWzlDtABaHRYzJIr'

setup_twitter_oauth(consumer_key,consumer_secret,access_token,access_secret)


# 트위터글을 검색하여 트윗정보를 가져온다 
hilton.tweets <- searchTwitter("@hilton",n=50,cainfo="cacert.pem")

length(hilton.tweets)
class(hilton.tweets)
hilton.tweets[1:5]
tweet<-hilton.tweets[[1]]
tweet$getScreenName()
tweet$getText()

twitteR 패키지에 대한 메뉴얼을 하단의 링크를 참조 하시길 바랍니다. 



2014년 4월 15일 화요일

[Info] Sync Google Calendar with Outlook 2010 and 2013

Sync Google Calendar with Outlook 2010 and 2013 

참조 - 원문 링크 


기존에 구글 계정을 가지고 일정을 사용하시던 분들이라면 Outlook 2013에서 간단한 설정으로 일정을 함께 공유할 수 있습니다.

1. 구글 계정으로 로그인 하여 [켈린더] 일정으로 이동 합니다.

2. 켈린더에 대한 아래 그림과 같이 클릭하면 [설정] 메뉴를 클릭 합니다.


3. 설정화면에서 아웃룻과 연동하고자 하는 일정을 클릭하면 상세 정보가 나옵니다.


위 그림에서 비공개주소 ICAL (녹색바탕의 버튼 글씨)를 클릭하시면 URL 주소가 나타납니다. 이 해당 주소를 복사 합니다.

4. 아웃룩2013을 실행 합니다. 일정으로 들어가 아래 버튼처럼 [일정] --> [일정열기] 를 클릭하여 3번에서 복사한 URL 주소를 붙여넣기 합니다.



5. 여기까지 마무리 하고 나면 왼쪽에 [내일정] -> 일정, [다른 일정] -> [구글일정] 이 추가 된것을 확인 할 수 있다. 


* 모바일에 일정을 공유하실 때는 구글일정 또는 포털 일정으로 연결 하시면 편리 합니다. 감사합니다.





 다양한 채널의  블로그 작성으로  집중이 좀 안되기도 하고  나의 회사를 운영하고 관리 하다 보니  회사의 블로그로 작성 해보는 것은 어떤가 하고  하나로 옮겨 봅니다.  (주)다이닝웨이브 - 블로그 바로가기