2012년 11월 21일 수요일

Google Mail App의 Outlook 설정‎








2012년 9월 3일 월요일

Kill Tomcat process at port 8080


Occasionally the Tomcat server doesn't shutdown in a clean way when using Eclipse. What happens is that port 8080 stays in use and the server can't restart. Exiting Eclipse is not sufficient in this case and a restart of Mac OSX is needed.

So, how to kill the running Tomcat and free port 8080.
Open the terminal window and execute the following commands.

  • sudo lsof -w -n -i tcp:8080
This will give you the pidnumber of the process that runs at 8080. You can then go ahead and kill it.

  • sudo kill -9 pidnumber

http://petervandamme.blogspot.kr/2011/09/kill-tomcat-process-at-port-8080.html

2012년 8월 6일 월요일

MySql Function 생성


DELIMITER $$
DROP FUNCTION IF EXISTS dbname.getCompany$$
CREATE FUNCTION dbname.getCompany($p_cid VARCHAR(20)) RETURNS varchar(20) CHARSET utf8
BEGIN
DECLARE return_value VARCHAR(20);
  SET return_value = null;
    SELECT u.mf_code INTO return_value
      FROM users u
     WHERE u.cid = p_cid;
RETURN return_value;
END $$
DELIMITER ;

2012년 8월 2일 목요일

맥 숨긴 폴더, 파일 보기
defaults write com.apple.finder AppleShowAllFiles TRUE 
killall Finder



defaults write com.apple.finder AppleShowAllFiles FALSE 
killall Finder



2012년 6월 27일 수요일

Virtual Host on MAX OSX


