2015年12月2日 星期三

iptables

iptables 需要將ppp設為MASQUERADE偽裝IP才有辦法連到internet,但是這樣做會造成inner ip顯示全部變為gateway ip。修正方法為改用SNAT加指定EXTIP,但是就變成要有固定IP才可以使用。

出現錯誤訊息

Options error: server and client cannot be used together

代表conf檔案內有用到不是server指令的指令

iptables restart in ubuntu

sudo service ufw stop
sudo service ufw start

刪除單一chain下的規則
iptables -t nat -D POSTROUTING <number>

enable forwarding in ubuntu
echo 1 >/proc/sys/net/ipv4/ip_forward

如果要兩個網路能夠成功的達成路由﹐對方網路也必須有相應的路由設定指向本地網路才行

pfsense 內 openvpn檔案存放位置/var/etc/openvpn

traceroute
mac: traceroute
dos: tracert
linux: tracepath

terminate openvpn
sudo killall openvpn
參考資料
http://acman.bluenest.net/wordpress/archives/118
http://askubuntu.com/questions/298419/how-to-disconnect-from-openvpn
iptables
http://serverfault.com/questions/431593/iptables-forwarding-between-two-interface
http://askubuntu.com/questions/161551/how-to-start-stop-iptables
http://stackoverflow.com/questions/8239047/iptables-how-to-delete-postrouting-rule
http://s2.naes.tn.edu.tw/~kv/iptables.htm
https://gigenchang.wordpress.com/2014/04/19/10%E5%88%86%E9%90%98%E5%AD%B8%E6%9C%83iptables/
http://www.pcnet.idv.tw/pcnet/network/network_ip_routing.htm
pfsense存放位置
https://forum.pfsense.org/index.php?topic=13123.0
openvpn with two interface in and out
https://forums.openvpn.net/topic11033.html
https://forums.openvpn.net/topic14072.html
http://ubuntuforums.org/showthread.php?t=1606136
route
http://yinung2.blogspot.tw/2013/05/route_17.html
bridge vs routing
https://community.openvpn.net/openvpn/wiki/BridgingAndRouting
https://openvpn.net/index.php/open-source/documentation/miscellaneous/76-ethernet-bridging.html
chain using openvpn
http://serverfault.com/questions/512160/vpn-chaining-using-openvpn
dns server on openvpn
http://superuser.com/questions/637579/setting-dns-servers-using-openvpn-client-config-file
show route on mac
http://stackoverflow.com/questions/6782658/how-to-get-default-gateway-in-mac-osx
自己

2015年11月9日 星期一

Google問卷根據地址自動查詢3+2郵遞區號

