Requirement:
- PostgreSQL
- PostGIS
- 데이터베이스를 생성할 때는 postgis 데이터베이스를 template로 생성하여야 한다.

방법:
- PostgreSQL 의 bin 디렉토리에 포함된 shp2pgsql.exe 를 이용하여 shapefile 을 sql 스크립트로 변환한 후 스크립트 실행
- shape 파일 과 함께 제공되는 dbf, prj, shx 정보가 같은 디렉토리에 있어야 한다.
- 사용법은 shp2pgsql.exe shapfilename schema.tablename > scriptfilename.sql
ex) shp2pgsql.exe TM_WORLD_BORDERS_SIMPL-0.3.shp public.world_borders_simple > TM_WORLD_BORDERS_SIMPL-0.3.sql
- 스크립트 실행은 PgAdmin III 를 이용해도 될 것이고 (확인 필요), 본인은 PostgreSQL Maestro 에서 데이터베이스 프로파일을 선택한 후 우클릭하면 나타나는 팝업 메뉴에서 Database Tools > Execute script from file 기능을 이용하였다.

참고자료:
http://khayer.wordpress.com/2009/10/29/creating-database-and-importing-shape-file-in-postgis/
http://www.paolocorti.net/2006/07/27/migrating-shapefiles-to-postgis/

활용예:
World borders dataset 을 PostgreSQL 데이터베이스에 저장할 수 있다.
http://thematicmapping.org/downloads/world_borders.php
Posted by fermi

댓글을 달아 주세요

/opt/alfresco-3.4.1/mysql/bin/mysql --user=root -p

mysql>show databases;
mysql>use alfresco;
mysql>show tables;
mysql>show columns from tablename;

<?php

$connect = mysql_connect("127.0.0.1:3306", "root", "censamci") or
         die("Could not connect: " . mysql_error());
mysql_select_db("alfresco");
$query = "select content_url from alf_content_url where id = (select content_url_id from alf_content_data where id = (select long_value from alf_node_properties where long_value != 0 and node_id = (select id from alf_node where uuid = '".$node->id."')))";
$result = mysql_query($query);
while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) {
    $content_url = $row["content_url"];
}
mysql_free_result($result);
mysql_close($connect);

$content_path = str_replace("store://", "/opt/alfresco-3.4.a/alf_data/contentstore/", $content_url);

?>
Posted by fermi

댓글을 달아 주세요

1. Add New Content Model
http://ecmarchitect.com/archives/2007/06/09/756

2. Add New Mimetype
http://wiki.alfresco.com/wiki/Adding_a_Mime_Type
http://niketa-alfresco3.blogspot.com/2010/01/how-to-add-new-mime-type.html

3. Bug Fix
주의: mimetype 확장 버그
http://issues.alfresco.com/jira/browse/ALF-2695

Looks like this:

<bean id="mimetypeConfigService" class="org.alfresco.config.xml.XMLConfigService" init-method="init">
        <constructor-arg>
            <bean class="org.alfresco.config.source.UrlConfigSource">

Should probably be changed to:

<bean id="mimetypeConfigService" class="org.springframework.extensions.config.xml.XMLConfigService" init-method="init">
        <constructor-arg>
            <bean class="org.springframework.extensions.config.source.UrlConfigSource">

Posted by fermi
TAG Alfresco, CMS

댓글을 달아 주세요

1. Alfresco CIFS 활성화

/opt/alfresco-3.4.a/tomcat/shared/classes/alfresco-global.properties

cifs.enabled=true
cifs.serverName=Alfresco
cifs.domain=WORKGROUP

