C:\BitNami\redmine-2.3.2-0\apps\redmine\htdocs\plugins
위 폴더에 다운 받은 플러그인 압축 출고
BitNami Redmine Stack 사용
해당 폴더에서
\plugins\redmine_ckeditor 해당 플러그인 폴더에서
bundle install --without development test
후에
redmine 재시작
C:\BitNami\redmine-2.3.2-0\apps\redmine\htdocs\plugins
위 폴더에 다운 받은 플러그인 압축 출고
BitNami Redmine Stack 사용
해당 폴더에서
\plugins\redmine_ckeditor 해당 플러그인 폴더에서
bundle install --without development test
후에
redmine 재시작
7. 테스트 하려면 MDN 등록을 하라는데, mdn 이 뭔지 몰라서 해메었음. 그냥 전화번호 였음. 처음에 입력한 폰이 kt 폰 번호여서 안되었던..
아.. 상당히 테스트 하는 방법이 번거롭다.
그냥 TTP 쓰자
http://mrdingku.tistory.com/26
그림은 없고 설명으로만 되어 있지만 이걸로 해결.
Server: http://www.redmine.org -- Replace it with the URL of your Redmine instance
Task URL: ${serverUrl}/issues/
New task URL: ${serverUrl}/projects/foo/issues/new -- Replace foo with the identifier of the project used for new tasks
Query request URL: ${serverUrl}/issues
Query pattern: <td class="subject">.*?<a href="/issues/(\d+)">(.+?)</a></td>
Login request URL: ${serverUrl}/login?username=${userId}&password=${password}&authenticity_token=${loginToken} [POST]
Login Form URL: ${serverUrl}/login
Login Token Pattern: <input name="authenticity_token" type="hidden" value="(.+?)" />
package com.phonegap.plugin.escanerDocumentos ;
import org.apache.cordova.api.CallbackContext ;
import org.apache.cordova.api.CordovaPlugin ;
import org.apache.cordova.api.Plugin;
import org.apache.cordova.api.PluginResult ;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import com.visualtaggingservices.scandoc .ScanDocConstants;
import android.app.Activity;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.os.Environment;
import android.util.Log;
public class EscanerDocumentos extends Plugin {
private static final int SCANDOC_REQUEST_RESULT = 1;
public static final String PATH_ME="path_mem_ext";
public static final String PATH_MI="path_mem_int";
public String strFilename="inicializado";
private String callback=null ;
//public static final String COMPRESS="compress";
final static String TARGET_BASE_PATH = Environment.getExternalStorageDirectory ().getAbsolutePath()+"/" ;
@Override
public PluginResult execute(String action, JSONArray args, String callbackId) {
this.callback = callbackId;
if (action.equalsIgnoreCase("EscanerDocumentos" )) {
Escanea();
}
PluginResult r = new PluginResult(PluginResult.Status .NO_RESULT);
r.setKeepCallback(true);
return r;
}
public EscanerDocumentos() {
}
private void Escanea() {
Uri uri = Uri.parse("scandoc://com.visualtaggingservices.scandoc" );
Intent intent = new Intent(Intent.ACTION_VIEW, uri);
intent.putExtra(ScanDocConstants .SCANDOC_KEY_PICTURE_WIDTH, ScanDocConstants.PICTURE_WIDTH);
intent.putExtra(ScanDocConstants .SCANDOC_KEY_PICTURE_HEIGHT, ScanDocConstants.PICTURE_HEIGHT );
this.cordova.startActivityForResult ((Plugin)this,intent,SCANDOC_REQUEST_RESULT );
}
// ===================================================================
// ON_ACTIVITY_RESULT
// -------------------------------------------------------------------
/**
* Funcion que obtiene el resultado de la Actividad.
* @param requestCode Codigo de la actividad que finaliza.
* @param resultCode Resultado de la actividad que finaliza.
* @param data Datos de la actividad que finaliza.
*/
// ===================================================================
@Override
public void onActivityResult(int requestCode, int resultCode, Intent data)
{
Log.d("EscanerDocumentos", "onActivityResult");
if (requestCode == SCANDOC_REQUEST_RESULT)
{
if (resultCode == Activity.RESULT_OK)
{
Bundle bundle = data.getExtras();
strFilename = bundle.getString(ScanDocConstants .SCANDOC_KEY_FILENAME);
JSONObject obj = new JSONObject();
try {
obj.put("filename", bundle.getString(ScanDocConstants .SCANDOC_KEY_FILENAME));
obj.put("signed", bundle.getString(ScanDocConstants .SCANDOC_KEY_SIGNED));
}
catch(JSONException e) {
Log.e("EscanerDocumentos", "Error al devolver el resultado");
}
Log.d("EscanerDocumentos", "Devolvemos el pluginResult");
this.success(new PluginResult(PluginResult.Status .OK, obj), this.callback);
}
}
}
}
nginxにはworker_processesというパラメータがあります。 NginxのWiki の Coreモジュールのページには、次のような説明があります。
A worker process is a single-threaded process.
If Nginx is doing CPU-intensive work such as SSL or gzipping and you have 2 or more CPUs/cores, then you may set worker_processes to be equal to the number of CPUs or cores.
If you are serving a lot of static files and the total size of the files is bigger than the available memory, then you may increase worker_processes to fully utilize disk bandwidth.
Your OS may schedule all workers on single CPU/core this can be avoided using worker_cpu_affinity.
Nginx has the ability to use more than one worker process for several reasons:
The worker_processes and worker_connections from the event sections allows you to calculate maxclients value:
max_clients = worker_processes * worker_connections
何が書いてあるかといえば、
worker prcessは、シングルスレッドなプロセスだよ。
nginxがSSLやgzip圧縮みたいにCPUを専有するような処理をするって場合に、2つ以上のCPUコアがあるなら、worker_processesにはCPUコア数と同じを設定したらいいよ。
大量の静的ファイルをホスティングしていて、ファイルサイズが空きメモリサイズよりも大きくなっちゃうような場合も、worker_processesの値を増やして、ディスク帯域を十分に使えるようにしたらいいよ。
君のOSだと全部のworker_processを1つのCPUコアに割りつけてしまうかもしれないけど、そんな時はworker_cpu_affinityを設定すれば回避できるよ。
nginxは、
といったいくつかの理由から複数のworker processが使えるようになっているよ。
worker_processesとeventセクションに設定するworker_connectionsから、最大クライアント数を計算できるよ。つまり、
最大クライアント数 = worker_processes * worker_connections
になるよ。
といった内容でしょうか。
つまり、worker_processes を CPUコア数にして、worker_cpu_affinityをきちんと設定しなさいよ、ということで、
僕のサーバは2コアなので、
worker_processes 2; worker_cpu_affinity 0101 1010;
を設定しました。
worker prcess는 단일 스레드 프로세스이야. nginx가 SSL 및 gzip 압축처럼 CPU를 소유하는 처리를한다고하면, 2 개 이상의 CPU 코어가 있다면, worker_processes는 CPU 코어 수와 동일한 설정하면 좋아. 많은 정적 파일을 호스팅하고있어 파일 크기가 사용 가능한 메모리 크기보다 큽니다 버리는 경우도 worker_processes 값을 늘려 디스크 대역폭을 충분히 사용할 수 있도록하면 좋을거야. 네 OS라고 모든 worker_process을 하나의 CPU 코어에 할당 버릴지도 모르지만, 그런 때는 worker_cpu_affinity을 설정하면 회피 할 수 있어요. nginx는
같은 몇 가지 이유에서 여러 worker process를 사용할 수있게되어 있어요.
worker_processes와 event 섹션에 설정 worker_connections에서 최대 클라이언트 수를 계산할 수 있어요. 즉, 최대 클라이언트 수 = worker_processes * worker_connections 될거야.
같은 내용입니까?
즉, worker_processes를 CPU 코어 수에하여 worker_cpu_affinity를 제대로 설정하십시오,라고하는 것으로,
내 서버는 2 코어이므로,
worker_processes 2; worker_cpu_affinity 0101 1010;
을 설정했습니다
- total 사용량
ps aux | grep nginx | awk '{print $6}' | awk '{total=total +$1} END {print total / 1024}'
- 프로세스 수
ps aux | grep nginx | wc -l
public static String getShortUrl()
{
ByteArrayOutputStream baos = new ByteArrayOutputStream();
DataOutputStream dos = new DataOutputStream(baos);
UUID uuid = UUID.randomUUID();
String shortUrlKey = null;
try
{
dos.writeLong(uuid.getMostSignificantBits());
String encoded = new String(Base64.encodeBase64(baos.toByteArray()), "ISO-8859-1");
shortUrlKey = StringUtils.left(encoded, 5);
String match = "[^\uAC00-\uD7A3xfe0-9a-zA-Z\\s]";
shortUrlKey =shortUrlKey.replaceAll(match, Character.toString(((char)((Math.random() * 26) + 97))) );
}
catch (IOException e) {
e.printStackTrace();
shortUrlKey = null;
}
return shortUrlKey;
}
AlphaAnimation alphaDown,alphaUp;
_button = (Button)findViewById(R.id.button1);
//set animation
alphaDown =
new
AlphaAnimation(
1
.0f,
0
.5f);
alphaUp =
new
AlphaAnimation(
0
.5f,
1
.0f);
alphaDown.setDuration(
100
);
alphaUp.setDuration(
100
);
alphaDown.setFillAfter(
true
);
alphaUp.setFillAfter(
true
);
//set OnTouchListener
_button.setOnTouchListener(
new
View.OnTouchListener() {
@Override
public
boolean
onTouch(View v, MotionEvent event) {
// TODO Auto-generated method stub
if
(event.getAction()==MotionEvent.ACTION_DOWN)
_button.startAnimation(alphaDown);
if
(event.getAction()==MotionEvent.ACTION_UP)
_button.startAnimation(alphaUp);
return
false
;
}
});