因為最近在準備結婚的事,使用了google form來統計賓客資料。用google apps script寫了一個小程式(參考https://gist.github.com/mhawksey/1442370),透過http://tools.5432.tw/zip5api.html提供的API自動查詢3+2碼郵遞區號。分享給大家。

由於API作者有提到不要連續查詢,最好間隔一秒,因此請不要更動code內部sleep的部分。否則會被API作者封鎖來源網址。作者已經將google script的來源封鎖,這讓我在一開始的時候花了不少功夫debug。所以使用者必須提供一個web server供redirect來源繞過封鎖。

google apps script

function onOpen() {
  var spreadsheet = SpreadsheetApp.getActiveSpreadsheet();
  var entries = [{
    name : "fix郵遞區號",
    functionName : "findpostcode"
  }];
  spreadsheet.addMenu("fix郵遞區號", entries);
};

/**
 * Runs when the add-on is installed; calls onOpen() to ensure menu creation and
 * any other initializion work is done immediately.
 *
 * @param {Object} e The event parameter for a simple onInstall trigger.
 */
function onInstall(e) {
  onOpen(e);
}

/**
 * Opens a sidebar. The sidebar structure is described in the Sidebar.html
 * project file.
 */
function findpostcode() {
  var o = 4; //4為修正前地址的欄位,可依需求修正
  var a = 14; //將修正後之地址輸出到第14欄,可依需求修正
  var ss = SpreadsheetApp.getActiveSpreadsheet();
  var sheet = ss.getSheetByName("Form Responses 1");
  var TIDrange = sheet.getRange(1,1,sheet.getMaxRows(), a);
  var rows = sheet.getLastRow();

for (i = 2; i <= rows; i++)
  {
      var dirtyaddress = TIDrange.getCell(i,o).getValue().toString().replace(/ /g,"");
 
      var address = dirtyaddress.split(/^[0-9]*/)[1]; //去除已填寫之郵遞區號(可能為3碼)
   
      var target = TIDrange.getCell(i,a).getValue().toString().replace(/ /g,"");
 
    if (target == "") {
      if (typeof address === 'undefined') {address = dirtyaddress;}
   
      var response = UrlFetchApp.fetch("這邊放入轉址的網站"+address)
      Utilities.sleep(1000); //此行勿動
      var dataAll = JSON.parse(response.getContentText());
   
      var newaddr = dataAll.new_adrs;
   
      sheet.getRange(i,a).setValue(newaddr);
   
    }
  }

webserver PHP

<?php

if (isset($_GET['link'])) {
//    echo $_GET['link'];

echo file_get_contents($_GET['link']);

}else{
   // Fallback behaviour goes here
}

?>

由於API使用url參數會自動decode % encode,所以一開始遇到一點麻煩,後來發現我不用去store資料,只要直接echo就OK。

將webserver PHP放在webserver如apache下,假設檔名為phpexample.php,domain name為neverregret.net,則google apps script紅字部分這邊放入轉址的網站

http://neverregret.net/phpexample.php?link=http://zip5.5432.tw/zip5json.py?adrs=

將google apps script部分複製並貼在工具-指令碼編輯器的內容(將內容先全部清空)

儲存後工具列會出現fix郵遞區號的選項,點選後執行即可使用。

查詢流程為如果尚未修正則修正(修正欄位不為空白),已修正則不處理,所以如果地址有變要記得將修正後欄位也一併清除。這樣做是為了不用每次都全部重新修正。

如有親友想使用請直接與我聯繫,我可以提供我自己的webserver供使用。

參考資料
API
http://tools.5432.tw/zip5api.html

unicode decode encode (didn't use in the end)
http://www.cnblogs.com/txw1958/archive/2013/04/20/unicode-encode-decode.html
http://stackoverflow.com/questions/16943281/javascript-google-scripts-how-to-get-the-title-of-a-page-encoded-with-iso-88
http://stackoverflow.com/questions/332872/encode-url-in-javascript
http://stackoverflow.com/questions/23496750/how-to-prevent-python-requests-from-percent-encoding-my-urls
http://blog.bestdaylong.com/2010/09/phputf8get.html
http://www.ewdna.com/2008/12/online-urlencoderutf-8.html
http://stackoverflow.com/questions/17342671/pass-a-percent-sign-in-a-url-and-get-exact-value-of-it-using-php
http://blog.lunatech.com/2009/02/03/what-every-web-developer-must-know-about-url-encoding

PHP
http://stackoverflow.com/questions/5884807/get-url-parameter-in-php
http://stackoverflow.com/questions/959063/how-to-send-a-get-request-from-php
determine undefine
http://stackoverflow.com/questions/2647867/how-to-determine-if-variable-is-undefined-or-null


JSON array
http://stackoverflow.com/questions/14408281/access-elements-in-json-object-like-an-array
javascript split
http://stackoverflow.com/questions/650022/how-do-i-split-a-string-with-multiple-separators-in-javascript

google apps script
https://gist.github.com/mhawksey/1442370
http://ctrlq.org/code/19871-get-post-requests-google-script
https://developers.google.com/apps-script/guides/html/
https://developers.google.com/apps-script/reference/url-fetch/url-fetch-app#getRequest(String,Object)
https://discuss.ninjablocks.com/t/google-script-for-parsing-json-to-google-spreadsheets/1088/4
https://developers.google.com/apps-script/reference/spreadsheet/range
http://stackoverflow.com/questions/11334296/google-docs-script-set-cell-value

google spreadsheet
https://support.google.com/docs/answer/3093335?hl=zh-Hant

javascript
http://stackoverflow.com/questions/2499567/how-to-make-a-json-call-to-a-url/2499647#2499647
http://stackoverflow.com/questions/18910939/how-to-get-json-key-and-value-in-javascript
http://stackoverflow.com/questions/12070631/how-to-use-json-file-in-html-code

JSON test site
http://developers.squarespace.com/view-json-data/
http://base-template.squarespace.com/blog/?format=json-pretty

2015年11月5日 星期四

windows 以命令列控制資料夾共用

windows可以使用命令列控制資料夾共用,配合工作排程器相當好用。

net share [ShareNamenet share [ShareName=Drive:Path [{/users:number|/unlimited}] [/remark:"text"] [/cache: {manual|automatic|no}]] [/GRANT:user,[READ | CHANGE | FULL]]

另外net share [ShareName]可以看目前共用資料夾的狀態

參考資料
https://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/file_srv_command_line.mspx?mfr=true
https://social.technet.microsoft.com/Forums/windowsserver/en-US/e16b7a68-7464-40e9-a479-4f6deceb62d6/net-share-with-permissions

2015年10月6日 星期二

windows10 WOL失效問題

關於升級到windows10之後wake on lan失效問題,請到下面連結下載Win10 Auto Installation Program的realtek driver,安裝之後問題解決,也不用像其他資料寫得要改green ethernet或者windows10的fast boot。

http://www.realtek.com.tw/Downloads/downloadsView.aspx?Langid=1&PNid=13&PFid=5&Level=5&Conn=4&DownTypeID=3&GetDown=false#1

參考資料
https://m.reddit.com/r/Windows10/comments/3f73sz/psaif_windows_10_killed_your_wol_functionality_or/

2015年10月5日 星期一

Windows server 無法下載檔案問題

前一陣子試用windows server2012,發現用IE無法下載網路上的檔案,後來發現要把IE進階安全設定關閉才行。

參考資料

google sheet array串接

googlesheet如果需要將兩個array串成一個array時,使用{array1;array2}的格式。

參考資料
忘了留

XFCE自動完成失效問題

在XFCE下ubuntu的tab自動完成失效,解決方法是修改xml file

.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-keyboard-shortcuts.xml
把下面改掉
<property name=”&lt;Super&gt;Tab” type=”string” value=”switch_window_key”/>
改成這個
<property name=”&lt;Super&gt;Tab” type=”empty”/>

參考資料
https://241931348f64b1d1.wordpress.com/2012/05/04/shell-autocomplete-not-working-on-xrdp-xubuntu-12-04-xfce/

selenium

selenium get url of webpage
selenium2library 可以使用 keyword "Get Location"

另外Get Element Attribute 需要使用id name@class而非一般XPATH格式否則會有錯誤

The expression is not a legal expression

而使用Get Value獲取@href不行因為結果會是attribute而非element,會有錯誤

[object XrayWrapper [object Attr]]

當需要驗證popup windows兩者標題又相同無法switch window時,後來採取抓取button href資訊並直接go to就可以不被popup限制

參考資料
自己
http://stackoverflow.com/questions/15985339/how-do-i-get-current-url-in-selenium-webdriver-2-python

rebot

robotframework 可以使用 rebot <file1>.xml <file2>.xml來合併xml,並且合併之後log.html與report.html也會跟著update

可使用參數--name <name>來變更suite name

如用Windows寫sh script時要注意檔案格式需為UNIX,否則可能有執行上問題,錯誤訊息
' failed: Data source does not exist.Appengine/X3000001.robot

Try --help for usage information.
: not found3: script.sh:
參考資料
https://twiki.cern.ch/twiki/bin/view/EMI/RobotFrameworkAdvancedGuide#Using_the_rebot_Tool
http://stackoverflow.com/questions/25988071/combining-robot-framework-test-reports

ddwrt設定wake on lan

由於無法NAT layer-2 broadcast,所以必須使用wake on internet (255.255.255.255)發送packet NAT到主機ip並寫入arp table使得router不須透過arp request取得ip的mac address。由於arp table會在重開機時清除所以使用指令arp -s <ip> <mac>並使用cron定時寫入防止遇到device重開機。

cron指令詳如下

*/20 * * * * arp -s <ip> <mac> 代表每3分鐘寫入一次

參考資料

Apache 使用virtualbox分享資料夾做為www資料夾內容 gitweb設定


1) Power the VM down and add the shared folder with the Virtualbox Manager (never works right for me if VM is on)

2) Power on the VM and make your symbolic link to the shared folder where ever you want your web root to be:
ln -s /media/sf_share /var/www
chown -h www-data /var/www
NOTE: If your OS runs apache under the user: apache or apache2, replace www-data with that.

3) Add the user apache runs under to the group vboxsrv. Edit /etc/group and on the line that defines the vboxsrv group. Here is what my line in the group file looks like:
vboxsf:x:1001:sean,www-data
NOTE: Again, swap out www-data for the user apache runs under, if not www-data.

4) Reboot the VM.

