admin

336x280(권장), 300x250(권장), 250x250, 200x200 크기의 광고 코드만 넣을 수 있습니다.

출처:http://kmug.co.kr/board/zboard.php?id=guide&no=1514

⌘ - command, apple        
⇪ - caps lock
⌥ - option, alt        
⏏ - eject
⌃ - control        
↖ - home
⇧ - shift        
↘ - end
↩ - return        
⇞ - page up
⌤ - enter        
⇟ - page down
⌫ - delete (backspace)        
⇥ - tab
⌦ - delete (delete)        
⌧ - clear

'W.OS > Mac' 카테고리의 다른 글

Mac Terminal에서 alias 설정  (0) 2013.08.24
Mac 32bit 64bit 구분법  (0) 2013.08.23
Mac 듀얼모니터에서 주에서 보조 모니터로 Dock이동  (1) 2013.08.23
MAC OS X키보드 단축키  (0) 2013.08.23

336x280(권장), 300x250(권장), 250x250, 200x200 크기의 광고 코드만 넣을 수 있습니다.

리눅스 종류 ,버젼 배포판 확인하기

방법1

rpm -qa *-release


Centos 6.2

[root@jmnote ~]# rpm -qa *-release
centos-release-6-2.el6.centos.7.x86_64


Fedora

[root@jmnote ~]# rpm -qa *-release
fedora-release-11-1.noarch


방법2

