Mac2015. 1. 29. 11:14

터미널에서 아래 입력


# defaults write com.apple.Safari IncludeDebugMenu 1


사파리 브라우져 다시 열기


상단 메뉴 "개발자용" 생김.

'Mac' 카테고리의 다른 글

MAC 가상호스트(VirtualHost) 설정  (0) 2014.02.28
[Sequel Pro] 단축키  (0) 2013.09.27
Mac OS X lion 에 APM 구축  (0) 2013.09.04
Mac에서 hosts파일 수정  (0) 2013.04.26
Posted by E.No
Linux2014. 11. 26. 17:07

# 리눅스 서버 root 비밀번호시 변경시에 체크를 위해 사용함.


# 패스워드가 입력된 파일이 있는지 확인 

# find . -name "*" -exec grep "검색어" {} \; 1> 로그저장파일.txt 2>&1 &

'Linux' 카테고리의 다른 글

CentOS pear,soap 설치  (0) 2014.05.07
CentOs NFS설정  (0) 2014.03.20
CentOS 6.3 APM설치  (0) 2014.02.28
[급펌] CentOS memcach 설치  (0) 2013.06.24
[Linux] ssh 디렉터리 삭제. 안지워지고 에러날때??  (0) 2013.05.23
Posted by E.No
Magento2014. 6. 12. 02:13

마젠토 관련해서 수정하다가 한국에선 검색어가 너무 없어 포스팅한다.


구글링해보면 PHP를 수정하는 방법에 대해서는 무수히 나오는데..


1) /app/code/core/Mage/Core/Model/Store.php


public function roundPrice($price)

{

//return round($price, 2); 

return round($price0);    //변경

}



2) /lib/Zend/Currency.php


protected $_options = array(

'position'  => self::STANDARD,

      'script'    => null,

      'format'    => null,

      'display'   => self::NO_SYMBOL,

      //'precision' => 2,

      'precision' => 0,    //변경

      'name'      => null,

      'currency'  => null,

      'symbol'    => null,

      'locale'    => null,

      'value'     => 0,

      'service'   => null,

      'tag'       => 'Zend_Locale'

);



3) /app/code/core/Mage/Directory/Model/Currency.php


public function format($price, $options = array(), $includeContainer = true, $addBrackets = false)

{

//return $this->formatPrecision($price, 2, $options, $includeContainer, $addBrackets);

return $this->formatPrecision($price, 0$options$includeContainer$addBrackets);    //변경

}


4) /app/code/core/Mage/Core/Helper/Data.php


public function formatPrice($price, $includeContainer = true)

{

//return Mage::app()->getStore()->formatPrice($price, $includeContainer);

$temp = Mage::app()->getStore()->formatPrice($price$includeContainer); //변경

return preg_replace("/.00/","",$temp); //쓸모없는짓임.. ;;

}



등등 가지가지 방법들이 아주 많다. 그런데 사실 위의 모든 부분을 변경해보면 알겠지만 의미가 없다..


PHP에서 변수를 변경해서 뿌려보면 알겠지만 결국엔 생성된 값뒤에 .00 가 붙게된다.



문제는 결국 화면에 뿌려지기 직전(아직 어느단계가 마지막인지 모르겠다..OTL), 또는 화면에 뿌려지면서 추가되는것으로 보여진다.


그렇게 최종 변경한 방법은 아래와 같다.


5) /lib/Zend/Locale/Data/ko.xml


currencyFormats > currencyFormatLength > currencyFormat > pattern > ¤#,##0.00 부분에서 .00 만 빼주면 된다.

(역시 화면에 뿌려질때였다.)


<currencyFormats>

<currencyFormatLength>

<currencyFormat>

<pattern>¤#,##0</pattern>

</currencyFormat>

</currencyFormatLength>

<unitPattern count="other">{0} {1}</unitPattern>

</currencyFormats>




결과적으론 5)/lib/Zend/Locale/Data/ko.xml 만 수정해도 소수점을 삭제 할 수 있다.

