Posted
Filed under PHP
[원문] http://www.kimsq.co.kr/note/sky/14015

zboard를 비롯한 예전 프로그램들에서 Rb로 이전 후 
Mysql의 버전과 Rb의 패스워드 암호화 방식이 md5로 바뀜으로 인해 (old_password, password)
로그인 실패 시 이전 암호 방식과 비교하여 강제적으로 암호를 md5 방식으로 변환 해 저장하는 팁을 소개합니다.
"/rb/modules/home/lang.korean/action/a.login.php"를 여신 후
15번째 라인
$d['member']['login_emailid'] = (strpos($id,'@')) ? 1:0;
아래에 다음과 같이 dbupdate Query문을 추가합니다.
/////////////////////////////////////////////////////////////////////////
getDbUpdate($table['s_mbrid'],"pw='".md5($pw)."'","pw=old_password('".$pw."') and id='".$id."'");
/////////////////////////////////////////////////////////////////////////
위 구문은 로그인 창에 입력한 아이디의 패스워드 값이 예전 방식(old_password)의 암호와 아이디 패스워드 값이
일치할 경우 해당 패스워드를 md5로 바꾸어 저장해 줍니다.
단, 매번 로그인 시 해당 업데이트 쿼리가 작동하므로, 운영 중인 웹사이트 공지하셔서
Rb 변환 후 일정 기간동안 운영 후 삭제하시는게 좋을 듯 합니다.
위와 동일한 문제를 겪고 있으시다면 참고 하셔서 도움이 되셨으면 좋겠네요.
이상 Sky~~~ 였습니다.
2014/07/14 16:46 2014/07/14 16:46
Posted
Filed under Htm&Javascript
다음과 같이 메타 테그를 넣어 준다.

