- 下載新版本的檔案
- 點選所下載的檔案
- 按附圖的步驟操作
- 在「瀏覽」的地方指定到軟體所安裝的目錄後按下「安裝」後即可
2017年10月11日 星期三
2017年9月29日 星期五
利用 XnView 批次裁切固定範圍的圖檔
利用 XnView 批次裁切固定範圍的圖檔
- 決定 X,Y 軸的起始 (e.g. 0,524)
- 決定 像素 ( e.g. 2368*3714)
- XnView -> Tools -->Batch Processing -->Transformations->crop -->填入以上資料
2017年9月1日 星期五
VeraCrypt 自動掛載加密檔案的設定
作業系統登入後,VeraCrypt 自動掛載加密檔案的設定如下:
- 選取 Favorites
- 點選要自動掛載的最愛
- 勾選 Mount selected volume upon logon 項目
- Example1 : veracrypt /volume "F:\Temp\VeraCrypt_Files.dat" /letter X /c no /nowaitdlg /quit
- Example2 : veracrypt /volume "F:\Temp\VeraCrypt_Files.dat" /letter X /auto /password YourPassword /nowaitdlg /quit
- Example3 : "C:\Program Files\VeraCrypt\VeraCrypt.exe" /d /f /quit (強制卸載所有加密磁碟)
2017年8月10日 星期四
Raspberry Pi 安裝時,螢幕沒有HDMI介面與鍵盤時的做法
螢幕沒有HDMI介面與鍵盤時的做法,也不想額外花費購買轉接器時:
因為 2016.11 後的版本SSH 預設是未啟動的狀態。在利用 Win32DiskImager將 Image 複製到 SD卡後,可以在 SD 卡內的根目錄內放一個名稱為 SSH 的檔案(無副檔名)。再將這張處理好的 SD卡插入到 Raspberry裝置內。這樣就可以不用額外接著螢幕與鍵盤。可以直接透過 SSH來存取這台 Raspberry 裝置。
透過 SSH 連入此裝置 IP,預設登入預設帳密為:pi/ raspberry
安裝與相關資料整理
- 新增登入帳號與停用預設帳號
sudo adduser newaccount
// to lock the specified account
sudo passwd -l pi
//This is the reverse of the -l option
sudo passwd -u pi
//Adding new user with SUDO permission
nano /etc/sudoers.d/010_pi-nopasswd , edit content { pi ALL=(ALL) PASSWD: ALL}
- 調整以下事項:
sudo raspi-config
Change User Passwordsudo reboot
expand Filesystem
TimeZone
Change Locale (en_US.UTF8 UTF8 or zh_TW.UTF8 UTF8)
sudo apt-get update -y
sudo apt-get upgrade –y
sudo rpi-update (updating firmware , kernel module ...)
sudo apt-get autoremove
sudo apt-get autoclean
- 相關指令
//檢查已安裝的核心模組
lsmod
//設定系統自動校時
sudo timedatectl set-ntp yes
timedatectl
- 關閉藍芽與無線網路功能(因為專案沒使用這個)
sudo nano /boot/config.txt
# turn wifi and bluetooth off
dtoverlay=pi3-disable-wifi
dtoverlay=pi3-disable-bt
- 安裝要的服務
sudo apt-get install apache2 -y
sudo apt-get install php5 libapache2-mod-php5 –y
- Apache 監聽 port 修改
sudo nano /etc/apache2/ports.conf
sudo /etc/init.d/apache2 reload
- Apache htdocs 目錄權限調整
sudo chown -R youracccount:www-data /var/www
sudo chmod 775 /var/www
sudo usermod -a -G www-data youraccount(e.g. pi)
sudo reboot
- 額外用到的 PHP 模組
sudo apt-get install php5-sqlite -y
sudo apt-get install php5-curl -y
- sqlite 目錄權限調整
sudo chown -R youraccount:www-data sqlite/
sudo chmod 775 -R sqlite/
- 例行工作排程
crontab -e
Example
//10 分鐘自動執行 PHP Script
*/10 * * * * /usr/bin/curl -q http://localhost/your php code.php
- Raspberry 關機
sudo poweroff or sudo shutdown -h now
- 例行更新的腳本
#!/bin/sh
sudo apt-get update -y
sudo apt-get upgrade -y
sudo rpi-update
sudo apt-get autoremove
sudo apt-get autoclean
sudo reboot
Raspberry OS 版本升級方式 (Jessie 升級至 Stretch 步驟)
apt-get update -y
apt-get upgrade -y
apt-get dist-upgrade -y
sudo sed -i 's/jessie/stretch/g' /etc/apt/sources.list
apt-get update -y
apt-get upgrade -y
apt-get dist-upgrade -y
//check version
lsb_release -a
Raspberry 的其它應用
- 相關資料
- How to Setup a Raspberry Pi Without a Monitor or Keyboard
- Setting up an Apache Web Server on a Raspberry Pi
- How To Setup A Web Server On Your Raspberry Pi 10
- Scheduling tasks with Cron
- Securing your Raspberry Pi
- How to disable the Pi3's WLAN & Bluetooth ?
- cron jobs crontab 排程教學
- Raspberry Pi Auto Update (Updated)
- How to Write and Run a Shell Script on the Raspberry Pi
- 在樹莓派上設定 Crontab 的新方法
- Raspbian GNU/Linux upgrade from Jessie to Raspbian Stretch 9
- Upgrade Raspbian Jessie to Raspbian Stretch
- Debian 9 (stretch) 正式釋出
2017年7月24日 星期一
Let's Encrypt - Free SSL/TLS Certificates 申請
最近有一台主機需配合改走 SSL 協定。由於採購憑證也需要一點時間,暫時採用免費憑證先頂著。
申請的方式,按頁面的申請表單直接填寫。申請完成後會得到 3 個檔案。由於設定習慣的緣故,所以這有將 certificate.csr、private.key 重新命名為 server.csr、server.key 。將之上傳至指定目錄內後,再重新啟動 Apache 即可。
申請的方式,按頁面的申請表單直接填寫。申請完成後會得到 3 個檔案。由於設定習慣的緣故,所以這有將 certificate.csr、private.key 重新命名為 server.csr、server.key 。將之上傳至指定目錄內後,再重新啟動 Apache 即可。
2017年4月11日 星期二
MySQL 更新 5.6.36 版本出現 MSVCR100.dll 問題
這是第一次在做同版次更新升級時出現無法順利啟動的狀況。手動執行啟動 mysql 時會出現 MSVCR100.dll問題。目前狀況不明,先註記一下。
查了一下相關資料,目前看來是再安裝 Visual C++ 2010 即可解決此問題。但怪的是以前的版本更新都不會出現這種問題。
後來查一下官方手冊,在 5.6版本是需要有 Visual C++ 2010 。
但真的蠻奇怪的是原本服務的主機本來就沒有安裝Visual C++ 2010 而且也運作多年了,這時才出現這個狀況確實蠻妙的。
先切換回前版本,後續再視狀況看看要不要升級至 5.6.36版本。
106.07.18 後續追蹤:升級 5.6.37版本仍有相同的問題。另外安裝Visual C++ 2010 後也確實解決該狀況。
相關資料:
查了一下相關資料,目前看來是再安裝 Visual C++ 2010 即可解決此問題。但怪的是以前的版本更新都不會出現這種問題。
後來查一下官方手冊,在 5.6版本是需要有 Visual C++ 2010 。
但真的蠻奇怪的是原本服務的主機本來就沒有安裝Visual C++ 2010 而且也運作多年了,這時才出現這個狀況確實蠻妙的。
先切換回前版本,後續再視狀況看看要不要升級至 5.6.36版本。
106.07.18 後續追蹤:升級 5.6.37版本仍有相同的問題。另外安裝Visual C++ 2010 後也確實解決該狀況。
相關資料:
- windows server 2012 安裝 mysql connector 遺失MSVCR100.dll 問題
- 裝MySQL ODBC 5.2錯誤 – Error 1918
- MySQL Forums :: MySQL Workbench :: The program can't start because MSVCR100.dll is missing from your computer. Try reinstalling the program to fix this problem.
- WAMP shows error 'MSVCR100.dll' is missing when install
2017年1月20日 星期五
Content Security Policy 資料整理
- Apache 設定參考
- 調整 httpd.conf 將 LoadModule headers_module modules/mod_headers.so 啟用
- 加入以下腳本 example
<IfModule mod_headers.c>
Header set X-Frame-Options "SAMEORIGIN"
Header set Frame-Options "SAMEORIGIN"
#Header set Content-Security-Policy "default-src 'self'"
##Allow Google Analytics, Google AJAX CDN and Same Origin ......
Header set Content-Security-Policy "default-src 'self' 'unsafe-eval' 'unsafe-inline' www.google-analytics.com www.google.com www.gstatic.com *.lib.nthu.edu.tw;"
</IfModule>
P.S. Header set X-Frame-Options "ALLOW-FROM http://host1 ,http://host2"
訂閱:
文章 (Atom)