다만, 서비스시 문제가 발생하지 않는지 의문이 든다.(PHP수정을 함께 한다면 단편적인 문제는 없을것같다는 생각이 들지만.. 오버라이딩을 하지 않았을때의 문제는 아직 하나도 모르겠다.- 오버라이딩 방법도..OTL )


이 부분에 대해서는 좀더 확인 후 추가 하도록 하자.








Posted by E.No
Linux/PHP2014. 5. 8. 19:49

php에서 soap 통신을 하기위하여 앞서 php-soap 를 설치하고 

검색을 통해서 알게된 사실이다. 


정확하게 인지한것인지는 모르겠지만.. (만약 잘못된 정보라면 알려주시면 감사드립니다.)


php-4.* 버젼에서는 soap기본지원이 되지 않고 php5.*버젼에서 기본 지원하기때문에 nusoap라는 클래스가 

양쪽 모두 사용가능하여 php soap 통신을 위하여 가장 많이 쓰이며, 간편한 라이브러리라고 한다.


여튼 나는 nusoap클래스를 사용하여 서버, 클라이언트를 테스트 해보았고,

잘 되는것을 확인 하였다.


우선 아래는 찾아봤던 내용의 링크이다.

nusoap 다운로드)

- http://sourceforge.net/projects/nusoap/


예제 )

- http://stackoverflow.com/questions/9130117/nusoap-simple-server

- http://patelmilap.wordpress.com/2011/09/01/soap-simple-object-access-protocol/


soap 관련 설명등)

- http://www.welog.net/gbbs/bbs/board.php?bo_table=php&wr_id=186 (예제)

- http://www.welog.net/gbbs/bbs/board.php?bo_table=php&wr_id=187 (개념)


# nusoap-server.php


$root = $_SERVER["DOCUMENT_ROOT"];

require_once($root.'/Lib/Class/nusoap/nusoap.php');

$server = new soap_server;

$strURL = "www.testNuSoap.com"; #네임스페이스 지정을 해주는것인데 사실 왜 해주는것인지 정확히 모르겠다..

$strNameSpace = $strURL."?wsdl";

$server->configureWSDL("testnusoap",$strNameSpace); //wsdl 생성

$server->register('hello_func',array("name"=>"xsd:string"),array("return"=>"xsd:string")); //함수 등록

# 함수를 등록할때 어는곳에서는 $server->register('hello_func'); 이렇게만 지정을 한다.

# 나의 경우 뒤에 배열 옵션들은 받는 인수, 리턴될 값에 대한 타입을 지정해줬다. 

# 이렇게 하지 않으면 출력이 안되더라.. 왜지?


function hello_func($name){

//  에러시 falt 메시지 전달

    if($name == ''){

    return new soap_fault('Client','','Must supply a valid name.');

    }

    return "hello ".$name;

}

$server->service($HTTP_RAW_POST_DATA);




# nusoap-client.php


ini_set("soap.wsdl_cache_enabled", "0");

$root = $_SERVER["DOCUMENT_ROOT"];

require_once($root.'/Lib/Class/nusoap/nusoap.php');

try{

## 서버 server.php 의 URL을 넘겨줌

$strServerURL = "http://192.168.30.24/soap/nusoap-server.php?wsdl"

$soapclient = new soapclient($strServerURL);

## 서버에서 실행할 함수호출

$parameters = urlencode("Eno");

$result = $soapclient->hello_func($parameters);

echo urldecode($result);

}catch(SoapFault $exception){

echo $exception->getMessage();

}



# 결과 


hello Eno



위 소스는 server.php 에서 wsdl을 생성, client.php에서 해당 내용을 읽어 server.php의 함수를 사용하는것. 이게 주된 내용이다.


nusoap를 사용하기 이전에 php.net에 나와있는것처럼 

SoapServer, SoapClient 클래스를 사용하여 테스트를 했을때는 아래와 같았다.



# soap-server.php


function printString($nCode)

{

if($nCode == "1")

{

return "1입력";

}else{

return "그외 입력됨.";

}

}

 

try {

$server = new SOAPServer(NULL,array('uri' => 'http://192.168.30.24/soap/soap-server.php'));

 

$server->addFunction("printString");

$server->handle();

}catch(SOAPFault $f){

print $f->faultstring;

}



