2016년 5월 18일 수요일

forever 로그 파일 관리


오래된(오래된은 알아서 조절하라) 벡업 파일은 삭제한다.

$ find ./*.log -mtime +7 -exec rm -f {} \;

Log 파일은 초기화 시킨다.

$ cat /dev/null > forever.log


2016년 5월 9일 월요일

ubuntu rsync aws 사용방법


sudo rsync -avL --progress -e "ssh -i /path/to/auth.pem" --log-file=/var/log/rsyncd.log ~/wwwhome/ ubuntu@ip:/home/ubuntu/wwwhome


2016년 4월 8일 금요일

bxslider ios웹뷰에서 스크롤과 동시에 슬라이드할때 멈춤(freezes) 현상 해결!

bxslider 는 슬라이드 애니메이션 동작할때 css translate3d 와 jquery animate를 사용한다.

ios webview 에서는 translate3d 를 지원하므로 css 로 애니메이션이 동작을 하는데, 애니메이션이 끝나면 transitionend 이벤트가 실행이 되고 slider.working = false; 가 되면서 애니메이션이 끝난다.

그런데 스크롤을 함과 동시에 이미지를 넘기면 transitionend 가 실행이 안되고 slider.working 은 계속 ture상태로 남게되면서 bxslider는 더이상 동작하지 않는다.

이 문제를 해결하기 위해서 transitionend 가 발생하지 않으면 slider.working = false; 를 실행시키기 위해 소스를 수정해보았다.

jquery.bxslider.js 를 열어서

var setPositionProperty = function(value, type, duration, params){

이 부분을 찾은다음

// set the property value
el.css(slider.animProp, propValue);

css 속성을 세팅하는 부분 아래에다가

// ios에서 스크롤하면서 작동하면 transitionend 이벤트가 안먹혀서 추가함 by starkey
var dummy = setTimeout(function(){
    slider.working = false;
}, duration+1);
// -->

를 추가하고,

정상적으로 transitionend 가 발생했을대 clearTimeout 을 해준다.

el.bind('transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd', function(){
   clearTimeout(dummy); // transitionend 가 동작하면 clearTimeout 해줌
   // unbind the callback
   el.unbind('transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd');
   updateAfterSlideTransition();
});

2016년 3월 11일 금요일

폴더내 euc-kr 파일 utf-8 변환

for I in ./*.txt ; do iconv -c -f euc-kr -t utf-8 $I > $I.tmp && mv $I.tmp $I ; done

2016년 2월 14일 일요일