사용자 삽입 이미지

'다음 블로그뉴스'가 '다음 View'로 개편함에 따라, 그전에 있던 설치형 Textcube '다음 블로그 뉴스플러그인'을 'Daum View 플러그인'으로 개편/개발 했습니다.

Textcube 1.7.8-9 버젼과 1.8이상 버젼만 지원 할 예정입니다. 그래서 1.7버젼과 1.8버젼을 나눠서 배포하겠습니다. 요번 버젼 대부터 한가지가 크게 이전과 다릅니다.  글을 발행해야지만 다음뷰에 발행이 됩니다. 이 점 유의하시길 바랍니다. 그래서 이번 Textcube 1.8 버젼(1.2.0)에서는 이올린싱크가 사용하는 Syndicate이벤트를 사용합니다. (아마 믹시도 바꾸는게 좋지 않을까 하는데요. 같은 발행 플러그인으로써...ㅋ)

1.1.1

  • DB 쿼리 오류 하나 수정했습니다.

1.1.0-1.2.0

  • 전체 소스를 축약했습니다. (일반인들이 보기 쉽게..)
  • 다음뷰 새로운 api규약에 맞췄습니다.(상반기내 다음뷰 api교체됨, 그전 플러그인 사용불가능)
  • 1.1 -> Textcube 1.7.8-9버젼, 1.2 -> Textcube 1.8이상 버젼(홀수는 1.7버젼 짝수는 1.8버젼) 그리고 아마 1.1버젼(Textcube 1.7버젼)은 앞으로 버그 수정 정도만 할 것입니다.
  • 발행 트랙백을 보낼때 썸네일 이미지를 생성하여 보냅니다. 여기 보시면 어떤건지 알듯 합니다.
  • 새로 글작성시 트랙백이 잘못 보내지는 문제해결
  • My DaumView 위젯의 경우 링크 형식을 1. 내 블로그 퍼머링크 2. DaumView 정보링크 3. DaumView 퍼머링크 로 3가지 선택이 가능합니다.

1.0.2

  • http://[도메인]/tc 이런식의 블로그 주소일경우 에러가 있었슴다. 이부분 수정했습니다. (http://gowoonyou.kr 블로그를 통해서 알았슴다. 감사^^)

1.0.1

  • 문제 없으신 분들은 업데이트 안해도 됩니다. 단 이 버젼으로 업데이트 시, '플러그인 데이타 관리'에서 DaumView 삭제, 플러그인 off후 on을 해주세요.
  • 사소한 오류 부분 수정
  • 필요없는코드 삭제

Textcube용 Daum View 뉴스 주요 플러그인 기능(1.0)

  • 트랙백 보내는 방법 개선
  • 다음 뷰용으로 마이그레이션
  • 플래쉬 위젯만 사용(위젯 HTML 디자인이 없더군요.)

주의!!

  • 이전에 사용하시던 다음블로그뉴스 플러그인은 과감히 버리시길 바랍니다. (플러그인 비활성화, 다음블로그뉴스 플러그인 폴더, 관련 테이블도 삭제 해도 됩니다. 이전 위젯들은 자동으로 복구됩니다.) 두 플러그인이 충돌함으로써 생기는 문제는 저도 모르겠습니다. ^^
  • 다음 'View'서비스에서 RSS로 기사를 발행되서 저장되는 '문자셋'방식과 트랙백으로 기사를 보내는 '문자셋'방식을 일치했습니다. 이전버젼에서는 문자퍼머링크 트랙백을 보내는 것이 문제가 있었다는 것이지요. 이전 다음 블로그뉴스 플러그인 포스트에서 주의사항을 공고한적 있습니다.

    이전까지 문자 퍼머링크로 기사를 보냈던 분들에게는 죄송하지만, 방법이 없습니다. -_-; 다음 기준안을 맞출수 밖에요.
  • 몇몇 들이 저의 소스를 변형해서 사용하시는데, 이 것까지 답변을 드리기에는 힘듭니다. 버젼에 맞게 다운 받아서 사용하시길 바랍니다. 

다운로드


YP_DaumView_1.1.1.zip

1.1.1 textcube 1.7.8 이상용

YP_DaumView_1.2.0.zip

1.2.0 textcube 1.8이상용




크리에이티브 커먼즈 라이센스
Creative Commons License

Posted by 엽기민원

2010/02/26 17:31 2010/02/26 17:31
, ,
Response
4 Trackbacks , 42 Comments
RSS :
http://yupmin.com/rss/response/157

0.문제 풀이 - 구글 인터뷰 관련

좋은 경험이라고 해야 하나, "구글" 인터뷰 때문에 했던 각종 문제 풀이를 포스팅 해놨는데 공개하지 않았었다. 뭐 시간도 많이 지났고 하니 그 당시 풀었던 문제를 공개해본다.
양의 정수 n에 대해서 1과 n 사이에 1이 나오는 횟수를 나타내는 함수를 f(n)이라고 한다. 예를 들어 f(13)=6이다. f(n)=n이 되는 첫번째 양수는 1이다. 두번째 양수는 무엇인가?
저도 한번 풀어봤습니다.
먼저 다음과 같이 규칙이 있더군요.

f(n) : 1에서 n까지의 1의 갯수의 합 일때
An은 n의 첫번째 자리라고 하고, n의 자릿수를 k라고 하면

case1 : An == 1
예를 들어 f(1*100 + a ) (첫번째 예는 199, 또 다른 예를 들면 f(134) 암튼)는 f(99) + '100~100+a (99 or 34) 사이의  1의 갯수' 입니다. 누적값이므로 당연한 결과겠죠?
그리고 100~199(or 23) 에서의 1의 갯수는 f(99) + 100(or 34)와 같습니다.

예 1)
f(199) = f(99) + 100 + f(99)
f(134) = f(99) + 35 + f(35)
이러면 일종의 재귀호출이 가능해집니다. 여기서 중간의 정수는 0~99까지이므로 100입니다. ^^ 이정도만 하고...

case2 :  An != 1
f(b*100 + a) b는 1보다 크다고 했을때 , f(234), f(299)로 예를 들죠
f(234 or 99)는 f(199)의 1의 갯수와 200~234(or 99)의 1의 갯수의 합입니다. 중요한점은 첫번째 자리의 수와 관계없이 바로 다음자리 부터의 1의 갯수는 첫번째 자리의 수와 관계없이 수가 같습니다. 왜냐면 첫번째 자리가 1이상이니깐요.
예 2)
f(299) = f(199) + f(99)
f(234) = f(199) + f(34)
여기서 첫번째 케이스를 이용해 응용이 가능해집니다.
f(299) = f(99) + 100 + f(99) + f(99) = 2*f(99) + 100 + f(99)
f(234) = f(99) + 100 + f(99) + f(34) = 2*f(99) + 100 + f(34)


아 대충 보이지요 ^^ 정리해보겠습니다.

f(n)  라고 정의 하고,  n = a * 10 ** c + b, a는 첫번째 자리의 숫자, c는 기수, b는 그외의 나머지 숫자라고 합시다.
case1 : a == 1일때
f(a * 10 ** (c-1) + b) = f(10 **(c-1) -1) + b + 1 + f(b)
case2 : a != 1 일때
f(a * 10 ** (c-1) + b) =a * f(a * 10 ** (c-1) - 1) +  10 ** (c-1) + f(b)