<meta http-equiv="X-UA-Compatible" content="IE=Edge"/>
2014/03/19 14:17 2014/03/19 14:17
Posted
Filed under Linux
##### APM 컴파일 설치시 ##### cd /usr/local/src wget http://h264.code-shop.com/download/apache_mod_h264_streaming-2.2.7.tar.gz tar -zxvf apache_mod_h264_streaming-2.2.7.tar.gz cd mod_h264_streaming-2.2.7 ./configure --with-apxs='/usr/local/apache/bin/apxs' make make install # so파일 있는지 확인 ll /usr/local/apache/modules/mod_h264_streaming.so # httpd.conf 파일 수정 # LoadModule h264_streaming_module modules/mod_h264_streaming.so AddHandler h264-streaming.extensions .mp4 ##### APM rpm 설치시 ##### cd /usr/local/src wget http://h264.code-shop.com/download/apache_mod_h264_streaming-2.2.7.tar.gz tar -zxvf apache_mod_h264_streaming-2.2.7.tar.gz cd mod_h264_streaming-2.2.7 find / -name "*apxs*" ./configure --with-apxs='/usr/sbin/apxs' make make install # so파일 있는지 확인 ll /etc/httpd/modules/mod_h264_streaming.so # httpd.conf 파일 수정 # LoadModule h264_streaming_module modules/mod_h264_streaming.so AddHandler h264-streaming.extensions .mp4
2014/03/18 00:50 2014/03/18 00:50
Posted
Filed under Linux
[원문]: http://sudarmuthu.com/blog/rotating-apache-log-files-using-cronolog/ - 파일 다운로드 체크 - [참고] : https://github.com/jamiew/apache-file-download-stats Rotating Apache log files using Cronolog Published Mar 9, 2008 | In Unix/Server Stuff I must confess that I am a stats freak. If you are a long time reader of my blog, then you would have known that by now yourself. ;-) This explains the reason why I want to preserve my Apache log files in spite of using a variety of stat services like Google Analytics, WordPress stats, statscounter, performancing metrics (before it was closed). The default Apache configuration preserves the log files only for the last 10 days, but I wanted to permanently archive this files. After some searches in Google I came across an excellent program called Cronolog. Cronolog is a simple filter program which writes each log entry to a separate log file named after the filename format specified. You can use a variety of parameters like current date, time etc to define the filename template. First we have to install cronolog, either by using aptitude or by downloading it from its download page. Then you have to change the log file name path in the virtual host file. (In Ubuntu Gusty, the virtual host files are situated in the path /etc/apache2/sites-enabled). I am using the following file format for this blog # Custom log file locations LogLevel warn ErrorLog "|/usr/sbin/cronolog /path/to/logs/%Y/%m/%Y-%m-%d-sudarmuthu.com-error.log" CustomLog "|/usr/sbin/cronolog /path/to/logs/%Y/%m/%Y-%m-%d-sudarmuthu.com-access.log" combined which will store my log files in separate folders for each year and for each month, like the below hierarchy /2007/12/2007-11-01-sudarmuthu.com-access.log /2007/12/2007-11-02-sudarmuthu.com-access.log ...... /2008/01/2008-01-01-sudarmuthu.com-access.log /2008/01/2008-01-02-sudarmuthu.com-access.log ...... You can use a variety of modifiers for the filename and I have documented some of them in the below table. You can get more information from its documentation. Specifier Description Time fields %H hour (00..23) %I hour (01..12) %p the locale’s AM or PM indicator %M minute (00..59) %S second (00..61, which allows for leap seconds) %X the locale’s time representation (e.g.: “15:12:47″) %Z time zone (e.g. GMT), or nothing if the time zone cannot be determined Date fields %a the locale’s abbreviated weekday name (e.g.: Sun..Sat) %A the locale’s full weekday name (e.g.: Sunday .. Saturday) %b the locale’s abbreviated month name (e.g.: Jan .. Dec) %B the locale’s full month name, (e.g.: January .. December) %c the locale’s date and time (e.g.: "Sun Dec 15 14:12:47 GMT 1996") %d day of month (01 .. 31) %j day of year (001 .. 366) %m month (01 .. 12) %U week of the year with Sunday as first day of week (00..53, where week 1 is the week containing the first Sunday of the year) %W week of the year with Monday as first day of week (00..53, where week 1 is the week containing the first Monday of the year) %w day of week (0 .. 6, where 0 corresponds to Sunday) %x locale’s date representation (e.g. today in Britain: “15/12/96″) %y year without the century (00 .. 99) %Y year with the century (1970 .. 2038)
2014/03/18 00:39 2014/03/18 00:39
Posted
Filed under Linux
yum clean metadata
yum clean all


yum update 하다 보면 다음 과같은 에러가 발생 한다.

아래와 같은 애러 발생시 위 처럼 yum clean 을 해준다 .

클린후 yum update를 하면 정상 동작 한다.

Error Downloading Packages:
  nss-sysinit-3.15.3-6.0.1.el6_5.x86_64: Insufficient space in download directory /var/cache/yum/x86_64/6Server/public_ol6_latest/packages
    * free   0
    * needed 40 k
  nss-tools-3.15.3-6.0.1.el6_5.x86_64: Insufficient space in download directory /var/cache/yum/x86_64/6Server/public_ol6_latest/packages
    * free   0
    * needed 358 k
  kernel-uek-doc-3.8.13-26.1.1.el6uek.noarch: Insufficient space in download directory /var/cache/yum/x86_64/6Server/public_ol6_UEKR3_latest/packages
    * free   0
    * needed 11 M
  kernel-uek-firmware-3.8.13-26.1.1.el6uek.noarch: Insufficient space in download directory /var/cache/yum/x86_64/6Server/public_ol6_UEKR3_latest/packages
    * free   0
    * needed 1.7 M
  nss-3.15.3-6.0.1.el6_5.x86_64: Insufficient space in download directory /var/cache/yum/x86_64/6Server/public_ol6_latest/packages
    * free   0
    * needed 822 k
  2:postfix-2.6.6-6.el6_5.x86_64: Insufficient space in download directory /var/cache/yum/x86_64/6Server/public_ol6_latest/packages
    * free   0
    * needed 2.0 M
  kernel-2.6.32-431.5.1.el6.x86_64: Insufficient space in download directory /var/cache/yum/x86_64/6Server/public_ol6_latest/packages
    * free   0
    * needed 28 M
  kernel-firmware-2.6.32-43