Virtual Host on MAX OSX
1. 아파치 활성화:
     라이언: 시스템설정 > 공유 > 웹공유 체크
     마운틴라이언: sudo apachectl start (http://v.daum.net/link/32342588)
2. Installing mod_jk for Apache 2.2 on Mac OS X 10.5 Leopard
출처 http://www.bartbusschots.ie/blog/?p=1347

2.1 tomcat connector 설치
source 파일 다운, 압축해제 후 컴파일
-----------
$ cd native
$ ./configure CFLAGS='-arch x86_64' APXSLDFLAGS='-arch x86_64' --with-apxs=/usr/sbin/apxs
$ make
(make가 안될경우 애플개발자 사이트에서  command line tool ~~ 항목 설치)
$ sudo make install


    ./configure.....에서 에러날 경우 XCode설치 후 심볼릭링크 생성해줌

$ sudo ln -s /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/ /Applications/Xcode.app/Contents/Developer/Toolchains/OSX10.8.xctoolchain

(출처: http://apple.stackexchange.com/questions/58186/how-to-compile-mod-wsgi-on-mountain-lion-by-fixing-apxserror-command-failed-w)


----------
2.2. workers.properties 작성
-----------
etc/apache2/extra/workers.properties
#
# The workers that jk should create and work with
#
worker.list=worker1

#
# Defining a worker named ajp13 and of type ajp13
# Note that the name and the type do not have to match.
#
worker.ajp13.type=worker1
worker.ajp13.host=localhost
worker.ajp13.port=8009
-------------
3. httpd-vhosts.conf 설정
etc/apache2/extra/httpd-vhosts.conf

###########start
# Load mod_jk module
# Update this path to match your modules location
LoadModule jk_module libexec/apache2/mod_jk.so
# Where to find workers.properties
# Update this path to match your conf directory location (put workers.properties next to httpd.conf)
JkWorkersFile /etc/apache2/workers.properties
# Where to put jk shared memory
# Update this path to match your local state directory or logs directory
JkShmFile /var/log/apache2/mod_jk.shm
# Where to put jk logs
# Update this path to match your logs directory location (put mod_jk.log next to access_log)
JkLogFile /var/log/apache2/mod_jk.log
# Set the jk log level [debug/error/info]
JkLogLevel info
# Select the timestamp log format
JkLogStampFormat "[%a %b %d %H:%M:%S %Y] "

# Send everything for context /example to worker named ajp13

#
# Virtual Hosts
#
# If you want to maintain multiple domains/hostnames on your
# machine you can setup VirtualHost containers for them. Most configurations
# use only name-based virtual hosts so the server doesn't need to worry about
# IP addresses. This is indicated by the asterisks in the directives below.
#
# Please see the documentation at
# <URL:http://httpd.apache.org/docs/2.2/vhosts/>
# for further details before you try to setup virtual hosts.
#
# You may use the command line option '-S' to verify your virtual host
# configuration.

#
# Use name-based virtual hosting.
#
NameVirtualHost *:80

#
# VirtualHost example:
# Almost any Apache directive may go into a VirtualHost container.
# The first VirtualHost section is used for all requests that do not
# match a ServerName or ServerAlias in any <VirtualHost> block.
#
<VirtualHost *:80>
        ServerAdmin admin@beautyhub.co.kr
        DocumentRoot "/Users/jryeong/DEV/server/apache2/mobile"
        ServerName m.beautyhub2.co.kr
        ErrorLog "/Users/jryeong/DEV/server/logs/httpd/m.beautyhub2.co.kr.error.log"
        CustomLog "/Users/jryeong/DEV/server/logs/httpd/m.beautyhub2.co.kr.access.log" common
        <Directory "/Users/jryeong/DEV/server/apache2/mobile">
           Options None
           AllowOverride None
           Order allow,deny
           Allow from all
       </Directory>
</VirtualHost>

<VirtualHost *:80>
        ServerAdmin admin@beautyhub.co.kr
        DocumentRoot "/Users/jryeong/DEV/workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/beautyhub"
        ServerName api.beautyhub2.co.kr
        ErrorLog "/Users/jryeong/DEV/server/logs/httpd/api.beautyhub2.co.kr.error.log"
        CustomLog "/Users/jryeong/DEV/server/logs/httpd/api.beautyhub2.co.kr.access.log" common
        JkMount /* worker1
        JkUnMount /*.js worker1
        JkUnMount /*.css worker1
        JkUnMount /*.swf worker1
        JkUnMount /*.png worker1
        JkUnMount /*.gif worker1
        JkUnMount /*.ico worker1
       <Directory "/Users/jryeong/DEV/workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/beautyhub">
           Options None
           AllowOverride None
           Order allow,deny
           Allow from all
       </Directory>
 </VirtualHost>
##########end

4. hots 파일 설정
/etc/hosts
-----------
127.0.0.1       localhost
255.255.255.255 broadcasthost
127.0.0.1       m.beautyhub2.co.kr
127.0.0.1       api.beautyhub2.co.kr
::1             localhost
fe80::1%lo0     localhost
----------

5. m.beautyhub2.co.kr/index.html에 접속
권한 에러 나올 경우
폴더에 권한을 설정

6./etc/apache2/httpd.conf에서
httpd-vhosts.conf를 읽어들이도록 주석해제


7. 이클립스에서 테스트
    디플로이용 서버 추가시 http server 선택 후 디플로이 폴더 선택
/Users/jryeong/DEV/server/apache2




2012년 5월 7일 월요일

spring security SecurityContextHolder.getContext().getAuthentication()



VelostepUser user = (VelostepUser)SecurityContextHolder.getContext().getAuthentication().getPrincipal();

java.util.Collection<GrantedAuthority> auth = (java.util.Collection<GrantedAuthority>)SecurityContextHolder.getContext().getAuthentication().getAuthorities();

2012년 4월 18일 수요일

2012년 4월 15일 일요일

MySql 생성 및 갱신시에 자동 갱신 타이스탬프컬럼 만들기

http://www.kbedell.com/2009/03/07/how-to-create-a-timestampdatetime-column-in-mysql-to-automatically-be-set-with-the-current-time/


e.g.) 
ALTER TABLE sms_regular_msg_default MODIFY mod_date TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '수정일'

2012년 3월 13일 화요일

JQuery Validate add Method


jQuery.validator.addMethod(
“notEqualTo”,
function (value, element, param) {
return this.optional(element) || value != param.val();
},
“Please specify a different value”
);
and:

rules: {
oneCity: {
notEqualTo: $(‘#anotherCityId)’)
},
anotherCity: {
notEqualTo: $(‘#oneCityId’)
}
},

2012년 2월 21일 화요일

Target runtime GlassFish 3.1.1 is not defined.


Don't show the error message beneath on Eclipse Problems Pane.

Target runtime GlassFish 3.1.1 is not defined.

Project > Properties > Project Facets > Runtimes > uncheck

2012년 2월 19일 일요일

Kill Tomcat process at port 8080


Kill Tomcat process at port 8080

Occasionally the Tomcat server doesn't shutdown in a clean way when using Eclipse. What happens is that port 8080 stays in use and the server can't restart. Exiting Eclipse is not sufficient in this case and a restart of Mac OSX is needed.

So, how to kill the running Tomcat and free port 8080.
Open the terminal window and execute the following commands.

  • sudo lsof -w -n -i tcp:8080
This will give you the pidnumber of the process that runs at 8080. You can then go ahead and kill it.


  • sudo kill -9 pidnumber

2012년 2월 17일 금요일

Eclipse “Errors occurred during the build. Errors running builder ‘JavaScript Validator’ on project ‘some-project’. java.lang.NullPointerException”


“Errors occurred during the build.
Errors running builder ‘JavaScript Validator’ on project ‘some-project’.
java.lang.NullPointerException”
At a first sight it seems that a Javascript validator is throwing a NullPointerException, so probably you will try to disable ‘Client-side Javascript’ validation from Project->Properties->Validation… but I tell you that the problem is not there, you must go to Project->Properties->Builders then disable ‘Javascript Validator’.
Problem solved. Indeed is not a real problem, but the message is a bit annoying because it happens in every build so….

2012년 1월 16일 월요일

개발 진행

1. 기능정리
2. 목업
3. DB설계
4. 개발준비
4.1. 프레임워크 구성
4.2. 메시지번들
4.2. 보안
5. 개발

2012년 1월 6일 금요일

스프링 시큐리티 용 e.g) applicationContext-security.xml 는 ContextLoaderListener를 이용해 등록

스프링 시큐리티 용 e.g) applicationContext-security.xml 는 ContextLoaderListener를 이용해 등록 해줘야 한다. 앙그러면 no webApplicationContext 어쩌구 저쩌구 에러 난다.

<context-param>    
    <description>The Spring configuration files.</description>     
    <param-name>
        contextConfigLocation
    </param-name>     
    <param-value>/WEB-INF/spring/applicationContext-*.xml</param-value> 
</context-param>  

<listener>     
    <description>The Spring context listener.</description>     
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class> </listener>

2012년 1월 2일 월요일

맥에서 subclipse 사용하기

1. 이클립스에서 subclipse 1.8.x 다운로드
2. http://www.wandisco.com/subversion/download#osx 에서 subclipse 라이브러리 다운로드 후 설치
(Subversion-1.7.2_10.7.x.pkg)