자 이제 함수가 대충 완료되었습니다. 재귀함수로 쉽게 만들수 있습니다.
def sum_one(num)
num_string = num.to_s
c = num_string.length
a = num_string[0] - 48 # 'a'->48
b = num_string[1..(num_string.length - 1)].to_i

if(num == 0)
sum = 0
elsif(num < 10)
sum = 1
else
if a == 1
sum = sum_one(10 ** (c - 1) - 1)
sum += b + 1
sum += sum_one(b)
else
sum = a * sum_one(10 ** (c - 1) - 1)
sum += 10 ** (c - 1)
sum += sum_one(b)
end
end
sum
end

자 함수는 구현되었습니다. 재귀함수로 자릿수에 비례해서 재귀를 하게됩니다. 이게 계산속도 저하를 가져오는데요. 재귀를 하기 때문이죠. 근데 재미있는 건, 재귀하는 인수들의 모습이 대략 f(9), f(99), f(999)의 형식입니다. 왜냐면 10 ** (c - 1) - 1의 형식이깐요.
낚시광준초리 님이 여기서 언급한거 처럼 그 함수는 f(10 ** (c -1) -1) = c * 10 ** (c-1)입니다.
이런 것들은 첫자리수가 1이 아니므로 두번째 케이스를 풀어내면 나오는 식입니다.
다시 풀어보면 n = 10 ** (c -1) -1 이라고 할때..
f(n) = (n-1)log 1o (n-1) / 10 입니다. 아무튼 이런 값들은 재귀를 보내지 말고 그냥 계산해도 될껍니다. ^^ 그래서 추가해줍니다.

def sum_one(num)
num_string = num.to_s
c = num_string.length
a = num_string[0] - 48 # 'a'->48
b = num_string[1..(num_string.length - 1)].to_i

if(num == 0)
sum = 0
elsif(num < 10)
sum = 1
elsif(10 ** (c-1) - 1 == num)
sum = num.length * (10 ** c )
else
if a == 1
sum = sum_one(10 ** (c - 1) - 1)
sum += b + 1
sum += sum_one(b)
else
sum = a * sum_one(10 ** (c - 1) - 1)
sum += 10 ** (c - 1)
sum += sum_one(b)
end
end
sum
end


이렇게 되면 재귀한두번 만에 거의 답이 나옵니다. 이제 첫번째 조건에 맞는 양의 정수를 찾아봅시다.

좀더 무조건 돌려보는 것도 일종의 방법이 될수 있으나, 몇가지 고려로 수를 찾는 방법을 옵티마이즈 해봅시다.
이것은 먼저 N(n) = n의 함수와 F(n)의 그래프 추이를 보면 대충 보면 수를 찾을수 있는 방법이 나옵니다.

(1..100).each do |c|
((10**(c-1))..(2*10**(c-1) -1)).each do |m|
if sum_one(m) == m
puts m
end
end
end

크리에이티브 커먼즈 라이센스
Creative Commons License

Posted by 엽기민원

2010/02/08 00:33 2010/02/08 00:33
, , ,
Response
No Trackback , No Comment
RSS :
http://yupmin.com/rss/response/116

unison 사용

떨어져 있는 여러개의 서버를 동기화 할때는 보통 rsync 등을 사용한다
근데 그런 방식의 문제점은 단방향 싱크라는 점이다.

rsync는 A -> B의 방향성 일 때 A에서 파일이 추가/삭제되면 B에 추가/삭제되지만, B에 추가/삭제된 파일들은 A에 반영되지 않는다. 이런 때에는 unison을 사용하는 게 맞는 것 같다
사용자 삽입 이미지
centos 에서는 unison 배포본이 없다. 게다가 compile를 위해선 ocaml 이라는 언어를 사용해야 하는데, 물론 centos 배포본에도 없다.(슬슬 귀찮아지기 시작한다.) 그래서 그냥 unison rpm 설치를 하기로 했다.
http://www.rpmfind.net/linux/rpm2html/s ··· 3Dunison
양쪽서버에 다 unison을 깔아주고
wget ftp://195.220.108.108/linux/dag/redhat/el5/en/i386/dag/RPMS/unison-2.32.52-1.el5.rf.i386.rpm
rpm -Uvh unison-2.32.52-1.el5.rf.i386.rpm

명령어는 다음과 같다. 양방향이므로 from, to가 없다.
unison /var/www/test ssh://xxx.xxx.xxx.xxx//var/www/test -times -batch

unison을 잘 이용하면 골치 아픈 두 컴퓨터 간의 itune 싱크도 가능할듯하다.
좀 더 자세한 설치 활용 예들은 다음 사이트에서 확인
http://kblog.breadncup.com/archives/2009_10_17/1042/
http://tykim.wordpress.com/2008/01/11/원격지의-mac과-mac의-양방향-sync-unison/

cron에서 돌리기 위해선 그냥 '생'명령어로 하면 안 되고 스크립트를 만들어서 HOME 변수를 지정해줘야 한다. 이유는 cron으로 돌아갈때는 home을 / 로 생각하기 때문에 permission denied 오류가 나온다.
vi unison_sync.sh
#!/bin/sh
HOME=/var/www/backup/log
unison /var/www/test ssh://xxx.xxx.xxx.xxx//var/www/test -times -batch
크리에이티브 커먼즈 라이센스
Creative Commons License

Posted by 엽기민원

2010/02/05 13:11 2010/02/05 13:11
,
Response
No Trackback , No Comment
RSS :
http://yupmin.com/rss/response/177

nginx 설치 및 셋팅

0. nginx


사용자 삽입 이미지
nginx('엔진엑스'라고 읽는다. 러시아어가 기본이니 정확한 발음은 모르겠다)는 작고 파워풀한 웹엔진의 능력과 간결한 셋팅은 유명하다.
테스트 해본결과 static 파일의 경우 apache나 lighttpd에 비해 월등한 성능을 보인다. 그러나 fastcgi+php쪽으로는 속도가 apache 보다 못하다.
proxy. cache or memcached 기능으로 다양한 조합을 하면 각각 상황에 알맞는 재미있는 구성이 가능할것 같다.

그래서 내가 주로 쓰는 centos, ubunt에 정리겸 설치 및 설정 방법을 정리해봤다.

1. centos 5.4 - install nginx

centos에는 배포본이 아직 없는듯 (0점대 버젼이라 그런가...)...암튼 그래서 구글링을 했다.

기본 깔아야 하는 패키지들은 다음과 같다
yum install gcc pcre-devel bzip2-devel openssl-devel