2014/02/24 14:01 2014/02/24 14:01
Posted
Filed under ORACLE

9i에서 10G이상 데이터를 이관하다 보면 ,
charset을 euc-kr에서 utf-8로 변경해야 되는 상황이 발생 한다.
그랬을 때 byte로 되어 있는 euc-kr을 utf-8로 이관 하면서
varchar2에 maxsizse를 넘어 버려서 에러가 발생하는 경우가 있다
그러면 다음과 같이 nls_length_semantics을 default BYTE를
CHAR로 변환 한다.


#in sqlplus
show parameter nls_length
alter system set nls_length_semantics=CHAR scope=both;
show parameter nls_length



NLS_LENGTH_SEMANTICS
enables you to create CHAR and VARCHAR2 columns using either byte or character length semantics. Existing columns are not affected.

NCHAR, NVARCHAR2, CLOB, and NCLOB columns are always character-based. You may be required to use byte semantics in order to maintain compatibility with existing applications.

NLS_LENGTH_SEMANTICS does not apply to tables in SYS and SYSTEM. The data dictionary always uses byte semantics.

Property Description
Parameter type String
Syntax NLS_LENGTH_SEMANTICS = string

Example: NLS_LENGTH_SEMANTICS = 'CHAR'

Default value BYTE
Modifiable ALTER SESSION
Range of values BYTE | CHAR
2014/02/20 11:20 2014/02/20 11:20
Posted
Filed under jquery

[원문] : http://blog.bits.kr/90

$(document).ready(function(){
  var $doc           = $(document);
  var position       = 0;
  var top = $doc.scrollTop(); //현재 스크롤바 위치
  var screenSize     = 0;        // 화면크기
  var halfScreenSize = 0;    // 화면의 반

  /*사용자 설정 값 시작*/
  var pageWidth      = 1000; // 페이지 폭, 단위:px
  var leftOffet      = 409;  // 중앙에서의 폭(왼쪽 -, 오른쪽 +), 단위:px
  var leftMargin     = 909; // 페이지 폭보다 화면이 작을때 옵셋, 단위:px, leftOffet과 pageWidth의 반만큼 차이가 난다.
  var speed          = 1500;     // 따라다닐 속도 : "slow", "normal", or "fast" or numeric(단위:msec)
  var easing         = 'swing'; // 따라다니는 방법 기본 두가지 linear, swing
  var $layer         = $('#floating'); // 레이어 셀렉팅
  var layerTopOffset = 188;   // 레이어 높이 상한선, 단위:px
  $layer.css('z-index', 10);   // 레이어 z-인덱스
  /*사용자 설정 값 끝*/

  //좌우 값을 설정하기 위한 함수
  function resetXPosition()
  {
    $screenSize = $('body').width();// 화면크기
    halfScreenSize = $screenSize/2;// 화면의 반
    xPosition = halfScreenSize + leftOffet;
    if ($screenSize < pageWidth)
      xPosition = leftMargin;
    $layer.css('left', xPosition);
  }

  // 스크롤 바를 내린 상태에서 리프레시 했을 경우를 위해
  if (top > 0 )
    $doc.scrollTop(layerTopOffset+top);
  else
    $doc.scrollTop(0);

  // 최초 레이어가 있을 자리 세팅
  $layer.css('top',layerTopOffset);
  resetXPosition();

  //윈도우 크기 변경 이벤트가 발생하면
  $(window).resize(resetXPosition);

  //스크롤이벤트가 발생하면
  $(window).scroll(function(){
    yPosition = $doc.scrollTop()+layerTopOffset;
    $layer.animate({"top":yPosition }, {duration:speed, easing:easing, queue:false});
  });
});
//레이어 HTML 마크업은 아주 간단하게. ID만 주는정도로 끝..(position:absolute는 줘야 합니다..)
<div id="floating"  style="position:absolute;" >
  레이어 내용
