OwnCloud 완벽 가이드

Owncloud는 사설 클라우드를 구축할 수 있도록 하는 "공짜" 프로그램입니다. 좋죠. 그렇지만 공짜라서 설치하고 활용하기 참 어렵기도 합니다. 저도 학생시절에 OwnCloud를 썼었고 이후 돈이 좀 생겨서 Google Drive로 갈아탔지만 여전히 사설망이 구축된 환경에서는 OwnCloud의 속도를 따라갈 수가 없습니다. 설치가 어려워서 못 쓰시지요.. 나빠서 못 쓰지는 않은 프로그램이랄까... 해야 할 것 먼저 컴퓨터를 한 대 준비합니다. 전원공급기 UPS로 있으면 좋겠습니다. 이 컴퓨터를 Ubuntu 16.04 LTS Desktop이상으로 설치합니다. 설치 방법은 알아서 하세요. ㅋㅋㅋ 이제 터미널을 열어서 작업할 준비를 마칩시다. 터미널에서 아.. 터미널.. 이제 sudo su 명령어로 수퍼유저로 변환해야 겠죠? $ sudo su # .. Docker 설치 도커를 설치합니다. # apt-get install docker.io 설치가 다 끝났으면 이제 owncloud 이미지를 받아서 설치를 완료하겠습니다. /home 폴더에 owncloud 폴더를 만들고, 여기에 config와 data를 링크로 따올 것입니다. 반드시 config도 같이 해야 하는데 인터넷 문서를 보면 이 부분을 잘 설명해 두지 않았습니다. 쯔쯔... 저는 80 포트를 씁니다. 어차피 이 컴퓨터는 owncloud 하나만을 위해 사용할 것이니까요. 집에 놀고 있는 구식 컴퓨터가 있으면 SDD를 끼워서 owncloud 서버로 써도 좋습니다. # docker run -d -p 80:80 -v /home/owncloud/config:/var/www/html/config -v /home/owncloud/data:/var/www/html/data --name="owncloud" owncloud 이미지를 다운로드 받을 것이고 설치가 완료될 것입니다. Config.php 설정 ...

HTTP directory 다운로딩

리눅스의 wget 명령어를 사용하여 HTTP directory의 파일을 가져오자. 명령어는 $ wget -r -np -nH -R "index.html*" <http://....> 위의 <http://...>에 원하는 주소를 넣는다. 가령 http://drive.nowhere.com/folder라는 곳의 파일 및 하위 디렉토리 전부를 다운로드 받으려면 $ wget -r -np -nH -R "index.html*" http://drive.nowhere.com/folder

경도와 위도로 거리 계산하기

다음 소스 코드를 참고하세요. suppressMessages({   if(!require(geosphere)) install.packages("geosphere")   library(geosphere)  }) korea<-data.frame(   longitude=c(126.956764,126.573234,126.542671),   latitude=c(37.540705,37.469221,33.364805),   city=c("Seoul","Incheon","Jeju") ) mat_seoul<-distm(korea[,c('longitude','latitude')],korea[,c('longitude','latitude')],fun=distGeo) mat_seoul/1000

RScript로 실행하기

#test.r args=commandArgs(trailingOnly = TRUE) print(args[1]) print(args[2]) #실행 RScript --vanilla test.r hi hello

데이터 관리를 연습하기 위한 샘플 데이터

다음 코드를 실행해서 > install.packages("nycflights13") 설치합니다. NYC 공항에서 출발하는 비행기 데이터입니다. 다음 테이블을 포함합니다. airlines airports flights planes weather 데이터를 불러옵시다. > data("airlines") > data("airports") > data("flights") > data("planes") > data("weather") airlines carrier name airports faa - FAA 공항 코드 name - 공항 이름 lat - 위도 lon - 경도 tz - 타임존 dat - daylight savings time zone /A=US DST, U=Unknown, N=no dat tzone - IANA time zone planes tailnum - Tail number year - Year manufactured type - Type of plane manufacturer,model - Manufacturer and model engines,seats - Number of engines and seats speed - Average cruising speed in mph engine - Type of engine weather origin - Orign. FOREIGN KEY /airports$faa year,month,day,hour - Time of recording temp,dewp - Temperature and dewpoint in F humid - Relative humidity wind_dir,wind_speed,wind_gust - Wind direction (in degrees), spe...

파워포인트 그림 내보내기 Resolution 변경방법

바로가기 아주 유용한 팁입니다!!!!

Multicore 사용하기 - foreach

여러 방법이 있지만... doSNOW 패키지를 쓰는 방법을 권장해드립니다. #라이브러리 불러오기 suppressMessages({   library(doSNOW)   library(foreach) }) #코어 등록하기(3개 기준) c1=makeSOCKcluster(3) registerDoSNOW(c1) # 프로그래스바를 만들고(.options.snow로 가는 것을 잘 보세요) # .packages로 패키지를 코어로 내리고 # .export로 데이터도 코어로 내립니다. pb <- txtProgressBar(max=100, style=3) progress <- function(n) setTxtProgressBar(pb, n) opts <- list(progress=progress) r <- foreach(i=1:100,      .options.snow=opts,      .packages=c("dplyr","foreach"),      .export=c("my_function","my_variable")) %dopar% {   Sys.sleep(1)   sqrt(i) } close(pb) stopCluster(c1) 자... 사용법은 꽤나 간단하죠? 주의할 점이 있습니다. 각각의 core에 데이터를 내려 줄 때 메모리 걱정을 좀 하셔야 합니다. 간단한 계산을 여러 코어에 나눠 하실 때는 도움이 되지만 너무 많은 코어를 쓰면 메모리가 다 없어질 수도 있습니다. 그리고 등록된 cluster는 반드시 stopCluster()로 해제해 주세요. 잊어버리시면 안됩니다.