그리고 직접 소스를 받아서 컴파일 한다. 컴파일 옵션 참조: http://www.mman.pe.kr/?p=53
wget http://nginx.org/download/nginx-0.7.64.tar.gz
tar xvfz nginx-0.7.64.tar.gz
cd nginx-0.7.64
./configure \
--sbin-path=/usr/sbin \
--conf-path=/etc/nginx/nginx.conf \
--pid-path=/var/run/nginx.pid \
--lock-path=/var/lock/subsys/nginx \
--error-log-path=/var/log/nginx/error.log \
--http-log-path=/var/log/nginx/access.log \
--http-client-body-temp-path=/var/tmp/nginx/client/ \
--http-proxy-temp-path=/var/tmp/nginx/proxy/ \
--http-fastcgi-temp-path=/var/tmp/nginx/fcgi/ \
--with-http_realip_module \
--with-http_ssl_module \
--with-http_addition_module \
--with-http_sub_module \
--with-http_dav_module \
--with-http_gzip_static_module \
--with-http_stub_status_module \
--with-mail \
--with-mail_ssl_module \
--with-cc-opt="-I /usr/include/pcre"
make
make install

그리고 깔린 결과는 다음과 같다
  + using system PCRE library
+ using system OpenSSL library
+ md5: using OpenSSL library
+ sha1 library is not used
+ using system zlib library

nginx path prefix: "/usr/local/nginx"
nginx binary file: "/usr/sbin"
nginx configuration prefix: "/etc/nginx"
nginx configuration file: "/etc/nginx/nginx.conf"
nginx pid file: "/var/run/nginx.pid"
nginx error log file: "/var/log/nginx/error.log"
nginx http access log file: "/var/log/nginx/access.log"
nginx http client request body temporary files: "/var/tmp/nginx/client/"
nginx http proxy temporary files: "/var/tmp/nginx/proxy/"
nginx http fastcgi temporary files: "/var/tmp/nginx/fcgi/"

init script는 http://wiki.nginx.org 에 있다
http://wiki.nginx.org/RedHatNginxInitScript 에서 redhat쪽 init script 를 다운받아서
cp nginx /etc/init.d/
chmod 755 /etc/init.d/nginx
/usr/sbin/groupadd nginx
/usr/sbin/useradd -g nginx -s /sbin/nologin -c "Nginx" -M nginx
mkdir /var/tmp/nginx/
# chkconfig --add nginx
# chkconfig nginx on

/etc/nginx/nginx.conf를 수정한다
user  nginx nginx;
error_log /var/log/nginx/error.log;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;

log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';

access_log /var/log/nginx/access.log main;

sendfile on;
tcp_nopush on;
server {
listen 80;
server_name localhost;
location / {
root /var/www/html
index index.html index.htm;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
}
}

하면 완료.

일단 문제가 있는데, initscript로 restart가 잘 안된다. worker 프로세스가 죽는 시간이 좀 걸리는데, 그상태에서 start하는게 문제가 되는 듯하다. 근데 nginx는 꼭 restart로 서버를 리스타팅 할 필요가 없다

ps aux|egrep (PID|nginx) # 여기서 master [pid]를 알아낸후 
kill -HUP [pid]

이렇게 하면 무정지로 서버 리스타팅이 가능하다.

2. centos 5.4 - install nginx + php(with spawn-fcgi)

먼저 php패키지를 인스톨한다.(이외 필요한 php패키지 및 php-cache 프로그램은 알맞게 install)
yum install php php-dev

nginx의 경우 spawn-cgi를 같이 사용한다.
소스는 여기(http://redmine.lighttpd.net/projects/sp ··· %2Fbuild)에 있다.
wget http://www.lighttpd.net/download/spawn-fcgi-1.6.3.tar.gz
tar xvfz spawn-fcgi-1.6.3.tar.gz
cd spawn-fcgi-1.6.3
./configure --prefix=/usr
make
make install

init 스크립트는 다음 참조 : http://bash.cyberciti.biz/web-server/rh ··· cript%2F
vi /etc/init.d/php-cgi
#!/bin/sh
#
# php-cgi - php-fastcgi swaping via spawn-fcgi
#
# chkconfig: - 85 15
# description: Run php-cgi as app server
# processname: php-cgi
# config: /etc/sysconfig/phpfastcgi (defaults RH style)
# pidfile: /var/run/php_cgi.pid
# Note: See how to use this script :
# http://www.cyberciti.biz/faq/rhel-fedora-install-configure-nginx-php5/
# Source function library.
. /etc/rc.d/init.d/functions

# Source networking configuration.
. /etc/sysconfig/network

# Check that networking is up.
[ "$NETWORKING" = "no" ] && exit 0

spawnfcgi="/usr/bin/spawn-fcgi"
php_cgi="/usr/bin/php-cgi"
prog=$(basename $php_cgi)
server_ip=127.0.0.1
server_port=9000
server_user=nginx
server_group=nginx
server_childs=5
pidfile="/var/run/php_cgi.pid"

# do not edit, put changes in /etc/sysconfig/phpfastcgi
[ -f /etc/sysconfig/phpfastcgi ] && . /etc/sysconfig/phpfastcgi

start() {
[ -x $php_cgi ] || exit 1
[ -x $spawnfcgi ] || exit 2
echo -n $"Starting $prog: "
daemon $spawnfcgi -a ${server_ip} -p ${server_port} -u ${server_user} -g ${server_group} -P ${pidfile} -C ${server_childs} -f ${php_cgi}
retval=$?
echo
return $retval
}

stop() {
echo -n $"Stopping $prog: "
killproc -p ${pidfile} $prog -QUIT
retval=$?
echo
[ -f ${pidfile} ] && /bin/rm -f ${pidfile}
return $retval
}

restart(){
stop
sleep 2
start
}

rh_status(){
status -p ${pidfile} $prog
}

case "$1" in
start)
start;;
stop)
stop;;
restart)
restart;;
status)
rh_status;;
*)
echo $"Usage: $0 {start|stop|restart|status}"
exit 3
esac

chmod +x /etc/init.d/php-cgi
vi /etc/nginx/nginx.conf
# server 섹션안에 다음 구문을 추가한다
location ~ \.php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /var/www/html$fastcgi_script_name;
include fastcgi_params;
}


3. ubuntu 9.10 - nginx

유분투는 당연히 nginx 패키지를 가지고 있다.
apt-get install nginx


4. ubuntu 9.10 - nginx + php

apt-get install php5 php5-cgi spawn-fcgi

다음 셋팅으로 init script 만든다 참조: http://chrisjohnston.org/2009/setting-u ··· untu-904
vi /etc/init.d/php-fastcgi
#! /bin/sh
### BEGIN INIT INFO
# Provides: php-fastcgi
# Required-Start: $all
# Required-Stop: $all
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start and stop php-cgi in external FASTCGI mode
# Description: Start and stop php-cgi in external FASTCGI mode
### END INIT INFO

# Author: Kurt Zankl <[EMAIL PROTECTED]>

# Do NOT "set -e"

PATH=/sbin:/usr/sbin:/bin:/usr/bin
DESC="php-cgi in external FASTCGI mode"
NAME=php-fastcgi
DAEMON=/usr/bin/php-cgi
PIDFILE=/var/run/$NAME.pid
SCRIPTNAME=/etc/init.d/$NAME
PHP_CONFIG_FILE=/etc/php5/cgi/php.ini

# Exit if the package is not installed
[ -x "$DAEMON" ] || exit 0

