發現在virtualbox下的guest OS也可以使用雙螢幕,需要安裝guest additions extension。首先在virtualbox設定-視訊-螢幕數量更改至需要的螢幕數量,重啟guest os之後很重要的是要關閉自動調整客體大小,之後才能在檢視-虛擬畫面裡面啟用,啟用之後就可以正常使用雙螢幕了,也可以再開啟自動調整客體大小。
參考資料
自己
https://forums.virtualbox.org/viewtopic.php?f=8&t=79211
https://superuser.com/questions/109485/virtualbox-to-use-dual-monitors
2019年7月24日 星期三
2018年7月26日 星期四
以netcat取代ping監測設備是否online
這兩天在寫一個程式需要判斷手機是否在線上,一開始使用ping結果後來經過不斷測試(測試過休眠時WIFI保持連線,wakelock,powersaver,power optimization)發現,android手機(我是samsung note 8)只要按電源鍵休眠五分鐘後就會進入doze mode會block ping造成判斷失誤。經過survey後找到可以使用netcat/nmap(後來發現nmap需要另外安裝,我只有使用nmap掃描)獲取手機狀態可得知是否在線。
nc -w 4 -vz <port> <ip>
以下是我試出來可以使用的幾個Port
8080
6101 tcp backupexec
6789 tcp ibm-db2-admin
8701 tcp unknown
9593 tcp cba8
9595 tcp pds
6789 tcp ibm-db2-admin
8701 tcp unknown
9593 tcp cba8
9595 tcp pds
另外由於port通常是close所以nc會是error,這個時候要把error save to file or variable需使用2>&1 std參數
20190131更新: 這幾天更新android後發現WIFI會連上又斷,經過檢查後確定問題應該出在android把我這個nc檢查的行為當成攻擊所以斷開wifi,經過加上sleep延長檢查時間後問題解決,我的機型是samsung note8,供參考。問題發生時好像會顯示不安全的網路及網路連線不可用,不太確定。
20190131更新: 這幾天更新android後發現WIFI會連上又斷,經過檢查後確定問題應該出在android把我這個nc檢查的行為當成攻擊所以斷開wifi,經過加上sleep延長檢查時間後問題解決,我的機型是samsung note8,供參考。問題發生時好像會顯示不安全的網路及網路連線不可用,不太確定。
參考資料
自己
自己
error output to file and variable
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下的規則
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
自己
出現錯誤訊息
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年10月5日 星期一
XFCE自動完成失效問題
在XFCE下ubuntu的tab自動完成失效,解決方法是修改xml file
.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-keyboard-shortcuts.xml
把下面改掉
<property name=”<Super>Tab” type=”string” value=”switch_window_key”/>
.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-keyboard-shortcuts.xml
把下面改掉
<property name=”<Super>Tab” type=”string” value=”switch_window_key”/>
改成這個
<property name=”<Super>Tab” type=”empty”/>
參考資料
https://241931348f64b1d1.wordpress.com/2012/05/04/shell-autocomplete-not-working-on-xrdp-xubuntu-12-04-xfce/
2014年7月22日 星期二
Virtualbox 共用資料夾無法symbolic link問題
在寫case的時候遇到無法建symbolic link的問題,顯示唯讀的檔案系統。搜尋了一下發現是virtualbox在win7上的問題,跟管理員權限與virtualbox要打開設訂有關。
參考資料
http://www.plumeqi.com/post/VirtualBox-shared-folder-symlin-error.html
http://ahtik.com/blog/2012/08/16/fixing-your-virtualbox-shared-folder-symlink-error/
http://gwokae.mewggle.com/wordpress/index.php/archives/1097
Fixing your virtualbox shared folder symlink error
August 16, 2012 by Ahti Kitsik
Operations such as installing node.js or python virtualenv to a virtualbox writable shared folder can fail if you try to do this as a linux (ubuntu) virtualbox guest running Windows 7 host.
The cause is symlink permission.
Typical error:
ln -fs out/Release/node node ln: failed to create symbolic link `node': Read-only file system
It can also be a “Protocol error”.
This happens even if your shared folder is writable.
Fix: Enable symlinks feature in VirtualBox
Run at cmd prompt:
- VBoxManage setextradata YOURVMNAME VBoxInternal2/SharedFoldersEnableSymlinksCreate/YOURSHAREFOLDERNAME 1
Verify by running:
- VBoxManage getextradata YOURVMNAME enumerate
If your user belongs to Administrators group then start VirtualBox with “Run as Administrator”!
上面的參數請視情況修改:
- c:\Oracle\VirtualBox\ : 這是VirtualBox的預設資料夾,如果安裝在不同資料夾,請自行修改。
- YOURVMNAME : 請修改為你要開啟的VM名稱。
- YOURSHAREFOLDERNAME :修改為VM設定中共用資料夾的名稱
參考資料
http://www.plumeqi.com/post/VirtualBox-shared-folder-symlin-error.html
http://ahtik.com/blog/2012/08/16/fixing-your-virtualbox-shared-folder-symlink-error/
http://gwokae.mewggle.com/wordpress/index.php/archives/1097
2014年2月25日 星期二
ubuntu菱形進不去系統,powerbutton直接關機,忽略錯誤及關閉自動檢查
出現F<10个菱形>I<8个菱形>S<8个菱形>M<6个菱形>時的解決方法
Press F to attempt to fix the errors, I to ignore, S to skip mounting, or M for manual recovery
出現 菱形 S 菱形 M 菱形
可以使用tune2fs設定檢查時機
可修改 /etc/default/rcS 內的FSCKFIX=yes可在fsck時自動yes修復不須確定
參考資料
http://forum.ubuntu.org.cn/viewtopic.php?t=386633&p=2848077
Powerbutton直接關機方法
圖形加速
http://www.ubuntu-tw.org/modules/newbb/viewtopic.php?topic_id=71872
windows關機前執行指令
http://ithelp.ithome.com.tw/question/10114763?tag=rt.rq
windows忽略錯誤及關閉自動修復
bcdedit /set {default} recoveryenabled no
bcdedit /set {default} bootstatuspolicy ignoreallfailures
(bcdedit /set {default} bootstatuspolicy displayallfailures) 啟用
http://www.i-so.org/disable-windows7-startup-repair.html
ubuntu關閉磁碟檢查
要進入開機選單在啟動時按住SHIFT
http://crunchbang.org/forums/viewtopic.php?pid=190573
http://forums.linuxmint.com/viewtopic.php?f=90&t=97550
https://help.ubuntu.com/community/Grub2
http://bbs.csdn.net/topics/390190378?page=1#post-393687150
http://neicole.blog.51cto.com/5621716/975581
http://tobalatech.blogspot.tw/2009/12/ubuntu-grub2.html
http://kenchio.wordpress.com/2012/05/24/20120524/
http://marvell1001.blogspot.tw/2012/09/grub-200-ubuntu-1204.html
Press S to skip mount or M for manual recovery
http://unix.stackexchange.com/questions/46628/not-able-to-lock-var-lib-dpkg-lock-read-only
tune2fs
http://wiki.debian.org.hk/w/Configure_regular_filesystem_check
fsck -y
http://askubuntu.com/questions/151025/how-can-i-make-fsck-run-non-interactively-at-boot-time
Press F to attempt to fix the errors, I to ignore, S to skip mounting, or M for manual recovery
出現 菱形 S 菱形 M 菱形
Press S to skip mount or M for manual recovery
進入terminal之後
輸入
export LC_ALL=en_US.UTF-8 (將語言改為英文就不會再出現菱形)
fsck.ext4 /dev/sda1 (改成你毀損的磁區)可以使用tune2fs設定檢查時機
tune2fs -c 2 /dev/sda1上述即為掛載兩次檢查fsck
可修改 /etc/default/rcS 內的FSCKFIX=yes可在fsck時自動yes修復不須確定
參考資料
http://forum.ubuntu.org.cn/viewtopic.php?t=386633&p=2848077
Powerbutton直接關機方法
1.- sudo gedit /etc/acpi/events/powerbtn
2.- Add # to comment line: #action=/etc/acpi/powerbtn.sh
3.- Add a new line: action=/sbin/poweroff
4.- Save file
5.- Open a console and type: sudo acpid restart
http://askubuntu.com/questions/66723/how-do-i-modify-the-power-options/84984#84984?newreg=f3d31f5e61b8490fb1d67db682319552圖形加速
http://www.ubuntu-tw.org/modules/newbb/viewtopic.php?topic_id=71872
windows關機前執行指令
http://ithelp.ithome.com.tw/question/10114763?tag=rt.rq
windows忽略錯誤及關閉自動修復
bcdedit /set {default} recoveryenabled no
bcdedit /set {default} bootstatuspolicy ignoreallfailures
(bcdedit /set {default} bootstatuspolicy displayallfailures) 啟用
http://www.i-so.org/disable-windows7-startup-repair.html
ubuntu關閉磁碟檢查
要進入開機選單在啟動時按住SHIFT
http://crunchbang.org/forums/viewtopic.php?pid=190573
http://forums.linuxmint.com/viewtopic.php?f=90&t=97550
https://help.ubuntu.com/community/Grub2
http://bbs.csdn.net/topics/390190378?page=1#post-393687150
http://neicole.blog.51cto.com/5621716/975581
http://tobalatech.blogspot.tw/2009/12/ubuntu-grub2.html
http://kenchio.wordpress.com/2012/05/24/20120524/
http://marvell1001.blogspot.tw/2012/09/grub-200-ubuntu-1204.html
Press S to skip mount or M for manual recovery
http://unix.stackexchange.com/questions/46628/not-able-to-lock-var-lib-dpkg-lock-read-only
tune2fs
http://wiki.debian.org.hk/w/Configure_regular_filesystem_check
fsck -y
http://askubuntu.com/questions/151025/how-can-i-make-fsck-run-non-interactively-at-boot-time
2014年1月13日 星期一
ubuntu virtualbox 共用資料夾 plexWatch, splashtop streamer, xrdp on ubuntu 13.10
接續上篇使用ubuntu設定plexwatch web時也遇到一些問題,整理如下。
參考資料
共用資料夾權限
http://ubuntuforums.org/showthread.php?t=1921707
http://www.mobile01.com/topicdetail.php?f=300&t=3122670
plexWatch on ubuntu
http://www.cyberciti.biz/faq/how-do-i-add-jobs-to-cron-under-linux-or-unix-oses/
https://github.com/ljunkie/plexWatch/blob/master/README.md
crontab
sudo gedit /etc/cron.d/anacron
http://askubuntu.com/questions/2368/how-do-i-set-up-a-cron-job
xrdp 灰畫面
http://c-nergy.be/blog/?p=4448
http://askubuntu.com/questions/266271/xubuntu-12-04-desktop-grey-with-no-icons
plexWatch email notification
https://forums.plex.tv/index.php/topic/72552-plexwatch-plex-notify-script-send-push-alerts-on-new-sessions-and-stopped/
ubuntu splashtop streamer on 13.10
https://support-splashtoppersonal.splashtop.com/entries/30097576-Splashtop-Streamer-on-Ubuntu-13-10
http://qiita.com/nyarla/items/4202ddb8e29e2d0ddd65
http://timothyandrewbarber.blogspot.tw/2011/02/finding-config-folder-in-ubuntu.html
RemoteBox
http://knobgoblin.org.uk/downloads.cgi
http://www.openfoundry.org/tw/foss-programs/8319--virtualbox-remotebox
http://www.ibm.com/developerworks/cn/linux/l-cn-remotebox/
http://www.openfoundry.org/tw/foss-programs/8319--virtualbox-remotebox
phpvirtualbox
http://www.arthurtoday.com/2011/11/windows-phpvirtualbox.html#.Usl3t_QW2tQ
http://blog.segmentfault.com/jifei/1190000000346904
vboxwebsrv.exe
https://forums.virtualbox.org/viewtopic.php?f=6&t=38449
http://nikolas.demiridis.gr/post/10280216759/how-to-run-vboxwebsrv-as-a-service-on-windows-2008
virtualbox rdp extension pack
http://www.virtualbox.org/manual/ch07.html#vbox-auth
ubuntu切換2D
http://www.mobileai.tw/2013/01/08/ubuntu-12-10-2d/
PlexWatch ip address必須與PMS在同一台電腦上(localhost)才可正常抓取
https://forums.plex.tv/index.php/topic/72552-plexwatch-plex-notify-script-send-push-alerts-on-new-sessions-and-stopped/page-21#entry483408
- virtualbox共用資料夾位置在/media
- 需要先將使用者加入群組
- virtualbox預設為vboxsf
- 終端機輸入指令sudo gpasswd -a 使用者帳號 vboxsf
- 在設定crontab工作時不要輸入使用者名稱
- twitter則需填入consumer_key, consumer_secret, access_token, access_token_secret四項,並且create my access token
- ubuntu軟體中心位置 /usr/bin/software-center
- remotebox不知為何無法成功使用,使用phpvirtualbox取代
- virtualbox如果要使用遠端控制(非windows內建的遠端桌面)則需安裝extension pack
- xrdp如果遇到灰色畫面無法進入則輸入以下指令,原因是gnome更動了設定
- sudo apt-get install xrdp
- sudo add-apt-repository ppa:xubuntu-dev/xfce-4.10
- sudo apt-get update
- sudo apt-get install xfce4
- echo xfce4-session >~/.xsession
- ubuntu上使用splashtop streamer需要輸入以下指令否則目前無法使用於13.10(官方尚未支援)
- sudo apt-get install aptitude
sudo aptitude update
sudo aptitude safe-upgrade - python /opt/splashtop-streamer/SRStreamer.pyc
- sudo aptitude install python-appindicator
參考資料
共用資料夾權限
http://ubuntuforums.org/showthread.php?t=1921707
http://www.mobile01.com/topicdetail.php?f=300&t=3122670
plexWatch on ubuntu
http://www.cyberciti.biz/faq/how-do-i-add-jobs-to-cron-under-linux-or-unix-oses/
https://github.com/ljunkie/plexWatch/blob/master/README.md
crontab
sudo gedit /etc/cron.d/anacron
http://askubuntu.com/questions/2368/how-do-i-set-up-a-cron-job
xrdp 灰畫面
http://c-nergy.be/blog/?p=4448
http://askubuntu.com/questions/266271/xubuntu-12-04-desktop-grey-with-no-icons
plexWatch email notification
https://forums.plex.tv/index.php/topic/72552-plexwatch-plex-notify-script-send-push-alerts-on-new-sessions-and-stopped/
ubuntu splashtop streamer on 13.10
https://support-splashtoppersonal.splashtop.com/entries/30097576-Splashtop-Streamer-on-Ubuntu-13-10
http://qiita.com/nyarla/items/4202ddb8e29e2d0ddd65
http://timothyandrewbarber.blogspot.tw/2011/02/finding-config-folder-in-ubuntu.html
RemoteBox
http://knobgoblin.org.uk/downloads.cgi
http://www.openfoundry.org/tw/foss-programs/8319--virtualbox-remotebox
http://www.ibm.com/developerworks/cn/linux/l-cn-remotebox/
http://www.openfoundry.org/tw/foss-programs/8319--virtualbox-remotebox
phpvirtualbox
http://www.arthurtoday.com/2011/11/windows-phpvirtualbox.html#.Usl3t_QW2tQ
http://blog.segmentfault.com/jifei/1190000000346904
vboxwebsrv.exe
https://forums.virtualbox.org/viewtopic.php?f=6&t=38449
http://nikolas.demiridis.gr/post/10280216759/how-to-run-vboxwebsrv-as-a-service-on-windows-2008
virtualbox rdp extension pack
http://www.virtualbox.org/manual/ch07.html#vbox-auth
ubuntu切換2D
http://www.mobileai.tw/2013/01/08/ubuntu-12-10-2d/
PlexWatch ip address必須與PMS在同一台電腦上(localhost)才可正常抓取
https://forums.plex.tv/index.php/topic/72552-plexwatch-plex-notify-script-send-push-alerts-on-new-sessions-and-stopped/page-21#entry483408
訂閱:
文章 (Atom)