# soap-client.php


$client = new SoapClient(null, array('location' => "http://192.168.30.24/soap/soap-server.php",'uri' => "http://192.168.30.24/soap/soap-server.php"));

echo $return = $client->__soapCall("printString",array("1"));



# 결과

1입력



결국 두개다 server.php에서 선언된 함수 사용이 가능했다.

확인은 했지만.. 실제 적용을 해야하는데 개념이 잘 안잡힌다. OTL 


업무를 진행하고나서 이번 포스트에는 수정해야 할 내용이 많을것같다.


이상 여튼 soap사용법은 이러하다.



Posted by E.No
Linux2014. 5. 7. 16:21

검색을 하다보니까 pear 이 기본설치가 되어있다.. 안되어있다 등등(포트팅 날짜를 확인하지 않은 내 죄 니라..)

여튼 pear 설치 방법도 여러가지가있고..


괜히 겁먹고 검색하는데 시간을 너무 많이 허비했다.


CentOS에서는 간단하다. (역시 yum설치가 최고..!)

yum으로 APM설치를 했을 경우,


# yum -y install php-pear*

# yum -y install php-soap

# service httpd restart 


이상 phpinfo 에서 soap가 enabled되어 있는것을 확인 할 수 있다.


soap통신 사용에 대해서는 일단 진행후에.. 간략히 남겨놓도록 하자.!

'Linux' 카테고리의 다른 글

linux 특정문자가 있는 파일 확인  (0) 2014.11.26
CentOs NFS설정  (0) 2014.03.20
CentOS 6.3 APM설치  (0) 2014.02.28
[급펌] CentOS memcach 설치  (0) 2013.06.24
[Linux] ssh 디렉터리 삭제. 안지워지고 에러날때??  (0) 2013.05.23
Posted by E.No
Linux2014. 3. 20. 16:59

파일서버 구축하다가 필요해서...


일단 CnetOs 에는 설치시에 기본적으로 nfs가 설치된다고 하니 굳이 설치하지 않아도 된다.


nfs설치 확인 

# rpm -qa nfs-utils 

nfs-utils-1.2.3-36.el6.x86_64



만약 설치되지 않았다면 yum을 이용해 설치해주자.

# yum -y install nfs-utils



설치가 되었다면 큰 맥락은 아래와 같다.


- 서버

1) /etc/exports 에 설정 정보입력

2) nfs 서비스 시작


- 클라이언트

1) 공유 디렉터리 마운트


@ 여기까지만 해도 사용 할 수는 있다.


- 그 외 사항 

1) 방화벽에서 nfs서비스의 Port를 차단 할 경우 iptables에 정책 추가

2) 서버가동시 nfs가 자동실행되도록 서비스를 등록하자.

3) 서버가동시 공유디렉토리가 영구 설정되도록 /etc/fstab 파일을 편집.





서버와 클라이언트에서 세부 사항은 아래와같이 진행하지.


- 서버

1) /etc/exports 에 설정 정보입력


# vi /etc/exports 


/[공유디렉터리] [접속허용서버IP]([옵션],[옵션],..)


ex) /Upload xxx.xxx.xxx.xxx(rw,sync) -> 여기 rw 옵션은 읽기,쓰기 가능하게.. sync는 뭐 싱크 뭐시기이겠지..?;;


위 처럼 추가해주자!







2) nfs 서비스 시작


서비스 시작은 다른 서비스를 시작하는것과 마찬가지로.

# service nfs start 





- 클라이언트

1) 공유 디렉토리 마운트


마운트 역시는 아래 명령어처럼..


# mount [서버IP]:[공유경로] [공유경로(마운트디렉토리]]


@아참.. 마운트 전에 디렉토리 부터 생성해야한다.. 


# mkdir [마운트디렉토리]



ex) 

# mkdir /Upload

# mount xxx.xxx.xxx.xxx:/Upload /Upload


@ 나같은 경우에 공유,마운트 디렉토리를 절대경로로 하지 않았더니 에러가 발생했다.   mount 시에 절대경로를 꼭 사용해야하는지는 잘 모르겠음.... ㅡ,.ㅡ