# Read configuration variable file if it is present
[ -r /etc/default/$NAME ] && . /etc/default/$NAME

# Load the VERBOSE setting and other rcS variables
. /lib/init/vars.sh

# Define LSB log_* functions.
# Depend on lsb-base (>= 3.0-6) to ensure that this file is present.
. /lib/lsb/init-functions

# If the daemon is not enabled, give the user a warning and then exit,
# unless we are stopping the daemon
if [ "$START" != "yes" -a "$1" != "stop" ]; then
log_warning_msg "To enable $NAME, edit /etc/default/$NAME and set START=yes"
exit 0
fi

# Process configuration
export PHP_FCGI_CHILDREN PHP_FCGI_MAX_REQUESTS
DAEMON_ARGS="-q -b $FCGI_HOST:$FCGI_PORT -c $PHP_CONFIG_FILE"

do_start()
{
# Return
# 0 if daemon has been started
# 1 if daemon was already running
# 2 if daemon could not be started
start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON --test > /dev/null \
|| return 1
start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON \
--background --make-pidfile --chuid $EXEC_AS_USER --startas $DAEMON -- \
$DAEMON_ARGS \
|| return 2
}

do_stop()
{
# Return
# 0 if daemon has been stopped
# 1 if daemon was already stopped
# 2 if daemon could not be stopped
# other if a failure occurred
start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --pidfile $PIDFILE > /dev/null # --name $DAEMON
RETVAL="$?"
[ "$RETVAL" = 2 ] && return 2
# Wait for children to finish too if this is a daemon that forks
# and if the daemon is only ever run from this initscript.
# If the above conditions are not satisfied then add some other code
# that waits for the process to drop all resources that could be
# needed by services started subsequently. A last resort is to
# sleep for some time.
start-stop-daemon --stop --quiet --oknodo --retry=0/30/KILL/5 --exec $DAEMON
[ "$?" = 2 ] && return 2
# Many daemons don't delete their pidfiles when they exit.
rm -f $PIDFILE
return "$RETVAL"
}
case "$1" in
start)
[ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC" "$NAME"
do_start
case "$?" in
0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
esac
;;
stop)
[ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME"
do_stop
case "$?" in
0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
esac
;;
restart|force-reload)
log_daemon_msg "Restarting $DESC" "$NAME"
do_stop
case "$?" in
0|1)
do_start
case "$?" in
0) log_end_msg 0 ;;
1) log_end_msg 1 ;; # Old process is still running
*) log_end_msg 1 ;; # Failed to start
esac
;;
*)
# Failed to stop
log_end_msg 1
;;
esac
;;
*)
echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload}" >&2
exit 3
;;
esac

init script 설정 파일 추가한다
chmod +x /etc/init.d/php-fastcgi
vi /etc/default/php-fastcgi
START=yes

# Which user runs PHP? (default: www-data)

EXEC_AS_USER=www-data

# Host and TCP port for FASTCGI-Listener (default: localhost:9000)

FCGI_HOST=localhost
FCGI_PORT=9000

# Environment variables, which are processed by PHP

PHP_FCGI_CHILDREN=4
PHP_FCGI_MAX_REQUESTS=1000

기본 default vhost 설정에 추가
vi /etc/nginx/sites-available/default
location ~ \.php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /var/www/nginx-default$fastcgi_script_name;
include fastcgi_params;
}

이러면 설정 완료
크리에이티브 커먼즈 라이센스
Creative Commons License

Posted by 엽기민원

2010/01/20 01:23 2010/01/20 01:23
Response
No Trackback , No Comment
RSS :
http://yupmin.com/rss/response/175

TextCube 1.7.9-backport용 DracoCounter 3.52

블로그 카운터로 DracoCounter를 자주 사용하는데, 1.7.9-backport로 수정했습니다. 1.8용으로도 쓸수 있을듯 합니다. ^^

1.7.9-backport 이하의 버젼은 사용못합니다. Draco 님이 만드신 3.02버젼에서 그전 버젼과의 차이를 위해 0.5를 높였습니다.

(현재 1.7.9-backport 확장 배포본 플러그인 오류 수정중입니다. 그래서 잠깐 작업해봤습니다. ^^)
사용자 삽입 이미지


크리에이티브 커먼즈 라이센스
Creative Commons License

Posted by 엽기민원

2009/11/29 20:38 2009/11/29 20:38
, ,
Response
No Trackback , 3 Comments
RSS :
http://yupmin.com/rss/response/173

Postfix 셋팅하기

imap/pop3 서비스를 쓰지 않는다면, sendmail보다는 postfix를 쓰는게 좋다.

게다가 요즘 대부분 gmail을 베이스로 쓰니..  간단한 셋팅에 다양한 매쉬업들이 가능하다.

(물론 centos기준)

yum remove sendmail
yum install postfix

/etc/postfix/main.cf 수정
myhostname = test.com
mydomain = test.com
inet_interfaces = all
mydestination = $myhostname, localhost.$mydomain, $mydomain
mynetworks = 127.0.0.0/8


도메인 별 alias 설정은 http://www.postfix.org/VIRTUAL_README.html 참조
스팸체크 및 한글설명서는 http://wiki.kldp.org/wiki.php/Postfix-SASL-HOWTO 참조

외부로 smtp 서버를 열었을 경우 스팸들의 습격을 받을수도 있으니..
malware urls를 참고 해서 /etc에 다음과 같은 스크립트를 만든다
vi /etc/fetch.postfixmalware.sh

#!/bin/bash
# Script to update malware urls
/usr/bin/wget -O - http://www.malware.com.br/cgi/submit?action=list_postfix > /etc/postfix/mbl-body-deny
/usr/sbin/postmap /etc/postfix/mbl-body-deny
/etc/init.d/postfix reload

crontab에 다음과 같은 구문을 추가하면 보통의 스팸들은 막을수 있다
40 4 * * * /etc/fetch.postfixmalware.sh >/dev/null 2>&1

더해서 스팸을 막는 다양한 방법들은 다음 링크 참조 : http://www.howtoforge.com/virtual_postfix_antispam

크리에이티브 커먼즈 라이센스
Creative Commons License

Posted by 엽기민원

2009/11/25 12:25 2009/11/25 12:25
Response
No Trackback , No Comment
RSS :
http://yupmin.com/rss/response/171

monit 부활

죽어있었던 monit사이트가 부활했다. (약 6~7개월전 죽었던걸로 기억함.)
centos에 rpm으로 설치했을때는 잘작동하지 않았는데, 이번에는 작동할지?
yum install flex bison openssl-devel
wget http://mmonit.com/monit/dist/monit-5.0.3.tar.gz
tar xvfz monit-5.0.3.tar.gz
cd monit-5.0.3
./configure
make; make install

설정 파일은 다음과 같이(/etc/monitrc)
set daemon 60
set logfile syslog facility LOG_daemon
set mailserver localhost
set alert admin@abc.com
set httpd port 8080 address localhost
allow localhost