重點是在建立soft link到www資料夾下 step 2

https://forums.virtualbox.org/viewtopic.php?f=3&t=34922

檢查link是否建立成功
http://linux.vbird.org/linux_basic/0230filesystem.php#ln

apache tool
htdigest -c 建立密碼檔
mod-avaliable and mod-enabled
使用symbolic link把avaliable link到enable下,apache啟動時會讀取enable下之所有module
gitweb需要load module如下
alias.conf
alias.load
auth_basic.load
auth_digest.load
authn_file.load
authz_default.load
authz_groupfile.load
authz_host.load
authz_user.load
autoindex.conf
autoindex.load
cgi.load
dav_fs.conf
dav_fs.load
dav.load
deflate.conf
deflate.load
dir.conf
dir.load
env.load
mime.conf
mime.load
negotiation.conf
negotiation.load
php5.conf
php5.load
reqtimeout.conf
reqtimeout.load
setenvif.conf
setenvif.load
status.conf
status.load


gitolite client設定
git clone git@<ip>:<repository name>.git

以下需在repository目錄下
看狀態 git status
commit 差異文件 git commit -a
上傳 git push <remote name, default origin> <branch name/master>
加入檔案 git add <file1> <file2> ...

git remote add [<options>] <name> <url>

參考資料
同事

SVN架設

架設SVN時遇到無法commit,後來查到是因為apache user沒有該svn資料夾權限,因此將該repository資料夾chown -R apache:apache *chmod -R 664 *即可正常使用

參考資料
Can't open file '/server/svn/repo/db/txn-current-lock': Permission denied
http://stackoverflow.com/questions/960241/svn-permission-denied
svn架設
http://eric0806.blogspot.tw/2014/05/ubuntu-svn-server-with-websvn.html

openvpn server, pfsense ipsec 設定

iptables 需要將ppp設為MASQUERADE偽裝IP才有辦法連到internet

出現錯誤訊息

Options error: server and client cannot be used together

代表conf檔案內有用到不是server指令的指令

iptables restart in ubuntu

如使用ufw
sudo service ufw stop
sudo service ufw start

刪除單一chain下的規則
iptables -t nat -D POSTROUTING <number>

enable forwarding in ubuntu
echo 1 >/proc/sys/net/ipv4/ip_forward

如果要兩個網路能夠成功的達成路由﹐對方網路也必須有相應的路由設定指向本地網路才行

pfsense 內 openvpn檔案存放位置/var/etc/openvpn

traceroute
mac: traceroute
dos: tracert
linux: tracepath

terminate openvpn
sudo killall openvpn

port-share
可設一個port(通常為443)如果沒有TLS handshake則導到網頁,有則連接上openvpn server
方法是在Advanced configuration > Advanced 加上以下指令
port-share x.x.x.x 443
x.x.x.x為apache或web server的位址

pfsense 的ipsec設定可以參考下面的參考資料
因為後來看到似乎ipsec比較穩定,所以有用pfsense架設了一個ipsec VPN,到中國後才知道GFW(網路長城)的厲害啊...
總之現在就是openvpn PPTP ipsec輪著用,通常至少有一個能work

要push dns 到client時使用push "dhcp-option DNS <ip>"
如果是client端conf則使用dhcp-option DNS <ip>
可同時複數使用如增加google dns push "dhcp-option DNS 8.8.8.8"
這樣就可以同時使用local dns server與internet dns server

順帶一提,有問題的vpn是hola vpn。

2019/4/17更新
後來將VPN network與local network分開,導致兩邊無法互連問題,經過研究發現是因為設了ipv4 local network,這會導致直接優先在local route尋找而不是透過gateway轉遞。另外也須加上 push "route <local subnet> <local subnet netmask>"

參考資料
http://acman.bluenest.net/wordpress/archives/118
apache ssl (https) setting
https://www.bestvpn.com/blog/5919/how-to-hide-openvpn-traffic-an-introduction/
http://neidi.homeip.net/blog/cblog/index.php?id=414
http://kirby86a.pixnet.net/blog/post/95136568-ubuntu-12.04%E5%95%9F%E7%94%A8apache%E7%9A%84-ssl
openvpn port share
https://doc.pfsense.org/index.php/Sharing_a_Port_with_OpenVPN_and_a_Web_Server
pfsense ipsec
https://doc.pfsense.org/index.php/IPsec_for_road_warriors_in_PfSense_2.0.1_with_PSK_in_stead_of_xauth
https://www.shrew.net/download/vpn
https://doc.pfsense.org/index.php/IPsec_Road_Warrior/Mobile_Client_How-To
iptables
http://serverfault.com/questions/431593/iptables-forwarding-between-two-interface
http://askubuntu.com/questions/161551/how-to-start-stop-iptables
http://stackoverflow.com/questions/8239047/iptables-how-to-delete-postrouting-rule
http://s2.naes.tn.edu.tw/~kv/iptables.htm
https://gigenchang.wordpress.com/2014/04/19/10%E5%88%86%E9%90%98%E5%AD%B8%E6%9C%83iptables/
http://www.pcnet.idv.tw/pcnet/network/network_ip_routing.htm
pfsense存放位置
https://forum.pfsense.org/index.php?topic=13123.0
openvpn with two interface in and out
https://forums.openvpn.net/topic11033.html
https://forums.openvpn.net/topic14072.html
http://ubuntuforums.org/showthread.php?t=1606136
route
http://yinung2.blogspot.tw/2013/05/route_17.html
bridge vs routing
https://community.openvpn.net/openvpn/wiki/BridgingAndRouting
https://openvpn.net/index.php/open-source/documentation/miscellaneous/76-ethernet-bridging.html
chain using openvpn
http://serverfault.com/questions/512160/vpn-chaining-using-openvpn
dns server on openvpn
http://superuser.com/questions/637579/setting-dns-servers-using-openvpn-client-config-file
show route on mac
http://stackoverflow.com/questions/6782658/how-to-get-default-gateway-in-mac-osx
different subnet
https://blog.bobbyallen.me/2016/02/07/enabling-openvpn-clients-to-access-to-the-lan/