/etc/*-release

ll /etc/*-release
cat /etc/*-release | uniq


방법3

cat /etc/issue
  • 배포판의 버전을 가장 쉽게 확인할 수 있는 방법이다.
  • 보안 등의 이유로 다른 내용으로 바뀌어 있는 경우도 있다.

커널 버전 확인

uname -r



'1.Linux' 카테고리의 다른 글

ubuntu mysql 설치 및 설정하기.  (1) 2014.10.15
ubuntu tomcat 설치  (0) 2014.10.15
ubuntu jdk1.6설치  (0) 2014.10.15
ubuntu subversion  (0) 2014.10.15
ubuntu 터미널 단축 아이콘  (0) 2014.10.15

336x280(권장), 300x250(권장), 250x250, 200x200 크기의 광고 코드만 넣을 수 있습니다.

eclispe tomcat 서비스 시작시 타임아웃에러 문제 해결

Server Tomcat v6.0 Server at steveMacBookAir.local was unable to start within 40 seconds. If the server requires more time, try increasing the timeout in the server editor.


tomcat v.6.0 Server 서버르 떠블 클릭하여 서버 설정을 연다.

Timeouts 하위 항목에서 Start(in seconds)를 늘려 준다.


336x280(권장), 300x250(권장), 250x250, 200x200 크기의 광고 코드만 넣을 수 있습니다.

cordova cordova-plugin-admob plugin을 사용하여 애드몹광고하기

1). admob 가입하기

http://kr.admob.com/my_sites/ 사이트에 회원 가입 후 "사이트 및 앱"을 선택 후 사이트 및 앱 추가를 클릭 한다.


앱을 추가 한다. 

App Store URL : https://itunes.apple.com/app/id + Apple ID

App Store URL : https://itunes.apple.com/app/id + Apple ID

Apple ID : Itunes Connect에서 확인 .


정보를 다 입력 했으면 계속을 클릭하여 저장 한다.

최종 등록이 완성된 화면이다 .


설정관리를 클릭하여 publisherId(게시자ID)를 확인한다.


publisherId에 게시자 ID를 입력한다.


2) plugin 설치하기(https://github.com/aliokan/cordova-plugin-admob)

  해당 프로젝트의/platform으로 이동 

  cordova plugin add https://github.com/aliokan/cordova-plugin-admob.git   

설치확인.

config.xml

    <feature name="AdMobPlugin">

        <param name="ios-package" value="AdMobPlugin" />

    </feature>

www/cordova_plugin.j

{

        "file": "plugins/com.google.cordova.plugin.AdMobPlugin/www/AdMobPlugin.js",

        "id": "com.google.cordova.plugin.AdMobPlugin.AdMob",

        "clobbers": [

            "window.admob"

        ]

    }

plugin 확인

AdMobPlugin.js확인


  admob SDK를 설치할 필요가 없다 plugin에 포함이 되어있다.

Project에서 설정


3) Xcode 설정

Libraries 설정

  Proejct > Build Phases > Link Binary With Libraries 을 열어 "  Ad Support.framework"를 추가 해 준다.





https://github.com/aliokan/cordova-plugin-admob/blob/master/Example/index.js를 참조하여 

코드를 수정 후 테스트 해보자.

336x280(권장), 300x250(권장), 250x250, 200x200 크기의 광고 코드만 넣을 수 있습니다.

앱 이름 변경하기

IOS에서 표시되는 앱의 이름을 변경 함


Project > Build Settings > Packaging > Product Name 을 변경


변경후 다시 실행하면 아래와 같이 이름이 변경된 것을 확인 할 수 있음.



336x280(권장), 300x250(권장), 250x250, 200x200 크기의 광고 코드만 넣을 수 있습니다.

iOS 7, PhoneGap and the Status Bar 

폰갭(코도바)이 IOS 7에서 status bar 가 겹치는 현상 해결..



(원문)-http://www.kadrmasconcepts.com/blog/2013/10/06/ios-7-phonegap-and-the-status-bar/

1. cordov3.1.0으로 업데이트

cd ~/my_project_directory




2. Xcode에서 status Bar 설정

  Project > Resources > -info.plist를 열어 아래와 같이 수정 합니다.


"+" 기호를 클릭하여 아래와 같이 

key: Status bar is initially hidde

value: YES

key: View controller-based status bar appearance

value: No

를 추가 해준다.


이렇게 한다음 확인 하면  IOS 7의 status Bar가 사라진것을 확인 할 수 있다.



my

336x280(권장), 300x250(권장), 250x250, 200x200 크기의 광고 코드만 넣을 수 있습니다.

Mac(맥)오른 쪽 마우스 설정하기

1. 마우스의 환경 설정 열기


2. 보조클릭을 선택 


아주 간단하다. ㅠㅠ..

'기타 > Mac' 카테고리의 다른 글

USB NTFS 외장하드 쓰기  (0) 2013.08.30
MAC 단축아이콘 정리  (0) 2013.08.28
Mac 개발자를 위한 잡다한 지식 정리.  (0) 2013.08.27

336x280(권장), 300x250(권장), 250x250, 200x200 크기의 광고 코드만 넣을 수 있습니다.

sudo vi /usr/local/mysql/my.cnf

 하단에 아래의 내요을 추가 한다.

# For advice on how to change settings please see

# http://dev.mysql.com/doc/refman/5.6/en/server-configuration-defaults.html


[mysqld]


# Remove leading # and set to the amount of RAM for the most important data

# cache in MySQL. Start at 70% of total RAM for dedicated server, else 10%.

# innodb_buffer_pool_size = 128M


# Remove leading # to turn on a very important data integrity option: logging

# changes to the binary log between backups.

# log_bin


# These are commonly set, remove the # and set as required.

# basedir = .....

# datadir = .....

# port = .....

# server_id = .....

# socket = .....


# Remove leading # to set options mainly useful for reporting servers.

# The server defaults are faster for transactions and fast SELECTs.

# Adjust sizes as needed, experiment to find the optimal values.

# join_buffer_size = 128M

# sort_buffer_size = 2M

# read_rnd_buffer_size = 2M

sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES

#-- 내요추가 시작 -- 

[mysql]

default-character-set = utf8


[client]

default-character-set = utf8


[mysqld]

character-set-client-handshake=FALSE

init_connect="SET collation_connection = utf8_general_ci"

init_connect="SET NAMES utf8"

character-set-server = utf8

collation-server = utf8_general_ci


[mysqldump]

default-character-set = utf8

#-- 내요추가 끝 -- 


종료 후 서버를 재시작..

> /usr/local/mysql/bin/mysql -uroot -p

mysql 접속후 status를 입력하여 utf8롤 설정되어있는지 확인한다.

mysql> status

--------------

/usr/local/mysql/bin/mysql  Ver 14.14 Distrib 5.6.13, for osx10.7 (x86_64) using  EditLine wrapper


Connection id: 11

Current database:

Current user: root@localhost

SSL: Not in use

Current pager: stdout

Using outfile: ''

Using delimiter: ;

Server version: 5.6.13 MySQL Community Server (GPL)

Protocol version: 10

Connection: Localhost via UNIX socket

Server characterset: utf8

Db     characterset: utf8

Client characterset: utf8

Conn.  characterset: utf8

UNIX socket: /tmp/mysql.sock

Uptime: 21 min 47 sec


Threads: 9  Questions: 405  Slow queries: 0  Opens: 132  Flush tables: 1  Open tables: 125  Queries per second avg: 0.309

--------------



336x280(권장), 300x250(권장), 250x250, 200x200 크기의 광고 코드만 넣을 수 있습니다.


 Cordova(3.0.6)  Apps 작성시 아래와 같이 텍스트 입력시 텍스트 박스를 키보드 위로 올릴기 설정하기

Proejct > res > xml > config.xml 을 열어

<preference name="fullscreen" value="false" /> 

fullscreen의 옵션을 true에서 fase로 변경하면 아래와같이 텍스트 입력시 키보드 입력 위로 올라 갑니다.


336x280(권장), 300x250(권장), 250x250, 200x200 크기의 광고 코드만 넣을 수 있습니다.

1. 사전준비

  1)필요한 키

     (1) client

           가). GCMIntentService Project_id OR Push Plugin의 Sender ID

           API Console의 project ID 

       

나). Register ID: Client에서 GCM Server로부터 발급 받은 Register ID ()

       (2)  Server

            가).   API Key

                    https://code.google.com/apis/console에서 발급받은 API Key


나). Client Reg ID(메세지를 받을 Client Register ID ==>)

 

2. https://code.google.com/apis/console 등록 

※ api Console 등록으로 알수얻을수 있는것

  Proejct ID : https://code.google.com/apis/console/#project:0000XXXXX

   #project 뒤부분의 0000XXXXX가 프로젝트  ID  이다.

         => Client에서 GCM Server로 등록시 사용.

  API Key :  GCM Service를 등록하여 받은 Key

             => GCM Server로 메세지 전송시 사용


1) https://code.google.com/apis/console에 접속 


2) Sercies를 클릭

3) Google Cloud Messaging for Android 클릭 



4) 동의가 완료되면 아래와 같이 On으로 표시 되어 있는것을 확인.

5) 그리고 다시 API Service를 클릭하면 아래와 같이 API Key가 발급된것을 확인 할 수 있음


4. GCM 개발환경 설정

1) GCM 관련 Plugin 설정

(1) android SDK가 설치된 Eclipse에서 Window > Android SDK Manager를 실행 합니다.

(2) Google Clound Messaging for Android를 선택하고 install packages..를 클릭.

(3) 설치가 완료되면 아래와 같이 Android SDK가 설치된 디렉토리 하위에 관련 jar파일이 생성된것을 확인 할 수 잇습니다.

gcm.jar를 Client로 복사하고

gcm-server.jar, json-simple-1.1jar를 서버 프로젝트로 복사하면 설정이 완료 됩니다. 


4. cordova Push plugin 설정

cordova prject생성한 디렉토리로 이동

cd /Users/myname/java/hybridweb/helloworld

1) Push Notification Plugin  추가

cordova plugin add https://github.com/phonegap-build/PushPlugin.git

2) device Plugin 추가

    cordova plugin add https://git-wip-us.apache.org/repos/asf/cordova-plugin-device.git

    vi platforms/android/AndroidManifest.xml을 열어

     <uses-permission android:name="android.permission.READ_PHONE_STATE" /> 이부분이 있는지 확인 하고 없으면 추가 합니다.


최종 AndroidManifest.xml의 내용

<?xml version='1.0' encoding='utf-8'?>

<manifest android:hardwareAccelerated="true" android:versionCode="1" android:versionName="1.0.0" android:windowSoftInputMode="adjustPan" package="com.example.helloworld" xmlns:android="http://schemas.android.com/apk/res/android">

    <supports-screens android:anyDensity="true" android:largeScreens="true" android:normalScreens="true" android:resizeable="true" android:smallScreens="true" android:xlargeScreens="true" />

    <uses-permission android:name="android.permission.INTERNET" />

    <application android:debuggable="true" android:hardwareAccelerated="true" android:icon="@drawable/icon" android:label="@string/app_name">

        <activity android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale" android:label="@string/app_name" android:name="HelloWorld" android:theme="@android:style/Theme.Black.NoTitleBar">

            <intent-filter>

                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />

            </intent-filter>

        </activity>

        <activity android:name="com.plugin.gcm.PushHandlerActivity" />

        <receiver android:name="com.plugin.gcm.CordovaGCMBroadcastReceiver" android:permission="com.google.android.c2dm.permission.SEND">

            <intent-filter>

                <action android:name="com.google.android.c2dm.intent.RECEIVE" />

                <action android:name="com.google.android.c2dm.intent.REGISTRATION" />

                <category android:name="com.example.helloworld" />

            </intent-filter>

        </receiver>

        <service android:name="com.plugin.gcm.GCMIntentService" />

    </application>

    <uses-sdk android:minSdkVersion="10" android:targetSdkVersion="18" />

    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />

    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />

    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />

    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />

    <uses-permission android:name="android.permission.CAMERA" />

    <uses-permission android:name="android.permission.VIBRATE" />

    <uses-permission android:name="android.permission.INTERNET" />

    <uses-permission android:name="android.permission.GET_ACCOUNTS" />

    <uses-permission android:name="android.permission.WAKE_LOCK" />

    <uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />

    <permission android:name="com.example.helloworld.permission.C2D_MESSAGE" android:protectionLevel="signature" />

    <uses-permission android:name="com.example.helloworld.permission.C2D_MESSAGE" />

    <uses-permission android:name="android.permission.READ_PHONE_STATE" />

</manifest>

3) PushNotification java file 확인

    ※ PushNotification을 설치 했을경우 com.plugin.gcm에 GCMIntentService.java이 생성되고

      PushNotification을 사용하지 않을 경우 com.example.helloworl에 GCMIntentService.java을 구현 해야 함. 

4) assets/www/PushNotification.js 화일을 확인후 없으면 찾아서 복사해줘야 함.

   

https://github.com/phonegap-build/PushPlugin/releases여기에서 최신버젼을 다운받아 설치 할 수도 있다.


5. Client Program

1). index.html

<!doctype html>

<html>

        <meta charset="UTF-8" name="viewport" content="width=device-width, initial-scale=1"> 

            <title>Windorado.com</title>

            <link rel="stylesheet" href="css/jquery.mobile-1.3.2.css" />

            <script src="js/jquery-1.9.1.js"></script>

            <script src="cordova.js"></script>

             <script src="PushNotification.js"></script>

            <script type="text/javascript">

            var pushNotification;

            function onDeviceReady() {

     try 

   

                    pushNotification = window.plugins.pushNotification;

                    if (device.platform == 'android' || device.platform == 'Android') {

    $("#app-status-ul").append('<li>registering android</li>');

                        pushNotification.register(successHandler, errorHandler, {"senderID":"894488614381","ecb":"onNotificationGCM"}); // required!

    } else {

    $("#app-status-ul").append('<li>registering iOS</li>');

                        pushNotification.register(tokenHandler, errorHandler, {"badge":"true","sound":"true","alert":"true","ecb":"onNotificationAPN"}); // required!

                    }

                    }

    catch(err) 

   

    txt="There was an error on this page.\n\n"

    txt+="Error description: " + err.message + "\n\n"

    alert(txt); 

   

                }

             // result contains any error description text returned from the plugin call

                function tokenHandler (result) {

                    $("#app-status-ul").append('<li>token: '+ result +'</li>');

                    // Your iOS push server needs to know the token before it can push to this device

                    // here is where you might want to send it the token for later use.

                }


                function successHandler (result) {

                    $("#app-status-ul").append('<li>success:'+ result +'</li>');

                }

                

                function errorHandler (error) {

                    $("#app-status-ul").append('<li>error:'+ error +'</li>');

                }

             // iOS

                function onNotificationAPN(event) {

                    if (event.alert) {

                        navigator.notification.alert(event.alert);

                    }


                    if (event.sound) {

                        var snd = new Media(event.sound);

                        snd.play();

                    }


                    if (event.badge) {

                        pushNotification.setApplicationIconBadgeNumber(successHandler, errorHandler, event.badge);

                    }

                }

                // Android

                        function onNotificationGCM(e) {

                

                            $("#app-status-ul").append('<li>EVENT -> RECEIVED:' + e.event + '</li>');


                            switch( e.event )

                            {

                                case 'registered':

                                if ( e.regid.length > 0 )

                                {

                                    $("#app-status-ul").append('<li>REGISTERED -> REGID:' + e.regid + "</li>");

                                    // Your GCM push server needs to know the regID before it can push to this device

                                    // here is where you might want to send it the regID for later use.

                                    console.log("regID = " + e.regid);

                                    //alert("regID = " + e.regid);

                                }

                                break;


                                case 'message':

                                    // if this flag is set, this notification happened while we were in the foreground.

                                    // you might want to play a sound to get the user's attention, throw up a dialog, etc.

                                    if (e.foreground)

                                    {

                                        $("#app-status-ul").append('<li>--INLINE NOTIFICATION--' + '</li>');


                                        // if the notification contains a soundname, play it.

                                        var my_media = new Media("/android_asset/www/"+e.soundname);

                                        my_media.play();

                                    }

                                    else

                                    {   // otherwise we were launched because the user touched a notification in the notification tray.

                                        if (e.coldstart)

                                            $("#app-status-ul").append('<li>--COLDSTART NOTIFICATION--' + '</li>');

                                        else

                                        $("#app-status-ul").append('<li>--BACKGROUND NOTIFICATION--' + '</li>');

                                    }


                                    $("#app-status-ul").append('<li>MESSAGE -> MSG: ' + e.payload.message + '</li>');

                                    $("#app-status-ul").append('<li>MESSAGE -> MSGCNT: ' + e.payload.msgcnt + '</li>');

                                break;


                                case 'error':

                                    $("#app-status-ul").append('<li>ERROR -> MSG:' + e.msg + '</li>');

                                break;


                                default:

                                    $("#app-status-ul").append('<li>EVENT -> Unknown, an event was received and we do not know what it is</li>');

                                break;

                            }

                        }           

            

    document.addEventListener('deviceready', onDeviceReady, false);

             </script>

             <script src="js/jquery.mobile-1.3.2.js"></script>

    </head>

 <body>

       <div id="app-status-div">

<ul id="app-status-ul">

<li>Cordova PushNotification Plugin Demo</li>

</ul>

</div>


        </div>

        

 </body>

</html>


2). GCMIntentService.java

package com.plugin.gcm;


import java.util.Iterator;

import java.util.List;


import com.google.android.gcm.GCMBaseIntentService;


import org.json.JSONException;

import org.json.JSONObject;


import android.annotation.SuppressLint;

import android.app.ActivityManager;

import android.app.ActivityManager.RunningTaskInfo;

import android.app.Notification;

import android.app.NotificationManager;

import android.app.PendingIntent;

import android.content.Context;

import android.content.Intent;

import android.os.Bundle;

import android.support.v4.app.NotificationCompat;

import android.util.Log;


@SuppressLint("NewApi")

public class GCMIntentService extends GCMBaseIntentService {


public static final int NOTIFICATION_ID = 237;

private static final String TAG = "GCMIntentService";

public GCMIntentService() {

super("GCMIntentService");

}


@Override

public void onRegistered(Context context, String regId) {


Log.v(TAG, "onRegistered: "+ regId);


JSONObject json;


try

{

json = new JSONObject().put("event", "registered");

json.put("regid", regId);


Log.v(TAG, "onRegistered: " + json.toString());


// Send this JSON data to the JavaScript application above EVENT should be set to the msg type

// In this case this is the registration ID

PushPlugin.sendJavascript( json );


}

catch( JSONException e)

{

// No message to the user is sent, JSON failed

Log.e(TAG, "onRegistered: JSON exception");

}

}


@Override

public void onUnregistered(Context context, String regId) {

Log.d(TAG, "onUnregistered - regId: " + regId);

}


@Override

protected void onMessage(Context context, Intent intent) {

Log.d(TAG, "onMessage - context: " + context);


// Extract the payload from the message

Bundle extras = intent.getExtras();

StringBuffer msg = new StringBuffer();

        Iterator<String> iterator = extras.keySet().iterator();

        while(iterator.hasNext()) {

            String key = iterator.next();

            String value = extras.get(key).toString();

            Log.i(TAG, "onMessage. "+key+" : "+value);

            msg.append(String.format("key:[%s]value:[%s]", key,value));

        }

        extras.putString("message",msg.toString());

        extras.putString("msgcnt", "0");

        createNotification(context, extras);

        /*

if (extras != null)

{

PushPlugin.sendExtras(extras);


// Send a notification if there is a message

if (extras.getString("message").length() != 0) {

createNotification(context, extras);

}

}

*/

}