check process apache with pidfile "/var/run/httpd.pid"
start = "/etc/init.d/httpd start"
stop = "/etc/init.d/httpd stop"
if failed host 127.0.0.1 port 80 and protocol http
and request "/abc.txt" then restart
if cpu usage is greater than 60 percent for 2 cycles then alert
if cpu usage > 98% for 5 cycles then restart
if 2 restarts within 3 cycles then timeout
alert admin@abc.com

check process mysql with pidfile "/var/run/mysqld/mysqld.pid"
group database
start program = "/etc/init.d/mysqld start"
stop program = "/etc/init.d/mysqld stop"
if failed host 127.0.0.1 port 3306 then restart
if cpu usage > 98% for 5 cycles then restart
if 5 restarts within 5 cycles then timeout


initscript는 다음을 다운받아서


가끔씩 httpd pid를 먹어버리거나...(httpd 자체 문제인지 모르겠음)  문제가 약간 있는듯 하다

http://mmonit.com/ m/monit를 써보고 싶지만 싶지만, 너무 비싸다. (스텐다드 타입이 €99...15만원선..프로페셔널 타입은 €499...76만원선 ㅎㄷㄷ )
크리에이티브 커먼즈 라이센스
Creative Commons License

Posted by 엽기민원

2009/11/06 18:57 2009/11/06 18:57
, ,
Response
No Trackback , No Comment
RSS :
http://yupmin.com/rss/response/160

centos php5.2 업그레이드

centos 에서 php의 버젼은 고질적인 문제다. php5.1인데 yum을 이용해 업그레이드 할 수 있는 안전한 방법은 custom repository를 이용하는 것인데, 이 방법에는 문제가 있다. 문제는 바로 php배포본뿐만 아니라 여타 다른 배포본까지 업데이트 해야 하는 문제가 있다. 만일 다시 원래 repo로 돌아가려면 영향받는 mysql 등까지도 다시 깔아야 하는데 이건 도통 귀찮은 방법이다.

그래서 방법을 찾던 중 제일 간편하고, 다시 원래 배포본으로 돌아갈 수 있는 방법이 있었으니 다음과 같다. ^^

참조 : http://www.somegate.com/topic_new.php?topic_uid=3973
wget http://dev.centos.org/centos/5/CentOS-Testing.repo
mv CentOS-Testing.repo /etc/yum.repos.d/
yum --enablerepo=c5-testing update php

그리고 eaccelerator, memcache(php-pecl-memcache 이 작동안함)를 다시 깔아야함.
yum --enablerepo=c5-testing install php-mcrypt php-tidy php-mbstring
그외 필요한 php모듈은 버젼에 맞게 다시 깔면 된다.

새로 깔리는 패키지
php
php-cli
php-common
php-devel
php-gd
php-mysql
php-pdo
php-xml
php-tidy
php-mcrypt
libtidy mysql-libs

이것만 지우고 다시 깔면 원복이 될듯..
xdebug, json 등은 pear로 깔면 되니
yum install --enablerepo=c5-testing php-pear
pear install pecl/json
pear install Xdebug
크리에이티브 커먼즈 라이센스
Creative Commons License

Posted by 엽기민원

2009/11/06 18:45 2009/11/06 18:45
, ,
Response
No Trackback , No Comment
RSS :
http://yupmin.com/rss/response/168

eAccelerator php 설치

정작 php를 깔아놓고 옵티마이저등을 안까는건 바보 같은일...

참조 : http://www.codeway.co.kr/board/bbs/boar ··· id%3D132

yum install php-devel
wget http://bart.eaccelerator.net/source/0.9.5.3/eaccelerator-0.9.5.3.tar.bz2
tar xvfj eaccelerator-0.9.5.3.tar.bz2
cd eaccelerator-0.9.5.3
phpize
./configure
make;make install
mkdir -p /var/cache/eaccelerator
chmod 0777 /var/cache/eaccelerator
vi /etc/php.d/eaccelerator.ini

extension="eaccelerator.so"
eaccelerator.shm_size="16"
eaccelerator.cache_dir="/var/cache/eaccelerator"
eaccelerator.enable="1"
eaccelerator.optimizer="1"
eaccelerator.check_mtime="1"
eaccelerator.debug="0"
eaccelerator.filter=""
eaccelerator.shm_max="0"
eaccelerator.shm_ttl="0"
eaccelerator.shm_prune_period="0"
eaccelerator.shm_only="0"
eaccelerator.compress="1"
eaccelerator.compress_level="9"



크리에이티브 커먼즈 라이센스
Creative Commons License

Posted by 엽기민원

2009/06/30 23:52 2009/06/30 23:52
,
Response
No Trackback , No Comment
RSS :
http://yupmin.com/rss/response/164

XpressEngine(제로보드) 개발 어렵다.

회사일이 있어. zeroboard 개발건이 생겼는데...

생각보다 힘들다. T-T

첫번째 DB 추상화

<query id="getBoardList" action="select">
<tables>
<table name="modules" />
</tables>
<columns>
<column name="*" />
</columns>
<conditions>
<condition operation="in" column="module" default="'board','guestbook','blog'" />
<group pipe="and">
<condition operation="like" column="mid" var="s_mid" pipe="or" />
<condition operation="like" column="title" var="s_title" pipe="or" />
<condition operation="like" column="comment" var="s_comment" pipe="or" />
<condition operation="equal" column="module" var="s_module" pipe="or" />
<condition operation="equal" column="module_category_srl" var="s_module_category_srl" pipe="or" />
</group>
</conditions>
<navigation>
<index var="sort_index" default="module_srl" order="desc" />
<list_count var="list_count" default="20" />
<page_count var="page_count" default="10" />
<page var="page" default="1" />
</navigation>
</query>

위의 코드는 db쿼리문이다. 일종의 DB쿼리 추상화문인데...

다양한 DB지원을 위해 코드 추상화를 하는 건 알겠다만. 이건 배보다 배꼽이 큰게 아닐런지?
한줄 두줄이면 나오는 쿼리를 이렇게 따로 따로 각각 쿼리문을 추상화해서 코드에 넣고, 관리한다는 건 좀 문제가 있지 않을까 싶다.

문득 Rails의 간편한 추상화 문법들이 그리웠다. T-T

두번재 OOP도 알맞게

오픈 소스라고 한다면, 어느정도 일반사람들도 구문을 이해하고, 수정/개발이 쉬워야 한다고 생각한다. 특히 OOP의 경우 상속이 2~3 level만 가도 난공불락의 요새가 되어버린다.
예전인가? python 소스 overriding 된 함수 하나 해석하는데  많은 시간을 소비했던걸 기억한다.
XpressEngine 소스를 살펴보니 예전 Visual C++, MFC, ActiveX, ATL 프로그램 하는 것 같더라. 소스의 세부사항은 모르면서 이럴때에는 이걸 써야 하고, 저럴때에는 이걸 써야 하고... 에휴...

