Google
 

星期一, 12月 07, 2015

Raspberry PI 2 rsync backup server

 

sudo apt-get update && sudo apt-get upgrade

安裝rsync & samba

sudo apt-get install rsync samba

備份檔案至遠端主機

備份另一台Raspberry PI 2 Openelec資料

sudo mount -t cifs  -o username=root,password=xxxxx,domain=workgroup //192.168.1.47/data120g/recordings /media/data/recordings

同步資料後刪除Openelec 資料
rsync -avP –delete /media/data/recordings/ /media/data/records/

rsync -avP /media/data/recordings/ /media/data/records/

星期二, 11月 17, 2015

Raspberry Pi 2上安裝 Jupyter步驟

1.sudo apt-get -y install ipython-notebook

2.sudo apt-get -y install python-matplotlib python-scipy \
python-pandas python-sympy python-nose


3.開放遠端連線


ipython profile create nbserver


在python中產生密碼



from IPython.lib import passwd
passwd()


4.修改設定檔


/home/pi/.ipython/profile_nbserver/ipython_notebook_config.py


加入以下設定


c = get_config()
# Kernel config
c.IPKernelApp.pylab = 'inline'
# Notebook config
c.NotebookApp.ip = '*'
c.NotebookApp.open_browser = False
#hash 為剛才產生的密碼字串


c.NotebookApp.password = u'hash'
c.NotebookApp.port = 9999


啟動ipython notebook server


ipython notebook --config=/home/pi/.ipython/profile_nbserver/ipython_notebook_config.py


並將上述指令加到/etc/rc.local檔中,每次重開機時自動啟動ipython notebook

Raspberry Pi 2上安裝 Jupyter步驟

1.sudo apt-get -y install ipython-notebook
2.sudo apt-get -y install python-matplotlib python-scipy \
                 python-pandas python-sympy python-nose
3.開放遠端連線
ipython profile create nbserver
在python中產生密碼
from IPython.lib import passwd
passwd()
4.修改設定檔
/home/pi/.ipython/profile_nbserver/ipython_notebook_config.py
加入以下設定
c = get_config()
# Kernel config
c.IPKernelApp.pylab = 'inline'
# Notebook config
c.NotebookApp.ip = '*'
c.NotebookApp.open_browser = False
#hash 為剛才產生的密碼字串
c.NotebookApp.password = u'hash'
c.NotebookApp.port = 9999
啟動ipython notebook server
ipython notebook --config=/home/pi/.ipython/profile_nbserver/ipython_notebook_config.py
並將上述指令加到/etc/rc.local檔中,每次重開機時自動啟動ipython notebook


星期三, 10月 14, 2015

Oracle 11g forms 使用Java 1.7 plugin

修改formsweb.cfg設定檔

修改下面四個參數
jpi_download_page=http://java.sun.com/products/archive/j2se/7u60/index.html
jpi_classid=clsid:CAFEEFAC-0017-0000-FFFF-ABCDEFFEDCBA
jpi_codebase=http://java.sun.com/update/1.7.0/jinstall-7u60-windows-i586.cab#Version=1,7,0,60 (NOTE: This will prompt IE browsers to use only the latest JRE 7)
jpi_mimetype=application/x-java-applet;jpi-version=1.7.0_60

星期一, 6月 01, 2015

在MK808b Ubuntu 14.04上安裝Owncloud 8

1.

sudo add-apt-repository ppa:noobslab/apps

sudo apt-get update

sudo apt-get install owncloud

2.變更資料夾權限

sudo chown -R www-data:www-data /var/www/owncloud

3.啟用加密連線

sudo mkdir -p /etc/apache2/ssl

sudo openssl req -new -x509 -days 365 -nodes -out /etc/apache2/ssl/owncloud.pem -keyout /etc/apache2/ssl/owncloud.key

4.新增站台

sudo nano /etc/apache2/sites-enabled/owncloud.conf

<VirtualHost 192.168.1.41:80>

#### Redirect to port 443 ###
RewriteEngine on
ReWriteCond %{SERVER_PORT} !^443$
RewriteRule ^/(.*) https://%{HTTP_HOST}/$1 [NC,R,L]
#### End of Redirection configuration ###

DocumentRoot /var/www/html/owncloud/
<Directory /var/www/html/owncloud>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Require all granted
</Directory>

</VirtualHost>

<VirtualHost 192.168.1.41:443>

####Configuration for SSL #####
SSLEngine on
SSLCertificateFile /etc/apache2/ssl/owncloud.pem
SSLCertificateKeyFile /etc/apache2/ssl/owncloud.key
#### End of SSL Configuration ####

DocumentRoot /var/www/html/owncloud/
<Directory /var/www/html/owncloud>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Require all granted
</Directory>
</VirtualHost>


5.重新啟動apache2 service



sudo service apache2 restart



參考資料:



NoobsLab