2017년 6월 11일 일요일

[WEB] PHP 환경 설정 변경(개발과정) - Error Display & Opcache

개발과정에서 Coding Error 및 빠른 업데이트를 위해 설정을 변경하자

php.ini 파일의 display_errors 화 opcache 옵션을 변경한다.
설정을 변경한 후에는 Apache Web Server를 Restart 해 줘야 변경사항을 적용된다.

상용버전에서는 Development 옵션은 지양한다.

; This directive controls whether or not and where PHP will output errors,
; notices and warnings too. Error output is very useful during development, but
; it could be very dangerous in production environments. Depending on the code
; which is triggering the error, sensitive information could potentially leak
; out of your application such as database usernames and passwords or worse.
; For production environments, we recommend logging errors rather than
; sending them to STDOUT.
; Possible Values:
;   Off = Do not display any errors
;   stderr = Display errors to STDERR (affects only CGI/CLI binaries!)
;   On or stdout = Display errors to STDOUT
; Default Value: On
; Development Value: On
; Production Value: Off
; http://php.net/display-errors
display_errors = On

[opcache]
zend_extension=php_opcache.dll
; Determines if Zend OPCache is enabled
; opcache.enable=1 -> 0 // 수정 즉시 반영되도록 설정
opcache.enable=0

[Ubuntu] Warning sudo: unable to resolve host

Ubuntu 설치 후 hostname을 /etc/hostname 파일만 변경한 경우, 아래와 같은 warning 문구가 표시된다.
Warning 제거는 hosts 파일(/etc/hosts) 에 변경된 hostname을 추가해 준다.

** warning message : sudo : unable to resolve host

원인 : /etc/hostname 에 적용된 hostname 이 /etc/hosts 파일에 등록되어 있지 않음.
대책 : /etc/hosts 파일에 변경된 hostname 추가

2017년 2월 3일 금요일

[Ubuntu] warning message 처리 (sudo : unable to resolve host)


Ubuntu 설치 후 hostname을 /etc/hostname 파일만 변경한 경우, 아래와 같은 warning 문구가 표시된다.

[ warning message ]
-  sudo : unable to resolve host

원인 : /etc/hostname 에 적용된 hostname 이 /etc/hosts 파일에 등록되어 있지 않음.
대책 : /etc/hosts 파일에 변경된 hostname 추가

$ sudo vi /etc/hostname
127.0..0.1 [HOSTNAME]  <-- [HOSTNAME] : 실제 hostname

2016년 8월 24일 수요일

[KERNEL] make menuconfig error - resolve

[KERNEL] make menuconfig error - resolve 

#kernel #menuconfig

OS

  • ubuntun 12.04 LTS

Resolve 
  • $ sudo apt-get install lib32ncurses5-dev

Error Log

$ make menuconfig [enter]
scripts/kconfig/lxdialog/menubox.o: In function `do_scroll':
menubox.c:(.text+0x55): undefined reference to `wrefresh'
scripts/kconfig/lxdialog/menubox.o: In function `print_arrows':
menubox.c:(.text+0x1a4): undefined reference to `wrefresh'
scripts/kconfig/lxdialog/menubox.o: In function `do_print_item':
menubox.c:(.text+0x3a9): undefined reference to `wrefresh'
scripts/kconfig/lxdialog/menubox.o: In function `print_buttons':
menubox.c:(.text+0x4b1): undefined reference to `wrefresh'
collect2: ld returned 1 exit status
make[1]: *** [scripts/kconfig/mconf] Error 1
make: *** [menuconfig] Error 2

Android 7.0 Nougat 소스인출

Android 7.0 Nougat source 코드가 올라왔다.

Branch 확인하고 소스인출까지 1시간 30분 정도 소요된 듯..
- https://android.googlesource.com/platform/manifest

$ curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
$ chmod +x ~/bin/repo 

$ mkdir android-7.0.0_r1
$ cd android-7.0.0_r1/

$ git config --global user.name "Wonseok.Choi"
$ git config --global user.emali "soma.wschoi@gmail.com"

$ repo init -u https://android.googlesource.com/platform/manifest
$ repo init -u https://android.googlesource.com/platform/manifest -b android-7.0.0_r1
$ repo sync

#android #nougat #repo

2014년 7월 27일 일요일

[Android] Stop Audio Player

Stop Audio Player 


        Intent intent = new Intent("com.android.music.musicservicecommand");
        intent.putExtra("command", "pause");

        mContext.sendBroadcast(intent);


MediaPlaybackService commands


 public class MediaPlaybackService extends Service {

     public static final String PLAYSTATE_CHANGED = "com.android.music.playstatechanged";
     public static final String META_CHANGED = "com.android.music.metachanged";
     public static final String QUEUE_CHANGED = "com.android.music.queuechanged";

     public static final String SERVICECMD = "com.android.music.musicservicecommand";
     public static final String CMDNAME = "command";
     public static final String CMDTOGGLEPAUSE = "togglepause";
     public static final String CMDSTOP = "stop";
     public static final String CMDPAUSE = "pause";
     public static final String CMDPLAY = "play";
     public static final String CMDPREVIOUS = "previous";
     public static final String CMDNEXT = "next";
     public static final String TOGGLEPAUSE_ACTION = "com.android.music.musicservicecommand.togglepause";
     public static final String PAUSE_ACTION = "com.android.music.musicservicecommand.pause";
     public static final String PREVIOUS_ACTION = "com.android.music.musicservicecommand.previous";
     public static final String NEXT_ACTION = "com.android.music.musicservicecommand.next";

2014년 5월 1일 목요일

[Android] Stop Running Task.

Sleep mode 진입 시 구동중인 Application을 정리(중지)
- Sleep / Wake Up 반복시 Task 쌓이는 현상을 피하기 위해 사용.


1. Stop Running Application

    private void stopExecutedApplication() {
        mRunningTaskInfo = mActivityManager.getRunningTasks(Integer.MAX_VALUE);

        for(int i = 0; i < mRunningTaskInfo.size(); i++) {
            int taskId = mRunningTaskInfo.get(i).id;
            String pkgName = mRunningTaskInfo.get(i).baseActivity.getPackageName();
            mActivityManager.removeTask(taskId, ActivityManager.REMOVE_TASK_KILL_PROCESS);
         }
     }