class simplepiexeAdminView extends simplepiexe {
/**
* @brief 초기화
**/
function init() {
// module_srl이 있으면 미리 체크하여 존재하는 모듈이면 module_info 세팅
$module_srl = Context::get('module_srl');
if(!$module_srl && $this->module_srl) {
$module_srl = $this->module_srl;
Context::set('module_srl', $module_srl);
}
// module model 객체 생성
$oModuleModel = &getModel('module');

// module_srl이 넘어오면 해당 모듈의 정보를 미리 구해 놓음
if($module_srl) {
$module_info = $oModuleModel->getModuleInfoByModuleSrl($module_srl);
if(!$module_info) {
Context::set('module_srl','');
$this->act = 'dispSimplepiexeAdminIndex';
} else {
ModuleModel::syncModuleToSite($module_info);
$this->module_info = $module_info;
Context::set('module_info',$module_info);
}
}

if($module_info && $module_info->module != 'simplepie') return $this->stop("msg_invalid_request");
// 모듈 카테고리 목록을 구함
$module_category = $oModuleModel->getModuleCategories();
Context::set('module_category', $module_category);

$template_path = sprintf("%stpl/",$this->module_path);
$this->setTemplatePath($template_path);
}
}


문득 이런 XpressEngine의 코딩을 해야하는 내가 이런 잡다한 코딩 스타일로 시간을 죽이고 있는게 아닌지 회의가 든다.
크리에이티브 커먼즈 라이센스
Creative Commons License

Posted by 엽기민원

2009/06/19 13:11 2009/06/19 13:11
,
Response
No Trackback , 3 Comments
RSS :
http://yupmin.com/rss/response/163

서버마다 메일서버를 구축할 필요가 없다.
하나의 메일서버를 사용하고, ssmtp로 연결할수 있다.

소스 패키지 : http://packages.debian.org/source/sid/ssmtp

wget http://ftp.de.debian.org/debian/pool/main/s/ssmtp/ssmtp_2.64.orig.tar.bz2
tar xvfj ssmtp_2.64.orig.tar.bz2
cd ssmtp-2.64
./configure --sysconfdir=/etc
make; make install

wget http://ftp.de.debian.org/debian/pool/main/s/ssmtp/ssmtp_2.62.orig.tar.gz
wget http://ftp.de.debian.org/debian/pool/main/s/ssmtp/ssmtp_2.62-3.diff.gz
tar xvfz ssmtp_2.62.orig.tar.gz
gunzip ssmtp_2.62-3.diff.gz
mv ssmtp-2.62 ssmtp
patch -p0 < ssmtp_2.62-3.diff
mv ssmtp ssmtp-2.62
cd ssmtp-2.62/ssmtp
./configure --sysconfdir=/etc
make; make install

그리고 sendmail을 대치한다. 만일 sendmail을 지우지 않았다면 다음과 같이 대치 한다.
아니면 /etc/alternatives 가서 mta관련 링크를 수정해야 한다. (근데 sendmail 지워주고 깔면 알아서 셋팅된다.)
참고 : http://linux.com/archive/feature/132006

sudo mv /usr/sbin/sendmail /usr/sbin/sendmail.orig
sudo ln -s /usr/local/sbin/ssmtp /usr/sbin/sendmail

/etc/ssmtp/ssmtp.conf 수정
#
# /etc/ssmtp.conf -- a config file for sSMTP sendmail.
#
# The person who gets all mail for userids < 1000
# Make this empty to disable rewriting.
root=postmaster
# The place where the mail goes. The actual machine name is required
# no MX records are consulted. Commonly mailhosts are named mail.domain.com
# The example will fit if you are in domain.com and you mailhub is so named.
mailhub=mail ← 바꾸려는 메일서버 주소
# Where will the mail seem to come from?
#rewriteDomain=
# The full hostname
hostname=localhost ← 서버 hostname
fromlineoverride=yes ← php등에서 메일 보낼때 from을 오버라이딩 가능하게


수정 끝.

gmail서버로도 연결이 가능하니 꼭 메일 서버를 가지지 않아도 될듯 하다.
Using SSMTP to Replace Sendmail (Gmail Config)

위 방법과 적절히 사용하면, 간단히 replace가 될듯 하다. 보안에 관해 물론 메일서버에는 셋팅을 해놔야겠지만, ^^
크리에이티브 커먼즈 라이센스
Creative Commons License

Posted by 엽기민원

2009/06/10 14:35 2009/06/10 14:35
Response
No Trackback , No Comment
RSS :
http://yupmin.com/rss/response/161

memcached 설치 / 사용

CentOS 의 경우

source : http://www.danga.com/memcached/dist/

yum install libevent libevent-devel
wget http://www.danga.com/memcached/dist/memcached-1.4.0.tar.gz
tar -xvzf memcached-1.4.0.tar.gz
cd memcached-1.4.0
./configure --with-libevent=/usr/lib/
make; make install

php 라이브러리 추가
yum install php-pecl-memcache

혹은 버젼이 안되면, 직접 컴파일
wget http://pecl.php.net/get/memcache-2.2.5.tgz
tar xvfz memcache-2.2.5.tgz
cd memcache-2.2.5
phpize
./configure --enable-memcache
make
cp modules/memcache.so /usr/lib/php/modules

PHP 관련 설정도 해주고..
vi /etc/php.d/memache.ini 

extension=memcache.so

기본 설정 파일도 만들어주고..
vi /etc/memcached.conf

#Memory a usar
-m 16
# default port
-p 11211
# user to run daemon nobody/apache/www-data
-u nobody
# only listen locally
-l 127.0.0.1

다음의 실행 스크립트 및 데몬 스크립트를 생성한다.
daemon script : http://www.vbseo.com/blogs/danny-bembib ··· ed-44%2F, http://www.dev411.com/wiki/Memcached_startup_files_for_Red_Hat_(RHEL)
wget http://yupmin.com/attachment/1246298963.xxx
mv 1246298963.xxx /usr/local/bin/start-memcached
chmod 755 /usr/local/bin/start-memcached
wget http://yupmin.com/attachment/1314503238.xxx
mv 1314503238.xxx /etc/init.d/memcached
chmod 755 /etc/init.d/memcached

php-test : http://dorkage.net/2009/02/memcached-test/

그외 Sun에서 했던 MySQL 컨퍼런스에 봤던 강사의 키노트
http://download.tangent.org/talks/Memcached%20Study.pdf

memcached wow!!
크리에이티브 커먼즈 라이센스
Creative Commons License

Posted by 엽기민원

2009/05/25 11:33 2009/05/25 11:33
,
Response
No Trackback , 2 Comments
RSS :
http://yupmin.com/rss/response/159

유용한 mysql 관리툴 : mytop

mytop
http://jeremy.zawodny.com/mysql/mytop/
필요 라이브러리
http://search.cpan.org/~jstowe/

centos의 경우
wget http://search.cpan.org/CPAN/authors/id/J/JS/JSTOWE/TermReadKey-2.30.tar.gz
tar xvfz TermReadKey-2.30.tar.gz
cd TermReadKey-2.30
perl Makefile.PL
make;make install

wget http://jeremy.zawodny.com/mysql/mytop/mytop-1.6.tar.gz
tar xvfz mytop-1.6.tar.gz
cd mytop-1.6
perl Makefile.PL
make;make install

혹시 설치시 'Warning: prerequisite DBD::mysql 1 not found.'에러가 난다면
yum install perl-DBD-mysql


만일 s/// 식으로 에러가 나올때는 fix.455901.diff 로 패치
아하 좋쿠나..