關閉ctrl注音符號快速輸入



參考資料
http://answers.microsoft.com/zh-hant/windows/forum/windows_8-ime/%E5%9C%A8-windows-8/ad2e85c3-6863-4865-a614-2c8b9f36ebe3?auth=1

git ssh id_rsa key

使用robot framework sshlibrary時,遇到錯誤訊息SSHException: No existing session原先以為是alise沒設好,後來發現是因為我的ssh id_rsa key有變動造成。

解決方法
使用root權限再跑一次即可

另外將ssh id_rsa.pub放到要連線的server~/.ssh/authorized_keys即可之後連線不需要輸入密碼(使用者名稱仍需要)

cp <path to id_rsa.pub> ~/.ssh/authorized_keys

如使用puttygen.exe,因為格式與openSSH不同,需在puttygen裡作轉換,並且public key的格式也需照框框內的內容貼上到authorized_keys,而非使用download public key的檔案。

另外也需要在ssh server上將權限設成可執行rwx------
chmod 700 ~/.ssh/authorized_keys
可用 ls -l 指令檢查
private key則需要600,不過一般都一定可以讀取所以不容易出錯

參考資料
自己
同事
authenticate agent
http://stackoverflow.com/questions/6832248/paramiko-no-existing-session-exception
authorized_keys
http://stackoverflow.com/questions/7260/how-do-i-setup-public-key-authentication
https://www.debian-administration.org/article/530/SSH_with_authentication_key_instead_of_password
puttygen.exe
http://blog.faq-book.com/?p=1444
chmod
http://unix.stackexchange.com/questions/36540/why-am-i-still-getting-a-password-prompt-with-ssh-with-public-key-authentication
ssh key on pi
https://www.raspberrypi.org/documentation/remote-access/ssh/passwordless.md
pfsense ssh key
https://doc.pfsense.org/index.php/HOWTO_enable_SSH_access

xcopy

xcopy使用時來源與目的地不須加最後的 \
如 xcopy c:\source c:\destination 而非  xcopy c:\source\ c:\destination\
如設錯會在有空格需用雙引號""時將來源與目的地連在一起
另外 /xd 用於例外目錄, /xf 則是例外檔案可使用*等符號

windows7 會遇到 My Documents 資料夾 access denied 存取被拒,是因為安全性因素 My Documents設為連結,需用PATH變數如
xcopy "%USERPROFILE%\Documents" "F:\New Folder" /s /e /i

參考來源
自己
https://social.technet.microsoft.com/Forums/en-US/f6f7968e-dd99-4d46-b4e5-1307e2187b21/using-robocopy-with-a-large-xf-exclusion-list
https://technet.microsoft.com/en-us/library/cc733145.aspx
http://serverfault.com/questions/430268/how-do-i-use-robocopy-to-exclude-all-subfolders-under-a-chosen-folder
http://stackoverflow.com/questions/12875842/folder-names-with-spaces-in-xcopy-doesnt-work

Winodws boot fail 0xc0000098 pciidex.sys

windows開機時出現錯誤訊息0xc0000098 pciidex.sys無法載入。後來看了許多方法,比較有用的是使用Gparted備份除windows以外的資料夾再將資料倒回到新安裝的windows。但是還是有很多問題如檔案系統異常,圖示消失等,最後是還原到前一個備份點。

原因可能是在windows update的時候異常關機。

試過的方法有
bootrec /rebuildbcd
copy system32 files
windows system recovery windows修復開機
copy C:\Windows\System32\config
都無效,供參考
不過如果是其他的問題可能可以參考上面的方法處理

另外在修復控制台的命令列使用xcopy出現access denied不是權限問題而是檔案唯讀,可使用/R參數覆寫

參考資料
http://superuser.com/questions/358651/bootmgr-is-missing-usual-fixes-dont-work
Total identified Windows installations: 0
http://answers.microsoft.com/en-us/windows/forum/windows8_1-windows_install/total-identified-windows-installations-0/52359f87-de4a-41dc-b0c3-cc275e1d9fbf?auth=1
xcopy
https://support.microsoft.com/zh-tw/kb/240268

Forward PPTP server packet from Pi

這個問題花了我不少時間去處理,原因居然是因為Rasbian使用的3.18 kernel將PPTP packet視為invalid packet。不過還好後來有找到解決方法,分享給各位。

ping: sendmsg: Operation not permitted
出現以上訊息時代表iptables沒設定好,可重設iptables
# Reset/Flush iptables
iptables -F
iptables -X
iptables -t nat -F
iptables -t nat -X
iptables -t mangle -F
iptables -t mangle -X
iptables -P INPUT ACCEPT
iptables -P FORWARD ACCEPT
iptables -P OUTPUT ACCEPT
# Flush end
但須注意此時已經policy設為ACCEPT,為debug使用,記得結束後要將iptables -P 設回需要的policy

PPTP forward參考設定如下

#!/bin/sh
### BEGIN INIT INFO
# Provides:         firewall.sh
# Required-Start:   $all
# Required-Stop:
# Default-Start:    2 3 4 5
# Default-Stop:     0 1 6
### END INIT INFO

INTIF="你的對內介面,如brlan"

INTNET="對內介面的網段"

INTIP="PPTP server的IP"

EXTIF="對外介面,如為撥接通常為ppp0"

#Loading required stateful/NAT kernel modules...

/sbin/depmod -a
/sbin/modprobe ip_tables
/sbin/modprobe ip_conntrack
/sbin/modprobe ip_conntrack_ftp
/sbin/modprobe ip_conntrack_irc
/sbin/modprobe iptable_nat
/sbin/modprobe ip_nat_ftp
/sbin/modprobe ip_nat_irc

#below has to be loaded for pptp
/sbin/modprobe nf_nat_pptp 
/sbin/modprobe nf_conntrack_pptp 
/sbin/modprobe nf_conntrack_proto_gre 
#就是上面這三個kernel需要load,否則再怎麼設都是枉然

echo "1" > /proc/sys/net/ipv4/ip_forward
echo "1" > /proc/sys/net/ipv4/ip_dynaddr

UNIVERSE="0.0.0.0/0"

iptables -A FORWARD -i $EXTIF -o $INTIF -m state --state ESTABLISHED,RELATED -j ACCEPT
iptables -A FORWARD -i $INTIF -o $EXTIF -j ACCEPT