</div>

2014/02/18 13:55 2014/02/18 13:55
Posted
Filed under ORACLE

Now it is called Oracle Enterprise Manager Cloud Control (previously, Grid Control).

Version: 12

Platform: OEL 6.1, x86_64 (Installed on a VM)

Requirements: Oracle Database 11g Release 2 11.2.0.3

1 - Install the database

1a- firewall and SELinux should be disabled:

# iptables -L
Chain INPUT (policy ACCEPT)
target     prot opt source               destination         

Chain FORWARD (policy ACCEPT)
target     prot opt source               destination         

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination  
# cat /etc/selinux/config

# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
#     enforcing - SELinux security policy is enforced.
#     permissive - SELinux prints warnings instead of enforcing.
#     disabled - No SELinux policy is loaded.
# SELINUX=enforcing
SELINUX=disabled
# SELINUXTYPE= can take one of these two values:
#     targeted - Targeted processes are protected,
#     mls - Multi Level Security protection.
SELINUXTYPE=targeted 

#

1b - Verify that /etc/hosts contains the server's fqdns

# cat /etc/hosts
127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
10.20.30.40    my-em-host.my.domain.com my-em-host
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6

#

1c - Modified kernel parameters: added in /etc/sysctl.conf the following entries:

fs.suid_dumpable = 1
fs.aio-max-nr = 1048576
fs.file-max = 6815744
kernel.shmmni = 4096
# semaphores: semmsl, semmns, semopm, semmni
kernel.sem = 250 32000 100 128
net.ipv4.ip_local_port_range = 9000 65500
net.core.rmem_default=4194304
net.core.rmem_max=4194304
net.core.wmem_default=262144
net.core.wmem_max=1048586

Then called

# /sbin/sysctl -p 

1d - Added the following lines to /etc/security/limits.conf

oracle              soft    nproc   2047
oracle              hard    nproc   16384
oracle              soft    nofile  4096
oracle              hard    nofile  65536
oracle              soft    stack   10240

1e - Added groups and users:

# groupadd -g 502 oinstall
# groupadd -g 503 dba
# groupadd -g 504 oper
# groupadd -g 505 asmadmin
# groupadd -g 506 asmoper
# groupadd -g 507 asmdba
# useradd -u 503 -g oinstall -G dba,asmdba,oper oracle
# passwd oracle

1f - Create the directory for the database

# mkdir -p /u01/app/oracle/product/11.2.0/db_1
# chown -R oracle:oinstall /u01
# chmod -R 775 /u01

1g - install the following packages (use yum for this):

glibc-devel-2.12-1.25.el6.i686 ksh-20100621-6.el6.x86_64 
libaio-0.3.107-10.el6.i686 libaio-devel-0.3.107-10.el6.i686 libaio-devel-0.3.107-10.el6.x86_64 
libstdc++-4.4.5-6.el6.i686 numactl-devel-2.0.3-9.el6.x86_64

1h - login as 'oracle', add the following lines to .bash_profile:

# Oracle Settings
TMP=/tmp; export TMP
TMPDIR=$TMP; export TMPDIR
ORACLE_HOSTNAME=my-em-host.my.domain.com; export ORACLE_HOSTNAME
ORACLE_UNQNAME=orcl; export ORACLE_UNQNAME
ORACLE_BASE=/u01/app/oracle; export ORACLE_BASE
ORACLE_HOME=$ORACLE_BASE/product/11.2.0/db_1; export ORACLE_HOME
ORACLE_SID=orcl; export ORACLE_SID
PATH=/usr/sbin:$PATH; export PATH
PATH=$ORACLE_HOME/bin:$PATH; export PATH
LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib; export LD_LIBRARY_PATH
CLASSPATH=$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib; export CLASSPATH

1i - log in as 'oracle', unzip the oracle-db zips, and run 'runInstaller'

Configure Security Updates: NULL

Download Software Updates: Skip'

Installation Option: Create and configure database

System Class: Server class

Grid options: Single instance

Install type: Typical