사용자 삽입 이미지
크리에이티브 커먼즈 라이센스
Creative Commons License

Posted by 엽기민원

2009/05/15 16:11 2009/05/15 16:11
,
Response
No Trackback , No Comment
RSS :
http://yupmin.com/rss/response/158

우연한 계기로 경기 민언련 강좌(2강 블로그 설치,운영, 관리)를 하게 되었습니다. ^^

사용자 삽입 이미지

크리에이티브 커먼즈 라이센스
Creative Commons License

Posted by 엽기민원

2009/02/17 00:29 2009/02/17 00:29
,
Response
A trackback , No Comment
RSS :
http://yupmin.com/rss/response/153

문제 발생!!
현재 다음블로그 뉴스 플러그인에 큰 결함이 나왔습니다. 현재 트랙백을 보낼때 숫자 퍼머링크로 강제로 보내는데요. 아마 다음 블로그뉴스의 "내 글 보내기" 부분과 충돌이 나는 것 같습니다.
그래서 숫자 퍼머링크를 사용하시는 분들만 현재로썬 사용하는게 최선일듯 싶습니다. 아니면 다음블로그뉴스 플러그인으로만 보내시던가요. -_-a

가까운 시일내에 이부분 수정하도록하겠습니다.

Textcube용 다음 블로그 뉴스 플러그인이 새로 업데이트 되었습니다. ^^
외부 블로거들을 위한 다음블로그뉴스 api정책이 갑작스레 바뀌는 관계로, 정책결정에 따른 시간이 좀 걸렸습니다. 소스등을 정리하고, 거기에다가 자동복구 기능을 좀더 강화시켰습니다. Textcube 1.7이상에만 적용됩니다. 제가 하위 버젼을 개발 할수 있는 시간이 없습니다. -_-;

몇몇분들이 블로거뉴스 카테고리가 이상하게 보이고 있습니다. 수정본을 새로 다운받거나 다음 부분을 수정해주세요.

419줄 수정 ($service['encoding'] = > 'EUC-KR')
    $xmls = new XMLStruct();