public void createNotification(Context context, Bundle extras)

{

NotificationManager mNotificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);

String appName = getAppName(this);


Intent notificationIntent = new Intent(this, PushHandlerActivity.class);

notificationIntent.addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP | Intent.FLAG_ACTIVITY_CLEAR_TOP);

notificationIntent.putExtra("pushBundle", extras);


PendingIntent contentIntent = PendingIntent.getActivity(this, 0, notificationIntent, PendingIntent.FLAG_UPDATE_CURRENT);

NotificationCompat.Builder mBuilder =

new NotificationCompat.Builder(context)

.setDefaults(Notification.DEFAULT_ALL)

.setSmallIcon(context.getApplicationInfo().icon)

.setWhen(System.currentTimeMillis())

.setContentTitle(appName)

.setTicker(appName)

.setContentIntent(contentIntent);


String message = extras.getString("message");

if (message != null) {

mBuilder.setContentText(message);

} else {

mBuilder.setContentText("<missing message content>");

}


String msgcnt = extras.getString("msgcnt");

if (msgcnt != null) {

mBuilder.setNumber(Integer.parseInt(msgcnt));

}

mNotificationManager.notify((String) appName, NOTIFICATION_ID, mBuilder.build());

}

public static void cancelNotification(Context context)

{

NotificationManager mNotificationManager = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE);

mNotificationManager.cancel((String)getAppName(context), NOTIFICATION_ID);

}

private static String getAppName(Context context)

{

CharSequence appName = 

context

.getPackageManager()

.getApplicationLabel(context.getApplicationInfo());

return (String)appName;

}

@Override

public void onError(Context context, String errorId) {

Log.e(TAG, "onError - errorId: " + errorId);

}


}


6. Server Program

  http://developer.android.com/intl/ko/google/gcm/server.html을 참고하여 서버 모듈을 작성합니다.

{

  "registration_ids" : ["APA91bEcaH32K2lAD-EHn739Utx_6l3Ntaiu1K5PDeSAKRpB5Gelxuj..."],

  "data" : {"name":"james.. "

               ,"nation":"korea"

              ,"age":"18"

   },

}

6.실행 결과..




아래의 REGID로 서버에서 호출 해줘야 클라이언트에 메세지를 전달 할 수있습니다.