(참고: http://wiki.alfresco.com/wiki/File_Server_Subsystem#Java-based_SMB)


2. Samba 와 함께 사용

Alfresco CIFS 와 Samba 를 각각 다른 IP로 사용

Ubuntu Software Center 에서 smb 설치, GUI 관리툴 Samba 도 설치
설치 후 Administration > Samba 에서 공유 추가

VM의 가상 NIC를 2개로 설정 (각각 eth0, eth1)
/opt/alfresco-3.4.a/tomcat/shared/classes/alfresco-global.properties 에서
cifs.bindto=192.168.0.74

/etc/samba/smb.conf 에서
interfaces = 192.168.0.72/24
bind interfaces only = yes

(참고: https://help.ubuntu.com/community/Samba/SambaServerGuide)


3. Samba 시작이 안 될 경우

DHCP 에서 받아오는 IP address 가 smb.conf 에서 설정한 IP address 와 동일한지 확인

재시작: sudo /etc/init.d/smbd reload
안되면: service smbd restart

4. Samba 와 Alfresco 재시작

/opt/alfresco-3.4.a/tomcat/temp/catalina.pid (재시작이 안될 경우 pid 파일 확인)
/opt/alfresco-3.4.a/alfresco.sh start|stop|resrart|status
service smbd start|stop|restart
Posted by fermi

댓글을 달아 주세요

참고문헌: 
http://wiki.alfresco.com/wiki/Alfresco_PHP_Library_Installation_Instructions
http://wiki.alfresco.com/wiki/PHP_SDK

1. Alfresco Community Edition 설치
http://wiki.alfresco.com/wiki/Download_and_Install_Alfresco
alfresco-community-3.4.b-installer-linux-x32.bin (32-bit Linux Installer)
alfresco-community-3.4.b-installer-linux-x64.bin (64-bit Linux Installer)
다운로드 후 permission 변경 (chmod +x) 후 파일 실행하면 GUI 기반의 설치 진행
참고로, mysql, tomcat 등이 모두 통합된 것이므로 Ubuntu에 mysql, tomcat 등을 설치하지 말고 clean install된 Ubuntu에서 작업하는 것을 추천
(설치되는 경로는 /opt/alfresco-3.4.a)

2. Alfresco PHP Library 설치 준비
http://wiki.alfresco.com/wiki/Alfresco_PHP_Library_Installation_Instructions
Ubuntu Software Center 에서 다음 package 설치
- php5
- php5-mysql
- apache2
- subversion (검색어를 svn 으로 입력해야 나옴)
설치 후 php -m 명령어로 soap, socket, mysql 모듈이 나오는지 확인

2. Alfresco PHP Library 다운로드
http://wiki.alfresco.com/wiki/Alfresco_SVN_Development_Environment
Subversion check out
svn co svn://svn.alfresco.com/alfresco/HEAD/root/modules/php-sdk/source/php/remote
다운 받은 /remote 디렉토리를 원하는 위치에 복사 (예: /opt/alfresco-3.4.a/php-sdk/source/php/remote)

3. php.ini 수정
/etc/php5/apache2/php.ini
include_path="/opt/alfresco-3.4.a/php-sdk/source/php/remote" 추가

4. Apache conf 수정
/etc/apache2/apache2.conf 는 /etc/apache2/sites-enabled 를 자동으로 포함하므로
/etc/apache2/site-enabled/alfresco 파일을 만들고 다음 내용을 작성

Alias /alfresco "/opt/alfresco-3.4.a/php-sdk/source/php/remote"

<Directory "/opt/alfresco-3.4.a/php-sdk/source/php/remote">
   Options Indexes MultiViews
   AllowOverride None
   Order allow,deny
   Allow from all
</Directory>

5. Apache 재시작
/etc/init.d/apache2 restart

6. Sample script 테스트
http://localhost/alfresco/Examples/QueryExecuter/queryExecuter.php
http://localhost/alfresco/Examples/SimpleBrowse/index.php
를 확인

7. PHP API Tutotial
http://wiki.alfresco.com/wiki/PHP_API_Tutorials
Posted by fermi

댓글을 달아 주세요


1. php.ini 위치
/etc/php5/apache2/php.ini

2. Apache control script 위치
/etc/init.d/apache2 stop|start|restart

3. Apache conf 위치
/etc/apache2/apache2.conf

4. Environment variables
/etc/environment

5. Reload environment variables
source /etc/environment

6. JDK 위치
/usr/lib/jvm/default-java

7. Tomcat 위치
/usr/share/tomcat6

8. 한글 입력기 설치
System > Administration > Language Support > Install / Remove Languages > Korean
Keyboard input method system: ibus 선택
System > Preferences > Keyboard Input Methods > Input Method > Korean 추가

9. 나눔글꼴 설치
https://launchpad.net/~suapapa/+archive/ubuntukofonts

Ubuntu Software Center 에서 소스 추가 (ex: Ubuntu 10.04)
deb http://ppa.launchpad.net/suapapa/ubuntukofonts/ubuntu lucid main
deb-src http://ppa.launchpad.net/suapapa/ubuntukofonts/ubuntu lucid main

Ubuntu Software Center 에서 ttf-nanum 패키지 설치

10. tofromdos
http://forums.alfresco.com/en/viewtopic.php?f=8&t=27429

tomcat 오류시 /opt/alfresco-3.4.a/tomcat/logs/catalina.out 확인
'^M' 문자열이 로그파일에 있을 경우 설정 파일에 '^M'기호가 dos 형식의 파일 변환 문제

Ubuntu Sofrware Center 에서 tofrodos 설치
/opt/alfresco-3.4.a/java/jre/lib/i386# fromdos jvm.cfg
/opt/alfresco-3.4.a/tomcat/temp/catalina.pid 삭제
/opt/alfresco-3.4.a/alfresco.sh start 로 tomcat 시작

11. Alfresco control script
/opt/alfresco-3.4.a/alfresco.sh start|stop|status

12. Samba control
sudo service smbd restart|start|stop
sudo /etc/init.d/smbd reload
https://help.ubuntu.com/community/Samba/SambaServerGuide

13. Samba Log 위치
/var/log/samba
Posted by fermi

댓글을 달아 주세요

  • dygraphs JavaScript Visualization Library
http://danvk.org/dygraphs
dygraphs is an open source JavaScript library that produces produces interactive, zoomable charts of time series. It is designed to display dense data sets and enable users to explore and interpret them.
  • Dynarch JS Calendar 2
http://www.dynarch.com/projects/calendar/
the new coolest JavaScript Calendar, JSCal2!
  • Highcharts
http://www.highcharts.com
Highcharts is a charting library written in pure JavaScript, offering an easy way of adding interactive charts to your web site or web application. Highcharts currently supports line, spline, area, areaspline, column, bar, pie and scatter chart types.
  • Google Visualization API
http://code.google.com/apis/visualization/documentation/gallery.html
  • 10 Best Free JavaScript Charts Solutions
http://www.ajaxline.com/10-best-free-javascript-charts-solutions
  • 5 Javascript Chart Alternatives
http://www.reynoldsftw.com/2009/03/javascript-chart-alternatives
  • 6 jQuery Chart Plugins For Your App
http://www.reynoldsftw.com/2009/02/6-jquery-chart-plugins-reviewed

Posted by fermi

댓글을 달아 주세요

Google Visualization API Gallery 에서 눈에 띄는 Library.

Dygraphs (http://danvk.org/dygraphs)
The dygraphs JavaScript library produces interactive, zoomable charts of time series.
By: Dan Vanderkam

Time series 를 dynamic plot으로 가시화하는데 매우 유용할 것으로 기대됨.


Posted by fermi

댓글을 달아 주세요

하나의 공인 IP를 공유하는 NAT 환경에서 동일한 서버에 여러개의 도메인을 갖는 웹사이트들을 호스팅하는 경우에는 기본적인 virtual hosts 설정으로 처리가 가능하지만, 도메인에 따라 각각 다른 서버에서 동일한 포트를 사용하는 웹 호스팅을 한다면 일반적인 포트 번호 기반의 NAT로는 구현이 불가능하다. 이 경우 호스트 네임에 따라 포트 포워딩을 하는 것이 필요하다.

아래는 NAT에서는 80포트를 하나의 서버로 포워딩하고, 도메인 이름에 따른 분류는 Apache의 reverse proxy를 이용하는 virtual hosts 설정 방법이다.

Configuring Apache virtual hosts for NAT

http://jeffbaier.com/articles/configuring-apache-virtual-hosts-for-nat

VirtualHost Examples
http://httpd.apache.org/docs/2.2/vhosts/examples.html

- Apache 의 reverse proxy feature 사용
- proxy 모듈

# Ensure that Apache listens on port 80
Listen 80

# Listen for virtual host requests on all IP addresses
NameVirtualHost *:80

<VirtualHost *:*>
 
DocumentRoot /www/example1
  ServerName www.example.com

</VirtualHost>

<VirtualHost *:*>
  ProxyPreserveHost On
  ProxyPass / http://192.168.111.2/
  ProxyPassReverse / http://192.168.111.2/
  ServerName hostname.example.com
</VirtualHost>


또는

# Listen for virtual host requests on all IP addresses
NameVirtualHost *

<VirtualHost *>
 
DocumentRoot /www/example1
  ServerName www.example.com

</VirtualHost>

<VirtualHost *>
  ProxyPreserveHost On
  ProxyPass / http://192.168.111.2/
  ProxyPassReverse / http://192.168.111.2/
  ServerName hostname.example.com
</VirtualHost>

참고: Forward Proxy vs. Reverse Proxy, Controlling access to proxy
Apache Module mod_proxy
http://httpd.apache.org/docs/2.2/mod/mod_proxy.html

Forward Proxies and Reverse Proxies/Gateways

Apache can be configured in both a forward and reverse proxy (also known as gateway) mode.

An ordinary forward proxy is an intermediate server that sits between the client and the origin server. In order to get content from the origin server, the client sends a request to the proxy naming the origin server as the target and the proxy then requests the content from the origin server and returns it to the client. The client must be specially configured to use the forward proxy to access other sites.

A typical usage of a forward proxy is to provide Internet access to internal clients that are otherwise restricted by a firewall. The forward proxy can also use caching (as provided by mod_cache) to reduce network usage.

The forward proxy is activated using the ProxyRequests directive. Because forward proxies allow clients to access arbitrary sites through your server and to hide their true origin, it is essential that you secure your server so that only authorized clients can access the proxy before activating a forward proxy.

A reverse proxy (or gateway), by contrast, appears to the client just like an ordinary web server. No special configuration on the client is necessary. The client makes ordinary requests for content in the name-space of the reverse proxy. The reverse proxy then decides where to send those requests, and returns the content as if it was itself the origin.

A typical usage of a reverse proxy is to provide Internet users access to a server that is behind a firewall. Reverse proxies can also be used to balance load among several back-end servers, or to provide caching for a slower back-end server. In addition, reverse proxies can be used simply to bring several servers into the same URL space.

A reverse proxy is activated using the ProxyPass directive or the [P] flag to the RewriteRule directive. It is not necessary to turn ProxyRequests on in order to configure a reverse proxy.

ProxyRequests Directive 의 default 값은 Off 이므로 따로 설정하지 않아도 된다.

ProxyRequests Directive
Description:    Enables forward (standard) proxy requests
Syntax:    ProxyRequests On|Off
Default:    ProxyRequests Off
Context:    server config, virtual host
Status:    Extension
Module:    mod_proxy



Posted by fermi

댓글을 달아 주세요

PHP 소스 파일의 시작 태그를 "<?"php 대신 "<?" 로 시작해도 되도록 설정하는 방법

php.ini 의 설정 항목 중 "short_open_tag" 설정

short_open_tag=On
short_open_tag=Off

http://sg.php.net/manual/en/ini.core.php#ini.open-basedir

Tells PHP whether the short form (<? ?>) of PHP's open tag should be allowed. If you want to use PHP in combination with XML, you can disable this option in order to use <?xml ?> inline. Otherwise, you can print it with PHP, for example: <?php echo '<?xml version="1.0"?>'; ?>. Also, if disabled, you must use the long form of the PHP open tag (<?php ?>).

짧은 시작 태그

PHP 의 시작 태그 옵션을 지정하는 것으로, php.ini 설정 항목 중 "short_open_tag" 항목의 값이:
- On 으로 설정된 경우, <? 와 같은 PHP 시작 태그를 사용할 수 있습니다.
- Off 로 설정된 경우, <? 와 같은 PHP 시작 태그는 사용할 수 없으며, <?php 와 같이 표기해야 합니다.


Posted by fermi
TAG php, php.ini

댓글을 달아 주세요

http://www.bestdomainregistrar.org


Overall
Registrar
|
|
DNS Mgmt
Privacy 1
URL Forwarding
Email Forward
Starter Page
.COM
.NET
.ORG
.BIZ
.MOBI
.INFO
Web Hosting
Promotion

Rank #1
GoDaddy
Most Popular Registrar
Free
$9/year or Free2
Free
Free
Free
$9.99
$12.99
$14.99
$14.99
$7.99
$0.99
$3.75/month
Free privacy for 5+ domains

Rank #2
Netfirms
Best Cheap Registrar
Free
Free
Free
Free
Free
$7.99
$7.99
$7.99
$9.95
-
$9.95
$9.95/month
Lowest priced using this exclusive link
FREE Webmail
FREE Privacy

Rank #3
1&1.co.uk
Cheapest UK Registrar
Free
Free
Free
Free
Free
£4.99
£4.99
£4.99
£4.99
£12.99
£0.99
£2.49
+ £2.49 for .uk domains
+ 10 FREE .uk domains with 1&1 Shared Hosting

Rank #4
Namecheap
Best Domain Transfer Registrar
Free
Free
Free
Free
Free
$9.69
$9.69
$9.69
$28.88
$7.99
$2.98
$2.91/month
.info = $2.89
.mobi = $7.99
Use coupon code SWITCH2NC for domain transfer = $6.99
Rank #5
Register.com
Best Domain + Email
Free
$11/yr
Free
Free
Free
$9.99
$9.99
$9.99
$9.99
$9.99
$9.99
$8.95/month
Free Business Email
100MB email storage

Posted by fermi

댓글을 달아 주세요

http://skagns.tistory.com
http://www.ahngun.com
Posted by fermi

댓글을 달아 주세요

참고: http://dev.mysql.com/doc/refman/5.5/en/charset-server.html
http://dev.mysql.com/doc/refman/5.5/en/server-options.html


MySQL Server has a server character set and a server collation. These can be set at server startup on the command line or in an option file and changed at runtime.

Initially, the server character set and collation depend on the options that you use when you start mysqld. You can use --character-set-server for the character set. Along with it, you can add --collation-server for the collation. If you don't specify a character set, that is the same as saying --character-set-server=latin1. If you specify only a character set (for example, latin1) but not a collation, that is the same as saying --character-set-server=latin1 --collation-server=latin1_swedish_ci because latin1_swedish_ci is the default collation for latin1. Therefore, the following three commands all have the same effect:

shell> mysqld
shell> mysqld --character-set-server=latin1
shell> mysqld --character-set-server=latin1 \
--collation-server=latin1_swedish_ci

Here's an example for the [mysqld] section of your my.cnf:

skip-character-set-client-handshake <- 필요한지 확인 필요
collation-server=utf8_unicode_ci
character-set-server=utf8

여러 설정 사례를 찾아보니 character set & collation 과 관련된 변수들은
skip-character-set-client-handshake
default-character-set
default-collation
character-set-server
collation-server
등이 있으나 실제 설정을 통하여 MySQL 5.1.41-3ubuntu12.1 및 mysql-admin 툴을 이용해서 확인해 본 결과 아래와 같이 설정하였을 때 성공함, skip-character-set-client-handshake 설정이 없으면 default-character 가 utf8으로 설정되어 있어도 client가 다른 설정을 사용할 경우 작동하지 않기 때문에, 반드시 skip-character-set-client-handshake 을 추가하여야 작동하였음

#
# * Character Set and Collation
#
skip-character-set-client-handshake
# Set the default character set.
default-character-set=utf8
# Set the default collation.
default-collation=utf8_unicode_ci

Posted by fermi
TAG MySQL

댓글을 달아 주세요

  1. Ubuntu Document 검색
    https://help.ubuntu.com

  2. APM (Apache2, PHP5, MySQL5) 설치
    https://help.ubuntu.com/community/ApacheMySQLPHP
    설치할 패키지 리스트:
    - apache2
    - php5
    - libapache2-mod-php5
    - mysql-server
    - libapache2-mod-auth-mysql
    - php5-mysql
    추가 패키지:
    - php5-gd
    관리를 위해 설치하면 편리한 패키지:
    - mysql-admin (MySQL Administration Tool)
    - mysql-query-browser (MySQL Query Tool)

  3. Apache 의 Mod_Rewrite 모듈 활성화 방법
    https://help.ubuntu.com/community/Apache/EnablingModRewrite

  4. HTML 확장자를 PHP에서 인식하도록 추가
    AddType application/x-httpd-php .html
    https://help.ubuntu.com/community/ServerSideIncludes 를 참고하여 default site의 설정파일 (경로: /etc/apache2/sites-available/default) 을 수정

  5. Zeroboard 4 로그인 문제 - PHP 설정
    /etc/php5/apache2/php.ini 수정
    register_globals = Off
    register_long_arrays = Off
    되어 있는 것을 모두 On으로 변경
    register_globals = On
    register_long_arrays = On

  6. Zeroboard 4 소스
    lib.php 의 IIS 로그인 문제 수정 부분 원상 복구

  7. Zeroboard 게시판 header_url 과 footer_url 수정
    zetyx_admin_table 의 header_url 과 footer_url 을 변경되 경로에 맞게 수정
    IIS 에서는 상대경로 (../../htdocs/head.html) 가 작동하였으나 Ubuntu 에서는 절대경로만 작동함
    MySQL Query Browser 를 이용해서 Update SQL 을 작성하여 한꺼번에 수정 가능함

  8. index_head.html 수정
    - CountDownData() 함수의 return value 가 float 인것을 int 로 변경, intval() 함수 이용
    - 테터 긁어오는 소스의 경로 수정



  9. Tatter 로 변환을 위해서 MySQL의 UTF-8 설정
    /etc/mysql/my.ini
    [mysqld] 섹션에 다음 추가
    skip-character-set-client-handshake
    default-character-set=utf8
    default-collation=utf8_unicode_ci



Posted by fermi

댓글을 달아 주세요

텍스트큐브 공식 정보
http://www.textcube.org/center/entry/migration
http://jblove.net/b12/1183

참고 블로그
http://v.daum.net/link/4708726

Perl 프로그램
http://pat.bingsan.net/249
http://nbfnote.tistory.com/486

텍스트큐브에서 티스토리 데이터 이전 방법
http://liverex.tistory.com/578

대옹량 블로그 백업 파일 XML 분할하기 방법
http://kuna.wo.tc/1085

데이터 유지하면서 마이그레이션 하는 방법
http://cirrus.tistory.com/890

자료
변환툴 zb2tt_2009: http://jblove.net/b12/attachment/5958012850.rar
테터툴 1.0.2: http://www.textcube.org/download/entry/priors

자료 변환시 주의 사항 (zb2tt_2009)
- 제로보드 게시물의 제목이 동일하면 테터 게시물 테이블의 slogan 컬럼에 들어갈 변수에 숫자를 덧붙여 고유의 주소를 갖도록 하는데, 동일한 제목의 게시물을 100개 까지만 처리하도록 되어 있음 -> 소스 수정 (zbConversion.php의 392 line) 으로 변경 가능
- 제목이 동일한 게시물은 실제로 제목을 사용하지 않는 스킨을 사용한 제로보드 게시판에서 발생하는데, 이 경우 소스를 수정하지 않고 제로보드 게시판 테이블의 subject를 수정하여 게시물에 제목을 할당하는 것을 권장함.

테터툴즈 판올림 과정에서 (1.0.2 -> 1.0.6 -> 1.0.6.1 -> 1.1.1 -> 1.1.3 -> TC 1.7.1) 백업
- 테터툴즈 1.0.2 에서 데이터 백업시 서버에 저장할 경우 xml 파일의 저장경로:
tattertools/cache/backup/*.xml

이후 TC 1.7.8 -> 1.8 -> 1.8.3.1 로 판올림 한 후  xml 백업을 받음.


Posted by fermi

댓글을 달아 주세요

Image test

Posted by fermi

댓글을 달아 주세요

Blog posting test from Microsoft Word 2007

Posted by fermi

댓글을 달아 주세요