if ($xmls->open($xml, 'EUC-KR')) {
ob_start();

277줄 수정 ($service['encoding'] = > 'EUC-KR')
    $xmls = new XMLStruct();
if (!$xmls->open($xml, 'EUC-KR'))
return false;


Textcube용 다음블로그 뉴스 주요 플러그인 기능

  • 다음블로그뉴스 자동 발행/예약 발행도 가능
  • 다음블로그뉴스 테이블 손상시 자동복구
  • 추천위젯 선택 가능
  • 나의 블로거 뉴스 사이드바 지원
  • 베스트 블로거 뉴스 사이드바 지원
  • 다음블로거뉴스 배너 지원

변경사항(0.9.7.3, 20081113)

  • 블로그 뉴스 채널 찾기 오류 수정 및 보완(위즈님 감사^^)
  • 집단의 지성이 다음블로그뉴스 플러그인을 발전시키는 군요. 와우~ (코드 수정할 부분있으면 알려주세요. ^^)

변경사항(0.9.7.2, 20081111)

  • 다음 카테고리 채널 api 정책 변경에 따른 수정(도아님 감사^^)
  • DB관련 함수 정리

변경사항(0.9.7, 20081022)

  • 카테고리가 이상하게 나오는 오류

변경사항(0.9.7, 20081020)

  • 버젼 업그레이드에 따른 자동 Table 마이그레이션
    꼭 한 번은 하셔야 합니다. 방법은 환경설정을 한번 누르고 저장을 눌러주세요.
  • textcube 1.7이상 버젼만 지원(꼭 1.7이상 업그레이드 하시길 바랍니다.)
  • 다음블로거뉴스 api 변경에 따른 수정
  • 데이타 손실에 따른 자동복구
  • 무슨 문제가 있으면, 연락/댓글주세요. 문제가 심각하면, TC_DaumBloggerNews 테이블을 삭제 하고, 플러그인을 비활성화->활성화 해주세요. 페이지를 로딩할때 자동 복구됩니다. ^^

변경사항(0.9.5, 20080627)

  • 위젯안나오는 오류 진짜 수정(인코딩 오류였습니다. -_-a)
  • 과거 위젯 다시 추가
  • 글쓰기 페이지 카테고리 캐쉬타임 하루로 늘림
  • 아마 그전에 위젯 안나오신 분들은 아마 데이타 초큼이 지워졌을 가능성이 농후합니다. 이거 복구됩니다.(어떻게? 글수정 페이지 한번만 들어가시면)
  • 그리고 이시간 시청앞 천막은 철수되는 군요. 이명박 개새!!

변경사항(0.9.4, 20080620)

  • 위젯안나오는 오류 수정
  • 글쓰기 페이지에 로딩 속도 개선
  • 추천 위젯 플래쉬(새로운 버젼)로 업데이트
사용자 삽입 이미지

변경사항(0.9.3, 20080613)

  • 위젯안나오는 오류 수정

변경사항(0.9.3, 20080609)

  • 1.7 업데이트 버젼 인코딩 에러 해결
  • ChangeVisibility, DeletePost 이벤트 처리(예약 공개시 자동 다음 블로그 뉴스 발행) : TC 1.6.4에선 적용되지 않습니다.
  • 삭제된(만의 하나의 경우) 카테고리 정보 자동 복원 : 다음블로그 뉴스 정보를 가지고 entryid중심으로(entryid만 같다면 알아서) 자동 복원
  • 비공개된 글의 경우 임시적으로 카테고리가 저장됩니다. 공개된 글의 경우 다음블로그뉴스쪽의 글을 삭제하면 자동으로 리셋이됩니다.

주의사항

  • 플러그인을 제대로 사용하기 위해선 "다음 블로거 뉴스 기자단"에 가입하셔야 합니다.
  • 이 플러그인으로 인한 트래픽증가에 대한 문제(Textcube에 관한 문제 포함)는 책임지지 않습니다. -_-a
  • 다운받으시는 분은 꼭 리흘을 흘려주세요. ^^

버그 리포팅

  • 가끔식 디자인이 안 맞는 수가 있슴다. 알맞게 수정해서 쓰길 바랍니다. (제 스킨 css가 안맞네요.)
  • TC1.7인 분은 꼭 1.7용으로 다운받으세요. 새버젼인 다음블로그뉴스 플러그인 0.9.3은 1.6.3이하 버젼에서 테스트 해보지 못했읍니다만, 먼저 사용해보시고 작동 안하실때에는 구버젼(0.9.2)을 사용해주시고, 혹시 사용하다 에러나면 꼭 리포팅해주세요. ^^

다운로드(last update 20081113)

크리에이티브 커먼즈 라이센스
Creative Commons License

Posted by 엽기민원

2008/11/26 17:02 2008/11/26 17:02
, , ,
Response
4 Trackbacks , 72 Comments
RSS :
http://yupmin.com/rss/response/127

Metabbs용 스킨 : yp-board-default 0.2

MetaBBS의 현재 버젼은 0.11입니다. 근데 기본 스킨인 board-default 스킨이 완벽하지 않습니다. 그래서 조금 하나씩 체그하면서 수정해봤습니다.

어짜피 MetaBBS 1.0이상에서는 다른 스킨 구조로 갈터이지만, 그래도... MetaBBS의 심플한 구조에 반하신 분들에게는 이 스킨이 용이 할겁니다. ^^

기본 스킨에 다음과 같은 패치가 되어있습니다.
  • 이전 스킨에 있던 audio play 플래쉬도 옮겨왔구요.
  • 리스트에서 제목 길이, 하단 제목네비게이션 길이를 정할수 있습니다. (필요없으신 분은 utf8_strcut 함수를 제거 하면됩니다.)
  • 보기 페이지에서 제목길이가 길어도 어느정도 보이게 함(이전에는 짤려서 보였음)
  • 보기 페이지에서 컨텐츠 body 영역에 상위 css가 계승되지 않게 했습니다. 그외 간단한 스타일 추가했습니다.(pre code 스타일도..^^)
  • 보기 페이지에서 서명부분 css추가했습니다.
  • 테마부분도 수정했습니다.
오류가 있어 수정했습니다.
  • r1264에 맞게 captcha 처리를 했습니다.
  • audio play v2.0b 로 업데이트 했습니다.

크리에이티브 커먼즈 라이센스
Creative Commons License

Posted by 엽기민원

2008/08/15 12:24 2008/08/15 12:24
,
Response
No Trackback , a comment
RSS :
http://yupmin.com/rss/response/147

Metabbs에 ReCAPTCHA 달기..

post 폼 패턴을 읽어서 마구잡이로 가입, 도배질을 막기위해 CAPTCHA를 달기로 결정!!

CAPTCHA 들이 많이 나왔으나, 그것조차도 읽는 알고리즘이 발견 하여, 나왔다는게 ReCAPTCHA 라는데 한번 달아보기로 했다.
ReCAPTCHA에 대한 설명은 다음 링크 참조
http://en.wikipedia.org/wiki/ReCAPTCHA

적용방법

  • http://recaptcha.net/ 사이트에 가입
  • 사용하려는 사이트 등록 및 Public Key, Private Key 발급
  • /lib 에 recaptchalib.php를 넣고
  • common.php에 라이브러리 추가
    require METABBS_DIR . '/lib/recaptchalib.php';
    $publickey = "xxxx";
    $privatekey = "xxxx";
  • /theme/[자신이 쓰는 테마]/signup.php 에 form안 어딘가에 다음 코드 추가
    <p>
    <label><?=i('CAPTCHA')?><span class="star">*</span></label>
    <?= recaptcha_get_html($publickey, $error);?>
    </p>
  • /app/controller/account/singup.php 를 아래 파일을 다운받아 깔고 끝

스팸이여 안녕...

이걸 어떻게 metabbs 소스에 독립적으로 구현할것인가만 문제...-_-

물론 다른 captcha lib도 서베이 해보겠뜸 ^^
크리에이티브 커먼즈 라이센스
Creative Commons License

Posted by 엽기민원

2008/08/07 17:29 2008/08/07 17:29
,
Response
No Trackback , 7 Comments
RSS :
http://yupmin.com/rss/response/146

첫 MetaBBS용 플러그인입니다. ^^ 다른 플러그인을 만들기 위한 전초전으로 만들어봤습니다. 제가 만든 플러그인이긴 하지만, "Markdown", "Textile" 플러그인이 좀더 웹표준 포매터로써는 적합하다고 생각합니다. 그래도 국내사용자들의 편의성을 위해 만들어보았을 뿐입니다.

MetaBBS는 국내 오픈소스 웹 표준 게시판 프로젝트입니다.

변경사항(0.1.3 20080805)

  • 글쓰기(new) 모드에서 오류 수정(단 metabbs revision 1248 이상이어야함)

변경사항(0.1.2 20080711)

  • 미로그인 상태에서 글쓰기 오류 수정

변경사항(0.1.1 20080710)

  • id="post_secret" 사용안할때 javascript 에러 수정
  • 디버그 코드 삭제
  • 일부 문구 수정

변경사항(0.1 20080708)

  • MetaBBS게시판 입력을 여타 다른 게시판류처럼 'html tag가능', 'enter to <BR>'기능이 가능하게 됩니다.
  • 다른 WIGWIS플러그인에 있는 HTML_Safe.php를 사용해서 HTML문법을 맞추거나, 제한된 태그를 정의 할수 있습니다.
  • HTML_Safe.php 파일에서는 다양한 셋팅을 할수 있습니다. $deleteTags 에서 제거할 태그를 정의 할수 있습니다. flash동영상 코드를 이용하기 위해선 $deleteTags 에서 embed, object 태그를 삭제 해야 합니다.

사용방법

해당 플러그인을 plugin 폴더에 알맞게 깔고, skin 폴더에 write.php 파일에 다음(비밀글 체크)과 같은 부분에 id="post_secret"를 추가해주면 됩니다.

<input type="checkbox" name="secret" id="post_secret" value="1" <?=$secret_checked?> /> 비밀글

다운로드




크리에이티브 커먼즈 라이센스
Creative Commons License

Posted by 엽기민원

2008/08/05 14:17 2008/08/05 14:17
, ,
Response
No Trackback , 3 Comments
RSS :
http://yupmin.com/rss/response/144

뭐 이런 게시판의 좋고 나쁘고 여부를 떠나...

게시판 : http://tw.naver.com/nboard2/list/1000003343

사용자 삽입 이미지
왜 파이어 폭스에서 스크립트 에러가 뜨는 것이냐? -_-a

에러가 나는 방법은 브라우저 "파이어폭스"에서 마우스를 클릭하지 말고 A 링크태그에(예를 들자면 클릭하는 제목, 하위 페이지 네이게이션) 클릭하지 말고 마구 갖다대면 난다. 아마 간략글을 보여주는 스크립트가 딜레이 되는 것 같다. 오래 기둘리면, 벗어나긴 하는데...

천하의 네입허가...장난하삼?
크리에이티브 커먼즈 라이센스
Creative Commons License

Posted by 엽기민원

2008/06/13 18:26 2008/06/13 18:26
,
Response
No Trackback , No Comment
RSS :
http://yupmin.com/rss/response/141

우연히 5초만에 개발(-_- 업그레이드, 변경)한 플러그입니다.
커버페이지에 배너를 삽입할수 있습니다.

수정된 부분

  • 커버페이지에 html, 이미지를 배너를 넣을수 있습니다.
  • 커버페이지에 빈줄을 넣을수 있습니다.
  • 커버페이지에서는 간혹 float, 전체div margin를 쓰는데 그에 대비한 clear:both, margin: 0 처리


크리에이티브 커먼즈 라이센스
Creative Commons License

Posted by 엽기민원

2008/03/28 12:47 2008/03/28 12:47
, ,
Response
No Trackback , 4 Comments
RSS :
http://yupmin.com/rss/response/136


블로그 이미지

엽기민원의 옴팡진 공간

- 엽기민원

Notices

Archives

Calendar

«   2010/03   »
  1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30 31      

Site Stats

Total hits:
13077
Today:
44
Yesterday:
224