Typical Installation: accept values; osdba group: oinstall

Create Inventory: accept default

Prerequisite checks: Installed via yum: compat-libcap1, compat-libstdc++-33, ksh, libaio-devel

Finish: run scripts as 'root':

# /u01/app/oraInventory/orainstRoot.sh  # /u01/app/oracle/product/11.2.0/db_1/root.sh 

1j - Edit /etc/oratab, set resatrt flag to 'Y':

orcl:/u01/app/oracle/product/11.2.0/db_1:Y

1k - create as root file /etc/init.d/dbora

#!/bin/sh
# chkconfig: 345 99 10
# description: Oracle auto start-stop script.
#
# Set ORA_HOME to be equivalent to the $ORACLE_HOME
# from which you wish to execute dbstart and dbshut;
#
# Set ORA_OWNER to the user id of the owner of the
# Oracle database in ORA_HOME.

ORA_HOME=/u01/app/oracle/product/11.2.0/db_1
ORA_OWNER=oracle

if [ ! -f $ORA_HOME/bin/dbstart ]
then
    echo "Oracle startup: cannot start"
    exit
fi

case "$1" in
    'start')
        # Start the Oracle databases:
        # The following command assumes that the oracle login
        # will not prompt the user for any values
        su - $ORA_OWNER -c "$ORA_HOME/bin/dbstart $ORA_HOME"
        touch /var/lock/subsys/dbora
        ;;
    'stop')
        # Stop the Oracle databases:
        # The following command assumes that the oracle login
        # will not prompt the user for any values
        su - $ORA_OWNER -c "$ORA_HOME/bin/dbshut $ORA_HOME"
        rm -f /var/lock/subsys/dbora
        ;;
esac

Then:

# chmod 750 /etc/init.d/dbora
# chkconfig --add dbora

1k - start oracle db

1l - as user 'oracle' access sqlplus / as sysdba and reset password for sys, system and sysman

2 as user oracle run:

emca -deconfig dbcontrol db -repos drop -SYS_PWD <password-SYS> -SYSMAN_PWD <password-SYSMAN>

 3 - as user oracle run sqlplus / as sysdba and:

sqlplus / AS SYSDBA

ALTER SYSTEM SET processes=300 SCOPE=SPFILE;
ALTER SYSTEM SET session_cached_cursors=200 SCOPE=SPFILE;
ALTER SYSTEM SET sga_target=2G SCOPE=SPFILE;
ALTER SYSTEM SET shared_pool_size=600M SCOPE=SPFILE;
ALTER SYSTEM SET pga_aggregate_target=1G SCOPE=SPFILE;
ALTER SYSTEM SET job_queue_processes=20 SCOPE=SPFILE;

-- May be required if using older versions of DB.
--ALTER SYSTEM SET log_buffer=10485760 SCOPE=SPFILE;
--ALTER SYSTEM SET open_cursors=300 SCOPE=SPFILE;

-- Restart the instance.
SHUTDOWN IMMEDIATE
STARTUP 

Got problems to start the database:

SQL> startup
ORA-00838: Specified value of MEMORY_TARGET is too small, needs to be at least 3072M

So, I did:

SQL> create pfile from spfile;

And edited the created file

/u01/app/oracle/product/11.2.0/db_1/dbs/initorcl.ora

and set *.memory_target=3221225472

but also remounted the devshm (as root):

# df -k
Filesystem           1K-blocks      Used Available Use% Mounted on
...
tmpfs                  1929528       528   1929000   1% /dev/shm
...
# mount -t tmpfs shmfs -o size=4g /dev/shm
# df -h
...
tmpfs                 4.0G     0  4.0G   0% /dev/shm
...
# vi /etc/fstab
...
tmpfs        /dev/shm        tmpfs    size=4g        0 0
...
#

then restarted the database:

SQL> startup pfile=/u01/app/oracle/product/11.2.0/db_1/dbs/initorcl.ora
ORACLE instance started.
Total System Global Area 3206836224 bytes
Fixed Size            2232640 bytes
Variable Size         1761611456 bytes
Database Buffers     1426063360 bytes
Redo Buffers           16928768 bytes
Database mounted.
Database opened.
SQL> 