iptables -A FORWARD -i $EXTIF -o $INTIF -d $INTIP -j ACCEPT

# Enable SNAT (MASQUERADE) functionality on $EXTIF
iptables -t nat -A POSTROUTING -o $EXTIF -j MASQUERADE

#DMZ setting
iptables -t nat -A PREROUTING -i $EXTIF -p tcp -m multiport --dport 1:65535 -j DNAT --to $INTIP
iptables -t nat -A PREROUTING -i $EXTIF -p udp -m multiport --dport 1:65535 -j DNAT --to $INTIP

# PPTP PREROUTING GRE packets
iptables -t nat -A PREROUTING -i $EXTIF -p 47 -j DNAT --to $INTIP
iptables -A FORWARD -i $EXTIF -p 47 -j ACCEPT

如果不是使用DMZ的話可將DMZ setting改成--dport 1723只轉port 1723到PPTP server就好
另外如果是使用pfsense之類的firewall,INTIP為pfsense的WAN端




將script註冊為service
sudo update-rc.d <script undre /etc/init.d/> defaults
將service移除
sudo update-rc.d -f foobar remove
設定啟動相依性(如在某service啟動後啟動)
# Required-Start:    $local_fs $network
# Required-Stop:     $local_fs

2015/10/5更新
遇到一個問題是source ip被snat蓋掉。因為以前使用ddwrt時沒有遇到這個問題,因此研究了一下,發現是需要設-m state --state NEW在iptables裡對應PREROUTING的port。才能夠觸發output。否則單純用MASQUERADE是可以但是就變成snat會將source ip蓋掉變成內部ip,不是我要的。
因此上面#DMZ setting要多增加兩行
iptables -t nat -A INPUT -i $EXTIF -p udp -m state --state NEW -m multiport --dport 1:65535 -j ACCEPT
iptables -t nat -A INPUT -i $EXTIF -p tcp -m state --state NEW -m multiport --dport 1:65535 -j ACCEPT

參考資料
register service
https://mkaz.github.io/2013/07/03/run-script-at-start-on-debian/
setting linux firewall
http://www.aboutdebian.com/firewall.htm
http://www.linuxjournal.com/article/3866
PPTP forward
http://ubuntuforums.org/showthread.php?t=801207
http://www.linuxquestions.org/questions/linux-networking-3/port-forward-gre-and-pptp-using-iptables-210334/
http://serverfault.com/questions/466030/pptp-iptables-routing-issue
https://wiki.archlinux.org/index.php/PPTP_server#iptables_firewall_configuration
https://lists.debian.org/debian-firewall/2004/04/msg00103.html
http://wiki.linuxmce.org/index.php/PPTP_server
tcpdump PPTP packet
http://serverfault.com/questions/342604/how-to-sniff-request-packet-on-vpn-server
DMZ, nat preserve source ip
https://www.debian-administration.org/article/73/Port_forwarding_for_iptables_DMZ


2015年8月10日 星期一

apache php 接收 json

關鍵在apache的目錄必須開啟apache user讀寫權限。另外我遇到的狀況是傳送整個json檔案,因此必須使用json_decode函式將json file轉換成array才能進一步使用。
<?php
//header("Content-Type: application/json", true);

$filename = fopen('test.json', 'w');  //打開json暫存檔,'w'參數為每次打開皆清空檔案

if ( $_SERVER['REQUEST_METHOD'] === 'POST' ){ 
    $postText = file_get_contents('php://input'); 


fwrite($filename, $postText);  //寫入暫存檔
fclose($filename);  //關閉暫存檔

$url = "http://target.php";  //改成需要轉發的url

$data_decode = json_decode($postText);  //json格式解碼
$data_string = json_encode($data_decode);  //json格式編碼,這邊的目的是再將收到的json轉發出去                                                                                 
                                                                                                                     
$ch = curl_init($url);                                                                      
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");                                                                     
curl_setopt($ch, CURLOPT_POSTFIELDS, $data_string);                                                                  
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);                                                                      
curl_setopt($ch, CURLOPT_HTTPHEADER, array(                                                                          
    'Content-Type: application/json',                                                                                
    'Content-Length: ' . strlen($data_string))                                                                       
);                                                                                                                   
                                                                                                                     
$result = curl_exec($ch);


}

?>

上面的範例是當對方發送json過來時,將收到的json file再轉發到另一個url的webserver。
另外jquery必須將.js嵌入網頁,可由網路或本地端,之後才可以使用。

清除舊的ubuntu repository資料
sudo sed -i -e 's/archive.ubuntu.com\|security.ubuntu.com/old-releases.ubuntu.com/g' /etc/apt/sources.list
sudo apt-get update

參考資料

php curl post

http://stackoverflow.com/questions/15200632/how-to-upload-file-using-curl-with-php
http://askubuntu.com/questions/9293/how-do-i-install-curl-in-php5
https://www.digitalocean.com/community/questions/installing-curl-on-ubuntu-12-04
http://blog.derakkilgo.com/2009/06/07/send-a-file-via-post-with-curl-and-php/
http://reader.roodo.com/esabear/archives/16358749.html
http://blog.roodo.com/esabear/archives/16358749.html
http://stackoverflow.com/questions/19758954/get-data-from-json-file-with-php
http://markonphp.com/php-curl-basic-post-example/
http://www.lornajane.net/posts/2011/posting-json-data-with-php-curl

php receive post

http://stackoverflow.com/questions/938811/receive-xml-file-via-post-in-php
http://stackoverflow.com/questions/19004783/reading-json-post-using-php
http://stackoverflow.com/questions/15220704/how-to-detect-if-post-is-set
http://www.blog.magepsycho.com/sending-json-data-remote-server/
http://www.php.net/manual/en/function.json-decode.php
http://codex.wiki/post/166087-764/
http://josh.gourneau.com/blog/2010/11/16/serve-json-as-content-type-applicationjson-with-apache-on-ubuntu/
https://blog-ldkrsi.rhcloud.com/php%E6%8E%A5%E6%94%B6post%E4%BE%86%E7%9A%84json%E8%B3%87%E6%96%99/
http://www.j2h.tw/bbs/bbs16/519.html
http://phpwolf.blogspot.tw/2013/08/php-post-json.html
http://stackoverflow.com/questions/18866571/receive-json-post-with-php

