Categories
- FFMpeg (5)
- Libav (1)
- Google (3)
- iBeacon (1)
- LDAP (3)
- Me (2)
- Network (11)
- OS (149)
- RTMP (4)
- SIP (1)
- Kamailio (1)
- SNMP (1)
- VMware (20)
- VCP考試 (1)
- 伺服器 網站服務 (105)
- 名詞解釋 (4)
- 專案管理 (1)
- 工具軟體 (50)
- Adobe (1)
- FMS (1)
- Cloudera (1)
- Docker (1)
- Eclipse (4)
- Intellij (2)
- OBS (2)
- Office (10)
- Excel (4)
- PowerPoint (5)
- Postman (1)
- Splunk (13)
- Virtualbox (2)
- Visual Studio (2)
- 文字編輯器 (10)
- Sublime Text 2 (6)
- Sublime Text 3 (3)
- Vim (3)
- 連線工具 (1)
- Xshell (1)
- Adobe (1)
- 程式語言 (79)
- CSS (2)
- HTML (2)
- iOS (1)
- Java (30)
- JavaScript (5)
- jQuery (4)
- jsTree (2)
- JSP (3)
- PHP (16)
- Python (7)
- Ruby (1)
- sed (1)
- Shell Script (8)
- Windows Bash Script (1)
- XML (1)
- 資料庫 (37)
- FFMpeg (5)
Category Archives: Wisemapping
Wisemapping 調整網頁縮圖功能
因為原本 wisemapping 搭配的是 immediatenet 提供的網頁縮圖服務 測試的失敗率有點高~主要還是因為不支援 https 的原因 所以使用 page2images 提供的服務取代掉 {wisemapping home directory}/webapps/wisemapping/js/mindplot-min.js
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
<略> //註解掉舊有的設定 //var d=new Element("img",{src:"http://immediatenet.com/t/m?Size=1024x768&URL="+b.getModel().getUrl(),img:b.getModel().getUrl(),alt:b.getModel().getUrl()}); //var d=new Element("img",{src:"http://free.pagepeeker.com/v2/thumbs.php?size=m&refresh=1&url="+b.getModel().getUrl()}); //設定 function 以便取得連結相關資訊 //包含hostname、pathname等 var cowgetLocation = function(href) { var cowl = document.createElement("a"); cowl.href = href; return cowl; } //取得正確連結,並去掉 http:// 及 https:// var cowl = cowgetLocation(b.getModel().getUrl()); //console.log(cowl.hostname); //console.log(cowl.pathname.length); if (cowl.pathname.length > 1) { var cowimgurl = cowl.hostname + cowl.pathname; } else { var cowimgurl = cowl.hostname; } //使用 page2images 申請提供的 api 進行縮圖 //var d=new Element("img",{src:"http://api.page2images.com/directlink?p2i_url="+b.getModel().getUrl()+"&p2i_key=1716358728d706ce"}); var d=new Element("img",{src:"http://api.page2images.com/directlink?p2i_url="+ cowimgurl +"&p2i_key=1716358728d706ce"}); //console.log(b.getModel().getUrl()); //console.log(cowimgurl); <略> |
Posted in Wisemapping
Leave a comment
Wisemapping REST API #2
後來發現 wisemapping 提供的 api doc 網站還不錯 功能都有了,包含查詢、刪除等功能 只是測試的時候要小心,因為資料真的會被刪掉….Orz 網址 link:http://{伺服器IP}/map/doc/rest/index.html
Posted in Wisemapping
Leave a comment
Nginx Proxy Setting…
因為 wisemapping 預設使用 8080 port etherpad 預設使用 9001 port 都很麻煩~~所以就使用 nginx proxy 幫忙轉址了 以下是測試很久的設定檔
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
location /pad { rewrite ^/pad(/.*)$ $1 break; proxy_pass http://localhost:9001/; proxy_set_header Host $host; proxy_buffering off; access_log /var/log/nginx/etherpad.log; error_log /var/log/nginx/etherpad.log; } location /map { #rewrite ^/map(/.*)$ $1 break; proxy_pass http://localhost:8080/map; proxy_set_header Host $host; proxy_buffering off; access_log /var/log/nginx/wisemapping.log; error_log /var/log/nginx/wisemapping.log; } |
配合這個設定 etherpad 需要設定 {etherpad home directory}/settings.json
1 2 3 4 5 6 7 |
//略 //IP and port which etherpad should bind at "ip": "127.0.0.1", "port" : 9001, /*when you use NginX or another proxy/ load-balancer set this to true*/ "trustProxy": true, //略 |
wisemapping 要設定的地方比較多…. {wisemapping home directory}/webapps/wisemapping/WEB-INF/app.properties
1 2 3 4 5 |
<略> site.baseurl = http://{伺服器IP}/map <略> documentation.services.basePath=http://{伺服器IP}/map/service <略> |
{wisemapping home directory}/contexts/wisemapping.xml
1 2 3 4 5 |
<略> <Configure class="org.eclipse.jetty.webapp.WebAppContext"> <略> <Set name="contextPath">/map</Set> <略> |
Posted in etherpad, Nginx, Wisemapping
Leave a comment
Wisemapping REST API
只有幾個… 不知道哪邊才有詳細的API List … Orz Ref. wisemapping-support › create and register a user via REST API Obtaining user information by email: * Template Path: /service/admin/users/email/{user.email}.json * Example: curl “http://{host.name}:{host.port}/{context.path}/service/admin/users/email/{user.email}.json” –get –basic -u “admin@wisemapping.org:admin” Deleting a based on the user id: … Continue reading
Posted in Wisemapping
Leave a comment
[Wisemapping] find user by email in Python
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
#! /usr/bin/python # coding:utf-8 # curl "http://localhost:8080/wisemapping/service/admin/users/email/{使用者帳號信箱}.json" --get --basic -u "admin@wisemapping.org:admin" import sys import urllib2 import base64 import yaml import datetime username = 'admin@wisemapping.org' password = 'admin' if len(sys.argv) == 2: request = urllib2.Request("http://localhost:8080/wisemapping/service/admin/users/email/%s.json" % sys.argv[1]) base64string = base64.encodestring('%s:%s' % (username, password)).replace('n', '') request.add_header("Authorization", "Basic %s" % base64string) result = urllib2.urlopen(request).read() #print result print "ID:tt" + str(yaml.load(result).get('id')) print "Firstname:t" + yaml.load(result).get('firstname') print "Lastname:t" + yaml.load(result).get('lastname') print "E-Mail:tt" + yaml.load(result).get('email') print "Create Date:t" + datetime.datetime.fromtimestamp(yaml.load(result).get('creationDate') / 1000.0 ).strftime("%Y-%m-%d") else: print "使用方法: python finduser.py {使用者email}" |
Posted in Python, Wisemapping
Leave a comment
Wisemapping in Ubuntu 14.04 x64 server
Wisemapping 環境 : Ubuntu 14.04 x64 server 檢查系統是否已裝了 java development kit,如果是openjdk就先移除掉
1 |
java -version |
安裝 Java Development Kit (版本>7)
1 2 3 4 |
sudo apt-get install software-properties-common python-software-properties sudo add-apt-repository ppa:webupd8team/java sudo apt-get update sudo apt-get install oracle-java7-installer |
下載 wisemapping binary檔案
1 |
wget https://bitbucket.org/wisemapping/wisemapping-open-source/downloads/wisemapping-v3.0.4.zip |
安裝 unzip
1 |
sudo apt-get install unzip |
解壓縮 wisemapping 檔案
1 |
unzip wisemapping-v3.0.4.zip |
切換到 wisemapping 目錄中
1 |
cd wisemapping-v3.0.4 |
測試執行
1 2 3 |
java -Dorg.apache.jasper.compiler.disablejsr199=true -jar start.jar # 看到 INFO:oejs.AbstractConnector:Started SelectChannelConnector@0.0.0.0:8080 代表正常啟動 # 可用瀏覽器觀看 http://ip:8080/wisemapping |
安裝 mysql server、nginx
1 |
sudo apt-get install mysql-server nginx |
編輯 … Continue reading
Posted in MySQL, Ubuntu, Wisemapping
Leave a comment