And recreated the spfile

SQL> CREATE SPFILE FROM PFILE;

4 - As 'oracle' created the directory

/u01/app/oracle/Middleware 

4a - install:

 binutils-devel-2.20.51.0.2-5.20.el6.i686

5 - unzipped the OEM zips, and as 'oracle' user ran 'runInstaller'

5a - MOS: no email, uncheck box

5b - Software updates: Skip

5c - Pre-requisite checks: glib-devel warning, ignore and continue

5d - Install types: Create new EM -> Simple -> Middelware location:

/u01/app/oracle/Middleware 

5e - Configuration details: ... (admin password same as DB password)

5f -Warning dialog: click 'Yes' to disable stats gathering job

5g - Warnings : 'OK'

5h - Review: Click 'Install'

5i - After Installation, when pop-up indicates so, run (as root):

/u01/app/oracle/Middleware/oms/allroot.sh

(Note: it overrides all the existing files)

5j - Finishing installation:

This information is also available at: 
    /u01/app/oracle/Middleware/oms/install/setupinfo.txt
See below for information pertaining to your Enterprise Manager installation:
Use the following URL to access:
    1. Enterprise Manager Cloud Control URL: https://my-em.host.my.domain.com:7803/em
    2. Admin Server URL: https://my-em-host.my.domain.com:7103/console
The following details need to be provided during the additional OMS install:
    1. Admin Server Hostname: my-em-host.ie.oracle.com
    2. Admin Server Port: 7103
NOTE: An encryption key has been generated to encrypt sensitive data in the Management Repository. If this key is lost, all encrypted data in the Repository becomes unusable. Please run following command to backup the Management Service configuration including the emkey and keep the backup on another system:
 emctl exportconfig oms -dir <backup location>

5k - Log-In ...

5l - Accept License Agreement

Homepage Selector Screen -> Summary -> 'Preview'; 'Select As My Home'

6 - Create (as root) start/stop script /etc/init.d/emora:

#!/bin/bash

export ORACLE_HOME=/u01/app/oracle/product/11.2.0/db_1
export OMS_HOME=/u01/app/oracle/Middleware/oms
export AGENT_HOME=/u01/app/oracle/Middleware/agent/core/12.1.0.1.0

ORA_OWNER=oracle

case "$1" in
    'start')
        # Start everything

        #$ORACLE_HOME/bin/dbstart $ORACLE_HOME
        /etc/init.d/dbora start

        su - $ORA_OWNER -c "$OMS_HOME/bin/emctl start oms"

        su - $ORA_OWNER -c "$AGENT_HOME/bin/emctl start agent"
        ;;
    'stop')
        # Stop everything

        su - $ORA_OWNER -c "$OMS_HOME/bin/emctl stop oms -all"

        su - $ORA_OWNER -c "$AGENT_HOME/bin/emctl stop agent"

        #$ORACLE_HOME/bin/dbshut $ORACLE_HOME
        /etc/init.d/dbora stop
        ;;
esac

Then:

# chmod 750 /etc/init.d/emora
2014/02/10 18:06 2014/02/10 18:06
Posted
Filed under ORACLE
MP-00003: ORACLE error 20001 encountered
ORA-20001: Invalid or inconsistent input values

imp username file=filename.dmp log=logname.log  full=y statistics=none

options add "statistics=none"


더 보기

http://agreeable.tistory.com/entry/Oracle-expimp
2014/02/07 16:55 2014/02/07 16:55
Posted
Filed under ORACLE
서비스와 관련된 프로세스를 사용하던 프로세스가 없습니다.

라는 에러가 발생 하면,
윈도우 2003을 안전모드로 부팅하여 진행한다.

설치 완료후 재부팅 해서
sqlplus로 접속 해서
다음과 같이
select * from v$version
쿼리를 날려 오라클 버전업이 되었는지 확인한다.
2014/02/07 16:42 2014/02/07 16:42