POST測試

https://www.hurl.it/

jquery傳送資料給php,php再回傳

https://docs.google.com/document/d/1U0n01CVFllcpd5Irzk8999x8ALHck5M4vOJizA_mYvs/pub
http://italwaysrainonme.blogspot.tw/2013/02/jqueryjsonphp-phpjsonjquery.html
http://kinomelma.pixnet.net/blog/post/30403239-%5B%E8%B6%85%E7%B0%A1%E6%98%93%5D-jquery-json-%E6%A0%BC%E5%BC%8F%E6%8E%A5%E6%94%B6%E8%88%87%E5%88%86%E6%9E%90

android溝通

http://j796160836.pixnet.net/blog/post/28994669-%5Bandroid%5D-%E4%BD%BF%E7%94%A8http%E7%9A%84post%E6%96%B9%E5%BC%8F%E5%92%8C%E7%B6%B2%E9%A0%81%E8%A1%A8%E5%96%AE%E6%BA%9D%E9%80%9A

install jquery

http://stackoverflow.com/questions/1458349/installing-jquery
http://www.mkyong.com/jquery/jquery-html-example/
https://developers.google.com/speed/libraries/#jquery
http://www.mkyong.com/jquery/jquery-hello-world/
http://expect7.pixnet.net/blog/post/37919326-%5B%E7%A8%8B%E5%BC%8F%5D%5Bjquery%5D-jquery%E4%B8%AD%E7%9A%84ajax%E7%9A%84%E5%9F%BA%E7%A4%8E%E9%81%8B%E7%94%A8%E3%80%82%E6%8F%90%E4%BE%9B%E7%AF%84
http://blog.jex.tw/blog/2013/02/19/php-json/
http://www.mkyong.com/jquery/jquery-html-example/

php server上傳

http://givemepass.blogspot.tw/2013/06/php-server.html

php fwrite example

http://php.net/manual/en/function.fwrite.php

2015年2月3日 星期二

linux架站

當http://localhost/phpmyadmin出現404 not found時
#cd /var/www
#ln -s /usr/share/phpmyadmin

mysql new account

  • select
  • insert
  • update
  • create
  • alter
  • index
  • drop
  • reference
  • lock tables
drupal theme 教學
https://www.youtube.com/watch?v=6ekJOn2ocRE
https://drupal.org/node/83501

30個好用的themes
http://drupalchina.cn/node/1597

更改資料夾擁有者
sudo chown -R www-data:www-data /var/www/drupal
https://drupal.org/node/1036494

安裝smtp module讓mail功能正常
https://drupal.org/project/smtp
https://drupal.org/node/1108514


參考資料
https://drupal.org/project/drupal
https://drupal.org/documentation/install/create-database
http://altinukshini.wordpress.com/2011/01/09/how-to-install-drupal-7-on-linux/
http://shaurong.blogspot.tw/2014/01/drupal-726-centos-65-x64.html
https://www.youtube.com/watch?v=WBFqlgt7kuI
http://linadonis.pixnet.net/blog/post/27585552-ubuntu-server-%E5%AE%89%E8%A3%9D-phpmyadmin

Robot Framework

Regular Expression
在使用 Read Until Regexp 時,卡在$及 . 很久,研究的結果是,由於使用或 ( | ) 所以要轉義兩次,第一次轉義後由於仍在 ( | ) 內所以仍被當成regular expression看,故要再轉義一次。

所以最後結果是 (\\$|\\.txt)

在使用SSHLibrary抓取terminal內字串時遇到換行符號,本來以為是\n,結果試了不是,又試了轉義以及\r都不是,最後靈機一動,居然是\r\n,記錄在這邊,希望能夠幫到人。

SSHLibrary Open Connection
與Telnet不同,ssh open connection 必須同時使用open connection及login兩個keyword,原因應該是因為ssh連接時是使用username@ip。robot因考慮Telnet使用同一組Keyword所以造成此限制。另外AttributeError: 'NoneType'錯誤則是因為沒有輸入帳號密碼,也就是上面所說沒有配合使用login造成。

unbalanced parenthesis則是括號沒有配合到,我遇到的狀況是空了兩格造成robot將右括號視作另一個argument了

SSHLibrary.Read until regexp 我有遇到狀況是會卡住,即使timeout時間到也不會FAIL。後來使用Read交叉測試的結果是因為output內有不同的編碼所以decode時卡住。Read結果的錯誤訊息為
UnicodeDecodeError: 'utf8' codec can't decode byte 0x80 in position 318: invalid start byte
解決方法是close connection等到該段output被跳過之後再重新建立連線,換言之就是跳過該段output。另外也有一可能是整個編碼錯誤,如開始英文後轉為中文。此時可於open connection指定編碼encoding=

參考資料
自己測試結果
Read until regexp卡住
http://stackoverflow.com/questions/6180521/unicodedecodeerror-utf8-codec-cant-decode-bytes-in-position-3-6-invalid-dat
http://www.robotframework.net/question/68

phpmailer