이렇게 하면 일단 이미지서버의 디렉토리가 공유된다.



- 그 외 사항에 대해서는 간략하게!..


1) 방화벽에서 nfs서비스의 Port를 차단 할 경우 iptables에 정책 추가

이쪽에 대해서는 http://hmgirl.tistory.com/152 여기 주인장분이 정리를 잘 해 주셨다...


2) 서버가동시 nfs가 자동실행되도록 서비스를 등록하자.

# chkconfig --level 2345 nfs on


3) 서버가동시 공유디렉토리가 영구 설정되도록 /etc/fstab 파일을 편집.

# vi /etc/fstab

xxx.xxx.xxx.xxx:/Upload /Upload    nfs    hard    0 0  #추가!


- fstab 수정 후 netfs 활성화


# chkconfig --level 35 netfs on



이상 끝.



'Linux' 카테고리의 다른 글

linux 특정문자가 있는 파일 확인  (0) 2014.11.26
CentOS pear,soap 설치  (0) 2014.05.07
CentOS 6.3 APM설치  (0) 2014.02.28
[급펌] CentOS memcach 설치  (0) 2013.06.24
[Linux] ssh 디렉터리 삭제. 안지워지고 에러날때??  (0) 2013.05.23
Posted by E.No
즐겨찾기2014. 3. 11. 13:55

http://css-tricks.com/perfect-full-page-background-image/




html { background: url(images/bg.jpg) no-repeat center center fixed; -webkit-background-size: cover; -moz-background-size: cover; -o-background-size: cover; background-size: cover; }

'즐겨찾기' 카테고리의 다른 글

리눅스 명령어 모음  (0) 2013.12.30
CentOS 6.3 APM setup  (0) 2013.11.20
[PHP] 웹상의 파일읽기  (0) 2013.10.30
정규식  (0) 2013.08.27
Posted by E.No
Mac2014. 2. 28. 18:42



1. sudo vi /private/etc/apache2/httpd.conf (파일을 연다)

 

2. Include /private/etc/apache2/extra/httpd-vhosts.conf (해당 문자의 주석을 풀어준다 ' # ' 제거)

 

3. esc > / > wq > enter (vi 편집기 저장하고 나온다.)

 

4. sudo vi /private/etc/apache2/extra/httpd-vhosts.conf  (파일을 연다)


5. VirtualHost 추가


6. hosts수정


7.아파치 재시작 


참고 : http://blog.naver.com/namkwon84?Redirect=Log&logNo=202955755



'Mac' 카테고리의 다른 글

safari 디버깅 모드 열기  (0) 2015.01.29
[Sequel Pro] 단축키  (0) 2013.09.27
Mac OS X lion 에 APM 구축  (0) 2013.09.04
Mac에서 hosts파일 수정  (0) 2013.04.26
Posted by E.No
Linux2014. 2. 28. 11:59

정리해두었던 문서도 있지만 


제일 깔끔하게 정리해놓으신것같아 참조.


http://want2u.tistory.com/11


굳.


추가로 vsftpd 와 ssh도 설치해주면 기본적인 세팅은 끝난듯.


vsftpd

# yum -y install vsftpd 

# chkconfig --level 2345 vsftpd on

# service vsftpd start 


sshd

# yum -y install openssh-server openssh-clients openssh-askpass 

# chkconfig --level 2345 sshd on

# service sshd start 



'Linux' 카테고리의 다른 글

linux 특정문자가 있는 파일 확인  (0) 2014.11.26
CentOS pear,soap 설치  (0) 2014.05.07
CentOs NFS설정  (0) 2014.03.20
[급펌] CentOS memcach 설치  (0) 2013.06.24
[Linux] ssh 디렉터리 삭제. 안지워지고 에러날때??  (0) 2013.05.23
Posted by E.No
DB/MySQL2014. 2. 19. 11:34

import

mysql -u[아이디] -p [데이터베이스명] < [SQL파일경로]


export

mysqldump -u[아이디] -p [옵션] [데이터베이스명] > [SQL파일경로]



화살표 때문에 자꾸 헤깔려서... 진짜 생각없이 일하고있군... OTL

Posted by E.No