https://www.cyberciti.biz/tips/linux-procfs-file-descriptors.html
https://www.cyberciti.biz/faq/linux-increase-the-maximum-number-of-open-files/
2017年10月3日 星期二
2017年10月2日 星期一
Install teamviewer on Ubuntu 14.04
Nothing to say.......
Just install this version
http://download.teamviewer.com/download/version_10x/teamviewer_i386.deb
Just install this version
http://download.teamviewer.com/download/version_10x/teamviewer_i386.deb
2017年9月23日 星期六
Synology surveillance + Android IP cam
群暉 Nas 有一項特別功能
能夠拿來監控網路攝影機(IP cam)
但我又不想花錢買貴鬆鬆的網路攝影機
所以拿舊的Android手機來使用
準備:
1. 群暉NAS的 Surveillance app
2. android手機的 ip cam app
3. 網路設定
步驟:
1. 設定網路
ps.圖
在以前設定中,我把中華電信數據機和AP小烏龜網路設定成不同網段,也就是兩個都用PPPoE自己撥接上網。而NAS接在數據機上,這樣會導致NAS跟android 手機拿到不同網段的IP ( 192.168.10.XXX 跟 192.168.5.XXX )。
ps.圖
現在必須要把要他們設定成同一個網段,才能確保adroid手機連線AP後拿到同網段的IP (都是192.168.10.XXX)。方法就是要把AP網路模式設定成 bridge 模式。只要是連接上AP的裝置,都會直接從數據機拿到 DHCP 分配的 IP 。
2. 安裝手機 ip cam
DroidCam Wireless Webcam
3. 安裝 Surveillance app
雖然這個軟體可以自己辨識一般 ip cam 的類型,但我使用的手機app只能提供一般的影像串流來源
2017年8月6日 星期日
QIYI adds-on, super repository
These are the adds-on I recently use for kodi.
Just come here to puts on record.
愛奇藝 plug-in
http://kodi-addons.club/addon/plugin.video.qiyi/2.2.7
Super repository
It includes many different adds-on in it
But I just try a little bit, not really deep looking.
https://superrepo.org/get-started/
Just come here to puts on record.
愛奇藝 plug-in
http://kodi-addons.club/addon/plugin.video.qiyi/2.2.7
Super repository
It includes many different adds-on in it
But I just try a little bit, not really deep looking.
https://superrepo.org/get-started/
2017年6月17日 星期六
Merge branch to master
If there 3 branch named "master" & "fixedBranch"
What you want to do: Merge "fixedBranch" to "master"
1. Under branch master
$ git checkout master
2. Merger
$ git merge fixedBranch
3. Remove branch
$ git branch -d fixedBranch
2017年6月16日 星期五
2017年6月11日 星期日
Deal with time
1. 目前系統時間(time stamp), 這會根據目前JVM的timeZone有所改
System.currentTimeMillis();
or
new Date().getTime();
2. 相對UTC 時區的offset (輸入的時間是為了要判斷是否為“日光節約”)TimeZone tz = TimeZone.getDefault();long offset = tz.getOffset(new Date().getTime());
REF
3. 根據給予的格式和時區,輸出相對的時間
DateFormat formatter = new SimpleDateFormatter("dd mm yyyy HH:mm:ss");
formatter.setTimeZone(TimeZone.getTimeZone("Europe/Stockholm"));
formatter.format(new Date().getTime());
REF
REF
4. Epoch to time
https://www.epochconverter.com/
2017年3月25日 星期六
Raspberry pi + Kodi (Krypton v1.7) + 中文化 全步驟
今天終於完成
一直以來想幫爸媽做的一件事
就是安裝好超容易操作的“影音播放器”XDD
(根本就是自己想玩玩)
主要功能是串流家裡NAS裡的影片到 Raspberry pi
再用家裡電視播放
(所以下面步驟不一定適用所有人)
os.....才幾個月沒有玩Kodi, 介面竟然大改進
器材
1. NAS (我是用Synology)
2. Raspberry pi (我是用 v3)
3. 藍芽鍵鼠組
4. 電視
===========
NAS
1. 開啟 sftp port 來分享檔案
2. 準備好你的影片 (廢話)
Raspberry pi
1. 安裝 Kodi
1.1 安裝Noobs 到你的 sd card
他是一種可以讓你選擇安裝許多不同作業系統的軟體
https://www.raspberrypi.org/downloads/noobs/
1.2 選擇LibreELEC
利用sd card 啟動 raspberry pi 之後,選擇 LibreELEC 來安裝 Kodi
2. 設定 Kodi (最麻煩的一步....)
2.1 控制畫面大小
System > Interface Settings > Skin > Zoom
如果發現畫面超過螢幕大小,可以用這個方法縮小一點
2.2 連線至 NAS
2.2.1 新增 media resource
Videos > Files > Add videos ex. 命名為 Home video
2.2.2 擷取資料庫
Videos > Files
右鍵按下 Home video
點選 Set content
The directory contents 改成 Movies , 再按 ok
就會開始擷取 Home video 內部的影片
2.2.3 之後就可以從首頁直接選擇電影
2.3 安裝中文字幕外掛
2.3.1 新增 file resource
System > File Manager > Add source
加入 http://fusion.tvaddons.ag/ ex. 命名為 Fusion
2.3.2 從 resource 安裝到 Kodi 資料庫
Add-ons > Install from zip file > Fusion (這就是新加入的) > kodi-repos > international
> chinese-repository-xbmc-addons-chinese-1.2.0.zip
2.3.3 從資料庫安裝到Kodi
Add-ons > Install from repository > Chinese add ons (這就是新加入的) > Subtitles
> Sub HD
2.3.4 現在中文字幕
只要在欣賞點電影時,按下右下角的字幕就可以下載網路上的繁體中文字幕檔了
2.4 調整為中文介面 (這兩步驟一定要照順序)
2.4.1 調整字體顯示方式
System > Interface Settings > Skin > Fonts > Arial base
2.4.2 更改介面為中文
System > Interface Settings > Regional > Language > Chinese (Traditional)
REFER
http://ferris2014.blogspot.tw/2014/07/xbmc-xbmc_1588.html
http://blog.just-cool.net/kodi/
https://ppkkkp.blogspot.com/2016/11/kodi-subtitle-addon.html
一直以來想幫爸媽做的一件事
就是安裝好超容易操作的“影音播放器”XDD
(根本就是自己想玩玩)
主要功能是串流家裡NAS裡的影片到 Raspberry pi
再用家裡電視播放
(所以下面步驟不一定適用所有人)
os.....才幾個月沒有玩Kodi, 介面竟然大改進
器材
1. NAS (我是用Synology)
2. Raspberry pi (我是用 v3)
3. 藍芽鍵鼠組
4. 電視
===========
NAS
1. 開啟 sftp port 來分享檔案
2. 準備好你的影片 (廢話)
Raspberry pi
1. 安裝 Kodi
1.1 安裝Noobs 到你的 sd card
他是一種可以讓你選擇安裝許多不同作業系統的軟體
https://www.raspberrypi.org/downloads/noobs/
1.2 選擇LibreELEC
利用sd card 啟動 raspberry pi 之後,選擇 LibreELEC 來安裝 Kodi
2. 設定 Kodi (最麻煩的一步....)
2.1 控制畫面大小
System > Interface Settings > Skin > Zoom
如果發現畫面超過螢幕大小,可以用這個方法縮小一點
2.2 連線至 NAS
2.2.1 新增 media resource
Videos > Files > Add videos ex. 命名為 Home video
2.2.2 擷取資料庫
Videos > Files
右鍵按下 Home video
點選 Set content
The directory contents 改成 Movies , 再按 ok
就會開始擷取 Home video 內部的影片
2.2.3 之後就可以從首頁直接選擇電影
2.3 安裝中文字幕外掛
2.3.1 新增 file resource
System > File Manager > Add source
加入 http://fusion.tvaddons.ag/ ex. 命名為 Fusion
2.3.2 從 resource 安裝到 Kodi 資料庫
Add-ons > Install from zip file > Fusion (這就是新加入的) > kodi-repos > international
> chinese-repository-xbmc-addons-chinese-1.2.0.zip
2.3.3 從資料庫安裝到Kodi
Add-ons > Install from repository > Chinese add ons (這就是新加入的) > Subtitles
> Sub HD
2.3.4 現在中文字幕
只要在欣賞點電影時,按下右下角的字幕就可以下載網路上的繁體中文字幕檔了
2.4 調整為中文介面 (這兩步驟一定要照順序)
2.4.1 調整字體顯示方式
System > Interface Settings > Skin > Fonts > Arial base
2.4.2 更改介面為中文
System > Interface Settings > Regional > Language > Chinese (Traditional)
REFER
http://ferris2014.blogspot.tw/2014/07/xbmc-xbmc_1588.html
http://blog.just-cool.net/kodi/
https://ppkkkp.blogspot.com/2016/11/kodi-subtitle-addon.html
2017年2月11日 星期六
2017年1月27日 星期五
KODI 繁體中文字幕外掛
最近新學到方法
以後看電影有快速中文字幕瞜!!!
網址:http://fusion.tvaddons.ag/
參考:http://ppkkkp.blogspot.tw/2016/11/kodi-subtitle-addon.html
另外有一個外掛可以直接串流網路上的電影
網址:http://silenthunter.000webhostapp.com/zip
參考:http://ppkkkp.blogspot.tw/2017/01/silent-hunter-kodi.html
這好像是Kodi的其他系列
https://www.mobile01.com/topicdetail.php?f=347&t=5046928
改天再來看看
以後看電影有快速中文字幕瞜!!!
網址:http://fusion.tvaddons.ag/
參考:http://ppkkkp.blogspot.tw/2016/11/kodi-subtitle-addon.html
另外有一個外掛可以直接串流網路上的電影
網址:http://silenthunter.000webhostapp.com/zip
參考:http://ppkkkp.blogspot.tw/2017/01/silent-hunter-kodi.html
這好像是Kodi的其他系列
https://www.mobile01.com/topicdetail.php?f=347&t=5046928
改天再來看看
2017年1月22日 星期日
Java class instance object relations
自己翻譯成好懂的說法
Class
直譯:類別
翻譯:範本,模型,藍圖
Instance
直譯:實例
翻譯:實體物品(非藍圖)
Object
直譯:物件
翻譯:東西
======
關係說明
Class <---> Instance
範本與非範本(實體化)的關係, 純粹用來表示範本與實體的概念
Object
好比現實世界中真實可以拿來使用的物品
Ex.
String s1 = new String
String s2 = new String
s1和 s2 這兩個object 是 class String 兩個各別的 Instance
Class
直譯:類別
翻譯:範本,模型,藍圖
Instance
直譯:實例
翻譯:實體物品(非藍圖)
Object
直譯:物件
翻譯:東西
======
關係說明
Class <---> Instance
範本與非範本(實體化)的關係, 純粹用來表示範本與實體的概念
Object
好比現實世界中真實可以拿來使用的物品
Ex.
String s1 = new String
String s2 = new String
s1和 s2 這兩個object 是 class String 兩個各別的 Instance
2017年1月14日 星期六
Install cheninese type keyboard
gcin !!!!!!!
1. $sudo apt-get install gcin
2. change keyboard input to "gcin"
2. log out and log in back to desktop
3. use the new keyboard type !
2016年12月18日 星期日
2016年12月15日 星期四
Mockito test framwork
1. tutorial
http://www.vogella.com/tutorials/Mockito/article.html
2. how to verify
http://www.baeldung.com/mockito-verify
3. how to spy
http://www.baeldung.com/mockito-spy
REFER
http://site.mockito.org/
http://www.vogella.com/tutorials/Mockito/article.html
2. how to verify
http://www.baeldung.com/mockito-verify
3. how to spy
http://www.baeldung.com/mockito-spy
REFER
http://site.mockito.org/
2016年12月4日 星期日
How to add certificate for SSL
I just joined a Hackthon recently, here is the node how I solve some problems.
1. check the certificate from a Web
$keytool -printcert -sslserver 10.2.5.2
2. get the certificate chain
$keytool -printcert -sslserver 10.2.5.2 -rfc
3. copy the message between header and footer in .crt file (ex. vm1.crt)
-----BEGIN CERTIFICATE-----
...
-----END CERTIFICATE-------
4. add the certificate in client's truststore
$keytool -import -file vm1.crt -alias vm1 -keystore xxx.truststore
($ input the password of keystore)
5. check the list of certificate you just added into truststore
$keytool -list -v -keystore xxx.truststore
REFER
http://doc.akka.io/docs/akka/2.4.4/scala/http/client-side/https-support.html
http://typesafehub.github.io/ssl-config/WSQuickStart.html#connecting-to-a-remote-server-over-https
https://docs.oracle.com/cd/E19509-01/820-3503/6nf1il6er/index.html
http://www.ibm.com/developerworks/library/j-customssl/sidebar.html
http://how2ssl.com/articles/working_with_pem_files/
http://stackoverflow.com/questions/8640340/how-do-i-get-into-a-non-password-protected-java-keystore-or-change-the-password
2016年11月12日 星期六
2016年11月8日 星期二
web cam server
Whole project come from
https://pimylifeup.com/raspberry-pi-webcam-server/
1. install "ffmpeg"
http://www.deb-multimedia.org/
http://ffmpeg.org/
2. install "libjpeg-turbo" for JPEG support
http://www.libjpeg-turbo.org/
http://www.linuxfromscratch.org/blfs/view/svn/general/libjpeg.html
3. install "motion"
https://github.com/Motion-Project/motion
4. enable /dev/video0
http://raspberrypi.stackexchange.com/questions/10480/raspi-camera-board-and-motion
$sudo modprobe bcm2835-v4l2
5. allow stream to other computer
$vim motion-dist.conf
replace "stream_localhost off" by "stream_localhost on"
5. execute motion camera server
$cd ~/mmal/motion-master
$sudo ./motion -n -c motion-dist.conf
6. link to web server by broswer
ex. IP:8081 (default port)
192.168.x.x:8081
7. you could also set up authentication for user to log in server
In motion-dist.conf
set "stream_auth_method 2"
set "stream_authentication username:password"
some open source
http://www.jvcref.com/files/PI/documentation/html/
https://www.ffmpeg.org/
camera available function from official web
https://www.raspberrypi.org/blog/camera-board-available-for-sale/
!!! RPi-cam-web-interface
http://elinux.org/RPi-Cam-Web-Interface
!!! pi car
https://github.com/shaunuk/picar
Find my raspberry on nerwork
https://www.raspberrypi.org/documentation/remote-access/ip-address.md
ex.
nmap -sn 192.168.1.0/24
1. Install namp in my Mac air
install brew first
http://brew.sh/index_zh-tw.html
install by brew
$brew install nmap
2016年10月9日 星期日
Set up network
1. network setting
(1) /etc/network/interfaces
=====
auto lo
iface lo inet loopback
auto eth0
iface eth0 inet dhcp
auto wlan0
iface wlan0 inet manual
wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
=====
(2) /etc/wpa_supplicant/wpa_supplicant.conf
=====
network={
ssid="mySSID"
psk="myPASSWD"
}
=====
(3) restart network interface
$ sudo ifdown wlan0
$ sudo ifup wlan0
=====
2. useful command
(1) ifconfig
(2) iwconfig
(3) sudo dhclient
(4) route -n
ex. route add default gw 192.168.1.1
(5) /etc/init.d/networking restart
(6) sudo ifdown/ifup wlan0
REFER
https://www.raspberrypi.com.tw/2152/setting-up-wifi-with-the-command-line/
http://raspberrypi.stackexchange.com/questions/14101/connect-network-is-unreachable-on-a-working-connected-wlan0-interface
http://www.cyberciti.biz/faq/linux-setup-default-gateway-with-route-command/
(1) /etc/network/interfaces
=====
auto lo
iface lo inet loopback
auto eth0
iface eth0 inet dhcp
auto wlan0
iface wlan0 inet manual
wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
=====
(2) /etc/wpa_supplicant/wpa_supplicant.conf
=====
network={
ssid="mySSID"
psk="myPASSWD"
}
=====
(3) restart network interface
$ sudo ifdown wlan0
$ sudo ifup wlan0
=====
2. useful command
(1) ifconfig
(2) iwconfig
(3) sudo dhclient
(4) route -n
ex. route add default gw 192.168.1.1
(5) /etc/init.d/networking restart
(6) sudo ifdown/ifup wlan0
REFER
https://www.raspberrypi.com.tw/2152/setting-up-wifi-with-the-command-line/
http://raspberrypi.stackexchange.com/questions/14101/connect-network-is-unreachable-on-a-working-connected-wlan0-interface
http://www.cyberciti.biz/faq/linux-setup-default-gateway-with-route-command/
訂閱:
文章 (Atom)