參考資料
http://belleaya.pixnet.net/blog/post/27410978-%5B%E6%95%99%E5%AD%B8%5D-php-%E5%88%A9%E7%94%A8-phpmailer-%E9%80%8F%E9%81%8E-gmail-%E5%AF%84%E4%BF%A1
http://blog.jsdan.com/php-%E4%BD%BF%E7%94%A8phpmailer%E9%80%8F%E9%81%8Egmail%E5%AF%84%E4%BF%A1/
http://who-know.com/use-phpmailer-to-send-emails-via-gmail-smtp/
while try catch自動分行讀取
http://kris-14.blogspot.tw/2009/12/php-txt.html
http://phpwrite.blogspot.tw/2010/05/php5try-catch.html
fopen 檔案路徑寫法
http://www.php.net/manual/en/function.fopen.php
輸入及呼叫
http://www.dami.tw/2013/11/11phpcode.html
http://www.php5.idv.tw/html.php?mod=article&do=show&shid=54
http://www.php5.idv.tw/html.php?mod=article&do=show&shid=68
http://stackoverflow.com/questions/15890627/phpmailer-body-with-variables
php重複定義
http://witmax.cn/php-cannot-redeclare-class.html
html註解
http://ant4html.blogspot.tw/2008/11/blog-post.html
php運行時間限制以及後台運行
ignore_user_abort(true);
set_time_limit(0);
http://www.ptt.cc/man/PHP/DEAA/M.1359052474.A.47F.html
http://www.blueshop.com.tw/board/FUM20041006152627A9N/BRD2012020312083365R.html
http://www.allenj.net/archives/1910
http://blog.wu-boy.com/2007/06/php-%E5%96%84%E7%94%A8-ignore_user_abort-%E5%87%BD%E5%BC%8F/
http://www.isdee.com/notes/ecshop_phpmailer.html
http://hi.baidu.com/yxl7808/item/00b9ca9c85628ae62916471d
http://sourceforge.net/p/phpmailer/discussion/81620/thread/6819cd16/
清除收件者欄位
由於預設是用addaddress()所以當跑迴圈時會重複寄送
因此需使用clearaddresses()並且不能用unset(), unset只是暫時重設,下次再呼叫時會讀取unset前之數值
http://www.wibibi.com/info.php?tid=236
http://chan15.blogspot.tw/2011/11/phpmailer.html
textarea
使用input只有一行,因此一般的留言板都應該使用textarea
另外input可以設定長度跟高度,雖然還是只能輸入一行
http://stackoverflow.com/questions/4391344/how-can-i-set-the-size-of-the-box-of-a-form
http://crazy.molerat.net/learner/cpuroom/programmer/reading.php?filename=1010407112825.dov
http://www.php-example.com/2011/05/php-html-form-textarea-example.html
斷行處理
http://chensh.loxa.edu.tw/php/X_8.php
http://www.jollen.org/php/jollen_php_book_79_textarea.html
http://itgroup.blueshop.com.tw/ann71727/ann71727?n=convew&i=6032

java心得

java的變數不能使用數字開頭,否則會判斷為數字。

有關筆電透過無線網路及VPN觀看遠端區域網路影片斷線LAG及雜音問題

這個問題困擾我好久,並且每次在我播放影片時就會出現。經過測試發現斷線問題是因為無線網路切換問題,固定在802.11g就不會斷線,一開始還以為是VPN問題。另外LAG及雜音則應該是因為硬碟空間不足,所以在讀取時需要一邊清空間一邊播放造成LAG及有雜音,想說i5應該不會不夠力才對。剛剛測試把硬碟空間清出來就沒有再遇到相同問題,明天再測試一次就知道究竟是不是solution了。

更新:
換了一台筆電之後就沒問題,看來是Hardware issue

參考資料
11樓
http://www.mobile01.com/topicdetail.php?f=300&t=1347232&p=2

selenium download file, php

Download File [Arguments] ${COOKIE} ${URL} ${FILENAME} ${COOKIE_VALUE} = Call Selenium API get_cookie_by_name ${COOKIE} Run and Return RC wget --cookies=on --header "Cookie: ${COOKIE}=${COOKIE_VALUE}" -O ${OUTPUT_DIR}${/}${FILENAME} ${URL}

php POST變數.$_POST["item"]後方如果要接字必須以 "," or "." 隔開,否則會出錯

fopen file時在linux下會有權限問題,要注意需給予使用者read權限否則會無法讀取。

使用fgets取得txt資料時,會帶出行尾的特殊符號,以windows為例為\r\n。因此在做比對時,不論是使用==或strcmp()函數都需要先將這些特殊符號消去(或是在輸入端增加),才能成功比對。

我是使用ereg_replace("\r\n","",變數)來做。供參考。順帶一提,如果將\0消去則整個字串會消失。

想要驗證則可以使用strlen()函數來觀察字串的長度,就可以知道其實有特殊符號的存在。

最後apache的預設使用者是www-data(可去/etc/apache2/envvar修改),如果要使用fopen讀取檔案記得將www-data加到owner群組內,virtualbox shared folder共用資料夾則是要將www-data加到vboxsf群組內才可正常讀取。

#sudo gpasswd -a www-data vboxsf

#sudo usermod -G vboxsf www-data 有一樣效果

以下code可以查看group內成員
$ sudo grep ^群組名稱: /etc/group

過程中由於出錯使得apache內的log資料量暴增,一開始不知道只覺得硬碟空間怎麼消失這麼快,後來使用指令列出資料夾大小才找出來。max-depth是指只顯示一層,-B M是以MB表示,sort -g是照大小排列。

du -B M --max-depth=1 | sort -g

參考資料
自己經驗
https://blog.codecentric.de/en/2010/07/file-downloads-with-selenium-mission-impossible/
http://php.net/manual/en/function.shell-exec.php
http://stackoverflow.com/questions/2404794/strcmp-on-a-line-read-with-fgets
將ubuntu內資料夾所佔空間列出
http://banco.pixnet.net/blog/post/21967119-%5Bubuntu%5D-%E5%88%A9%E7%94%A8du%E6%90%AD%E9%85%8Dsort%E4%BE%86%E6%9F%A5%E7%9C%8B%E7%A3%81%E7%A2%9F%E4%BD%BF%E7%94%A8%E7%A9%BA%E9%96%93
fget
http://qaautomationworld.blogspot.in/2014/02/file-downlaoding-using-selenium.html
http://stackoverflow.com/questions/7618155/how-to-duplicate-a-request-using-wget-or-curl-with-raw-headers
https://addons.mozilla.org/zh-TW/firefox/addon/export-cookies/
http://stackoverflow.com/questions/4272770/wget-with-authentication

google apps script

Google apps sript 使用for loop處理簡單的寫入時會很慢,不像excel運算的速度。因此需要簡化程式,以參考資料為例即為將每格寫入轉換成一次寫入,速度會提升很多。

另外矩陣變數則是要用"[["開頭,"]]"結尾,另外如果需要用迴圈加入單元,可以用.push(),記得變數要用var 變數 = [];。google apps script的for是小寫,我試過用大寫會無法辨識,需要注意。

在尋找字串裡的"("時,由於"("是特殊字元,必須escape,而search本身也是regular express所以要再escape一次,故應寫成search("\\(")。此時的錯誤訊息會是SyntaxError: unterminated parenthetical。

同理在取代字串的時候也會遇到regular express的問題,因為是regexp所以只會取代找到的第一個,解決方法是直接使用regexp寫法,如replace(/,/g)可取代字串中所有","。

function的部分就是直接呼叫,如HelloWorld();

replace在spreadsheet內使用的話要寫.toString().replace()才能用。還有length在計算array內字元我遇過會出錯,記得最後再加上[]。

Invalid assignment left-hand side. 我遇到的狀況是comparison的問題,就是code裡該使用"=="的地方(判斷式)用成"="(變數assign)就會出現這個error。而且這個error的debug會抓錯地方一直顯示第一行錯,所以第一次遇到會不知道發生甚麼事,連存檔都無法。

另外還有遇到一個狀況是在使用importrange公式,跑完script後會無法正常update數值,查了一下好像也有人遇到同樣情形,在google修好之前只好先用script頂著先。現象是都不會更新,將該格公式更動,或刪除復原就可以正常更新。

參考資料
基礎
https://developers.google.com/apps-script/guides/bound#creating_a_bound_script
簡化程式
http://stackoverflow.com/questions/19120211/google-script-performance-slow-down
加入公式
http://stackoverflow.com/questions/12036726/how-do-i-add-formulas-to-google-spreadsheet-using-google-apps-script
Matrix
http://stackoverflow.com/questions/15783169/convert-string-to-matrix-array
search "("
http://stackoverflow.com/questions/3977351/javascript-search-fails-to-find
replace all
http://stackoverflow.com/questions/1144783/replacing-all-occurrences-of-a-string-in-javascript
javaScript運算子
http://taiwantc.com/js/js_tut_a4.htm
javaScript字串運算
http://miisoo.blogspot.tw/2008/01/javascript-string-operations.html
Invalid assignment left-hand side.
http://stackoverflow.com/questions/11888923/what-could-cause-invalid-assignment-left-hand-side-error-message-that-doesnt
importrange issue
http://stackoverflow.com/questions/25970185/importrange-function-not-refreshing-new-entries-in-linked-google-sheet
http://stackoverflow.com/questions/22587418/new-google-spreadsheet-formula-results-different-than-what-i-see-importrange-fu?rq=1

pfsense remote syslog and email notification

使用pfsense時,如果不想一直開著瀏覽器盯著,卻又想監控事件時該怎麼辦呢?

我們可以利用兩種方法,第一種是設定pfsense email alert,在system-advanced-notifications,設定smtp mail,設定完後按test smtp看是否設定成功,這個會在gateway down的時候email通知。

第二種則是使用status-system log-settings,設定remote syslog server,將log傳到另一台server上,就可以把log以文字檔形式儲存,再搭配之前提過的工作排程器或crontab,就可以將log發送到手機來監控囉。

以ubuntu為例,init.d下的rsyslog即為syslog server,pfsense傳過來的log則會存在/var/log/syslog下。記得要service rsyslog restart或重開機才會生效。

grep -Fxvf a b 可以秀出b有a沒有的字串

使用if -n -z可以判斷是否為空字串
範例
VAR="hello"
if [ -n "$VAR" ]; then
    echo "VAR is not empty"
fi

VAR=""
if [ -z "$VAR" ]; then
    echo "VAR is empty"
fi

要將結果傳至變數則要加上$()
範例
var="$(grep -Fxvf a b)"

bash regular expression的寫法範例
re="^([^-]+)-(.*)$"
[[ "ABCDE-123456" =~ $re ]] && var1="${BASH_REMATCH[1]}" && var2="${BASH_REMATCH[2]}"
echo $var1
echo $var2
這邊的${BASH_REMATCH[0]為全部[1]為第一個sub patteren以此類推
另外下次再做regxp舊的就會被洗掉,所以如果要留記得存變數
=~ 為比較regxp的operator
!~則是反義

ubuntu下寫bash時出現[[: not found的error message
找了老半天原來是ubuntu的問題

In Ubuntu, /bin/sh points to /bin/dash, not /bin/bash as is in Debian.


To change this, either update your script

Code:

#!/bin/bash
另外執行時前面加bash也有同樣效果ex. bash a.sh



參考資料
http://ubuntuforums.org/showthread.php?t=2200196
https://doc.pfsense.org/index.php/Advanced_Setup_(2.0)
https://www.safaribooksonline.com/library/view/pfsense-2-cookbook/9781849514866/apas04.html
比較檔案
http://stackoverflow.com/questions/14500787/comparing-two-files-in-linux-terminal
timmurphy.org/2010/05/19/checking-for-empty-string-in-bash/
http://stackoverflow.com/questions/4651437/how-to-set-a-bash-variable-equal-to-the-output-from-a-command
sendEmail
http://ubuntuforums.org/showthread.php?t=1127478
Bash regular expression
http://stackoverflow.com/questions/18709962/bash-regex-if-statement
http://stackoverflow.com/questions/10520623/how-to-split-one-string-into-multiple-variables-in-bash-shell
http://stackoverflow.com/questions/10486575/bash-how-to-take-a-number-from-string-regular-expression-maybe
http://stackoverflow.com/questions/19737675/shell-script-how-to-extract-string-using-regular-expressions
關於escape很清楚的一篇解釋
http://stackoverflow.com/questions/18709962/bash-regex-if-statement
ubuntu sh to bash
http://ubuntuforums.org/showthread.php?t=1159137
時間變數變成英文
http://askubuntu.com/questions/265753/how-to-change-date-time-format-to-english
時間變數
http://www.cyberciti.biz/faq/linux-unix-formatting-dates-for-display/

virtualbox vdi verr_not_supported

前幾天VM突然打不開,現象是媒體管理員顯示黃色驚嘆號,重新掛載也無法,錯誤訊息verr_not_supported,進階訊息是VBOX_E_IPRT_ERROR。本來查到是vdi內容版本與virtualbox不符,可是前一天還可用怎麼會突然就不行,後來找到vboxmanage command "VBoxManage internalcommands repairhd --format VHD --filename <image>"試著修復vdi結果居然顯示invalid header,只好再繼續找解法。既然是header出錯就想到應該是整個vdi檔損毀,但使用chkdsk修復硬碟卻也顯示硬碟沒問題,本來覺得大概無解了,沒想到找到一篇說把0000到01D0用正常的vdi檔頭覆蓋就可以,死馬當活馬醫之下還真的解決了!寫在這邊供參考。

使用的軟體是 HxD Hex Editor

參考資料
https://forums.virtualbox.org/viewtopic.php?p=29267#p29267
https://forums.virtualbox.org/viewtopic.php?f=6&t=46711
https://forums.virtualbox.org/viewtopic.php?f=6&t=44654#p201104
vboxmanage command
https://www.virtualbox.org/ticket/10785