2014年4月23日 星期三

我的ubuntu 14.04

042414
使用現有最新約5年前的nb及pc,安裝32, 64及gnome 64,參考[教學] Ubuntu 14.04的調校http://www.ubuntu-tw.org/modules/newbb/viewtopic.php?topic_id=85988&forum=2&post_id=317968#forumpost317968
只安裝有用到的,我未安裝桌面環境設定工具「dconf-editor」,改用unity-tweak tools,(050114),摘要如下:
預設輸入法的起始狀態為輸入中文,假如對此感到困擾,
請按「系統設定值>文字輸入>+>漢語>加入」,然後將「漢語」移到第一位,使預設輸入法為系統鍵盤配置(亦即英文)。
參考14.04LTS 安裝GCIN後無法順利運行http://www.ubuntu-tw.org/modules/newbb/viewtopic.php?topic_id=86506&forum=22&post_id=318138#forumpost318138
摘要如下:3樓
ellu大的教學加上軟體源更新吧
http://hyperrate.com/thread.php?tid=28044
$ sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 835AB0E3
$ software-properties-gtk
到 Other software (其他軟體) → Add

APT line : deb http://hyperrate.com/debian eliu release

會加入兩列,把 gcin source code 那個取消掉,目前 沒有提供 source,沒弄會造成錯誤。
$ sudo apt-get update
$ sudo apt-get install gcin

Unity: 右上角的齒輪→系統設定值→語言支援→鍵盤輸入法系統→gcin
或是執行 /usr/bin/gnome-language-selector→鍵盤輸入法系統→gcin
如果是用 Unity,還需要需要執行&設定 gcin-tools→外觀設定→面板狀態→Unity Indicator

※101915
今日重裝14.04,裝好且更新後,直接由synaptic裝gcin(含行列及日文輸入)後移除ibus後,由右上角車輪→系統設定值→(會有不全顯示)sudo apt-get install unity-control-center→請參考 

在某些情況下發生Ubuntu 的系統設定值裡面的工具都消失 ...

即可,因目前14.04的gcin已正常使用了

092715寫在ubuntu-tw.org
ubuntu 14.04 64位元,輸入密碼後顯示"未能啟動作業皆段"
google 找How to solve “failed to load session “Ubuntu””
摘要如下:
...
Repair attempt.
Please open tty (virtual console, text mode only): ctrl+alt+f1
Enter:
sudo apt-get update
sudo apt-get install ubuntu-desktop
sudo apt-get -f install
sudo dpkg-reconfigure ubuntu-desktop
sudo reboot


※042514
現用行列輸入,但無法輸入日文,開機顯示無anthy-module.so
參考http://yugzan.blogspot.tw/2013/12/ubuntu-1204-gcin-install.html
最下
sudo apt-get install libanthy-dev

sudo apt-get install gcin-anthy

即可
※073114更新
近幾天更新gcin後造成日文無法輸入,又改回用hime,只有右上不會顯示輸入法而已,我還是用回hime,比gcin穩

另加my-weather-indicator在google找deb安裝

※051314
virtualbox 共享usb請看
ubuntu 14.04/12.04如何在VirtualBox虛擬機使用usb及guest addition

052614參考取自
如何取消自動跳出的文件檢視器
到 ~/.config/autostart/ 檢查看看

052714參考取自http://forum.ubuntu.org.cn/viewtopic.php?f=95&t=459650
14樓(※目前未測試,sdaX請自行確定要備分的是 / or /home
备份系统:
代碼:
sudo su
cd /
tar -cvpzf /media/sda7/backup.tgz --exclude=/proc --exclude=/lost+found --exclude=/mnt --exclude=/sys --exclude=/media /
恢复备份:
代碼:
tar -xvpzf /media/sda7/backup.tgz -C /

※070714 如何開啟及播放含vob的dvd光碟
先用Brasero將dvd的/VIDEO_TS下的vob大檔copy到/home/user(你)或其他任一目錄,→光碟複製(C)→安裝缺少的libdvdcss.so.2後即可完成iso檔,再由vlc等播放
以上參考取自How to create a DVD rip/ISO? [duplicate]

※071614
Dictation-Online Speech Recognition
https://dictation.io/
希望你會使用→聽到或錄下由此自行翻譯

※092114
flightradar24.com→如果你常出國或可追蹤親人朋友的目前航機實況

101414
如果還不知如何看土豆請google即可解決,xbmc內的也不行,或太老舊了。

※102314
在ubuntu 14.04安裝Soptify,參考取自
http://ubuntuhandbook.org/index.php/2014/04/install-spotify-ubuntu-14-04/
摘要如下:
1. Search for and open the “Software & Updates” utility from Unity Dash.
2. Under “Other Software” tab, click the Add button and paste the below line into the pop-up box:
deb http://repository.spotify.com stable non-free
add spotify repository ubuntu
Click on Add Source button and then you’ll have Spotify repository in your system.
3. Press Ctrl+Alt+T on keyboard to open the terminal. When it opens, paste the command below and hit run to get the keyring:
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 94558F59
Type in your password when prompt.
4. Now you’re able to install the client app using Synaptic Package Manager, or by running the commands below one by one:
sudo apt-get update

sudo apt-get install spotify-client
You may download & install the .deb package from the web page if you don’t like to add the PPA.
不必回windows使用soptify

※111814
摘要如下http://www.tecmint.com/rename-multiple-files-in-linux/
Rename – A Command Line Tool For Renaming Multiple Files in Linux
We often use “mv” command to rename a single file in Linux. However, renaming multiple or group of files quickly makes it very difficult task in a terminal.
Linux comes with a very powerful built-in tool called rename. The rename command is used to rename multiple or group of files, rename files to lowercase, rename files to uppercase and overwrite files using perl expressions.
Rename Multiple Files In Linux
The “rename” command is a part of Perl script and it resides under “/usr/bin/” on many Linux distributions. You can run “which” command to find out the location of rename command.
$ which rename
/usr/bin/rename
The Basic Syntax of Rename Command
rename 's/old-name/new-name/' files
The rename command comes with few optional arguments along with mandatory perl expression that guides rename command to do actual work.
rename [ -v ] [ -n ] [ -f ] perlexpr [ files ]
  1. -v: Print names of files successfully renamed.
  2. -n: Show what files would have been renamed.
  3. -f: Force overwrite existing files.
  4. perlexpr: Perl Expression.
For better understanding of this utility, we’ve discussed few practical examples of this command in the article.

1. A Basic Rename Command Example

Suppose you’ve bunch of files with “.html” extension and you want to rename all “.html” files to “.php” at one go. For example, first do a “ls -l” to check the list of files with “.html” extension.
# ravisaive@tecmint:~$ ls -l
total 22532
-rw-rw-r-- 1 ravisaive ravisaive 6888896 Oct 10 12:10 cricket.html
-rw-rw-r-- 1 ravisaive ravisaive  588895 Oct 10 12:10 entertainment.html
-rw-rw-r-- 1 ravisaive ravisaive 6188895 Oct 10 12:10 health.html
-rw-rw-r-- 1 ravisaive ravisaive 6538895 Oct 10 12:10 lifestyle.html
-rw-rw-r-- 1 ravisaive ravisaive  938895 Oct 10 12:10 news.html
-rw-rw-r-- 1 ravisaive ravisaive  938937 Oct 10 12:11 photos.html
-rw-rw-r-- 1 ravisaive ravisaive  978137 Oct 10 12:11 sports.html
Now, you want to change the extension of all these files from “.html” to “.php“. You can use the following “rename” command with perl expression as shown below.
ravisaive@tecmint:~$ rename 's/\.html$/\.php/' *.html
Note: In the above command we’ve used two arguments.
  1. First argument is a perl expression that substitute .html with .php.
  2. Second argument tells the rename command to substitute all the files with *.php.
Let’s verify whether all files are renamed to “.php” extension, doing ls -l on the prompt.
ravisaive@tecmint:~$ ls -l
total 22532
-rw-rw-r-- 1 ravisaive ravisaive 6888896 Oct 10 12:10 cricket.php
-rw-rw-r-- 1 ravisaive ravisaive  588895 Oct 10 12:10 entertainment.php
-rw-rw-r-- 1 ravisaive ravisaive 6188895 Oct 10 12:10 health.php
-rw-rw-r-- 1 ravisaive ravisaive 6538895 Oct 10 12:10 lifestyle.php
-rw-rw-r-- 1 ravisaive ravisaive  938895 Oct 10 12:10 news.php
-rw-rw-r-- 1 ravisaive ravisaive  938937 Oct 10 12:11 photos.php
-rw-rw-r-- 1 ravisaive ravisaive  978137 Oct 10 12:11 sports.php
Now you can see above that all the html files are renamed to php.

2. Check Changes Before Running Rename Command

While doing critical or major renaming tasks, you can always check the changes by running rename command with “-n” argument. The “-n” parameter will tell you exactly what changes would take place, but the changes are not done for real. Here, is the example of the command below.
ravisaive@tecmint:~$ rename -n 's/\.php$/\.html/' *.php

cricket.php renamed as cricket.html
entertainment.php renamed as entertainment.html
health.php renamed as health.html
lifestyle.php renamed as lifestyle.html
news.php renamed as news.html
photos.php renamed as photos.html
sports.php renamed as sports.html
Note: The above command output only displays changes, but in real the changes are not done, unless you run the command without “-n” switch.

3. Print Rename Output

We saw that the rename command didn’t displayed any information of changes it does. So, if you want to get the details of rename command (like we did using “-n” option), here we use “-v” option to print the complete details of all the changes done by rename command successfully.
ravisaive@tecmint:~$ rename -v 's/\.php$/\.html/' *.php

cricket.php renamed as cricket.html
entertainment.php renamed as entertainment.html
health.php renamed as health.html
lifestyle.php renamed as lifestyle.html
news.php renamed as news.html
photos.php renamed as photos.html
sports.php renamed as sports.html

4. Convert all Lowercase to Uppercase and Vise-Versa

To batch rename all files with lower case names to upper case. For example, I want to covert all these following files from lower to upper case.
Lower to Upper Case
ravisaive@tecmint:~$ ls -l
total 22532
-rw-rw-r-- 1 ravisaive ravisaive 6888896 Oct 10 12:10 cricket.html
-rw-rw-r-- 1 ravisaive ravisaive  588895 Oct 10 12:10 entertainment.html
-rw-rw-r-- 1 ravisaive ravisaive 6188895 Oct 10 12:10 health.html
-rw-rw-r-- 1 ravisaive ravisaive 6538895 Oct 10 12:10 lifestyle.html
-rw-rw-r-- 1 ravisaive ravisaive  938895 Oct 10 12:10 news.html
-rw-rw-r-- 1 ravisaive ravisaive  938937 Oct 10 12:11 photos.html
-rw-rw-r-- 1 ravisaive ravisaive  978137 Oct 10 12:11 sports.html
Just, use the following command with perl expression.
ravisaive@tecmint:~$ rename 'y/a-z/A-Z/' *.html
Once you’ve executed the above command, you can check the changes by doing “ls -l“.
ravisaive@tecmint:~$ ls -l
total 22532
-rw-rw-r-- 1 ravisaive ravisaive 6888896 Oct 10 12:10 CRICKET.HTML
-rw-rw-r-- 1 ravisaive ravisaive  588895 Oct 10 12:10 ENTERTAINMENT.HTML
-rw-rw-r-- 1 ravisaive ravisaive 6188895 Oct 10 12:10 HEALTH.HTML
-rw-rw-r-- 1 ravisaive ravisaive 6538895 Oct 10 12:10 LIFESTYLE.HTML
-rw-rw-r-- 1 ravisaive ravisaive  938895 Oct 10 12:10 NEWS.HTML
-rw-rw-r-- 1 ravisaive ravisaive  938937 Oct 10 12:11 PHOTOS.HTML
-rw-rw-r-- 1 ravisaive ravisaive  978137 Oct 10 12:11 SPORTS.HTML
You can see that the above command actually renamed all the lower case file names (with .HTMLextension) to upper case.
Upper to Lower Case
Similarly, you can also convert all upper case characters to lower case using the following command.
ravisaive@tecmint:~$ rename 'y/A-Z/a-z/' *.HTML
ravisaive@tecmint:~$ ls -l
total 22532
-rw-rw-r-- 1 ravisaive ravisaive 6888896 Oct 10 12:10 cricket.html
-rw-rw-r-- 1 ravisaive ravisaive  588895 Oct 10 12:10 entertainment.html
-rw-rw-r-- 1 ravisaive ravisaive 6188895 Oct 10 12:10 health.html
-rw-rw-r-- 1 ravisaive ravisaive 6538895 Oct 10 12:10 lifestyle.html
-rw-rw-r-- 1 ravisaive ravisaive  938895 Oct 10 12:10 news.html
-rw-rw-r-- 1 ravisaive ravisaive  938937 Oct 10 12:11 photos.html
-rw-rw-r-- 1 ravisaive ravisaive  978137 Oct 10 12:11 sports.html

5. Overwrite Existing Files

If you would like to forcefully overwrite existing files, use the “-f” option as shown below.
ravisaive@tecmint:~$ rename -f 's/a/b/' *.html
If you would like to know more about rename command, type the “man rename” in the terminal.
The rename command is very useful, if you are dealing with multiple or batch renaming of files from the command line. Do give a try and let me know, how far is useful in terms of renaming of files.
※我留用尚未測試

120614  系統更新gcin 2.8.2後。日文輸入已正常,但中文行列在選字時仍有破裂出現,現仍續用漢音輸入法。

051015 綜合所得稅 32位元版適用
如往年皆由xp完成,今年因已退休1年,參考取自用Ubuntu任何一版來申報綜合所得稅網路報稅
1樓,摘要如下:
項目三. 用你的讀卡機
●如果你的登入方式不是自然人憑證IC卡,就不需操作此項目的步驟! 
只要你的讀卡機有提供Linux版本的驅動程式就可以快速安裝起來,例如市面上大多數人使用的虹堡EZ100PU讀卡機,在該公司的下載網頁就有提供Linux(32/64bit)的驅動程式,安裝步驟略述如下(以32bit為例): 
步驟1.安裝pcsc-lite套件,在終端機下指令: 
sudo apt-get install pcsc-tools pcscd←一定要裝

步驟2.安裝EZ100PU讀卡機驅動程式,以驅動程式v1.5.3版本為例: 
在http://www.castech.com.tw/in-download-02.aspx?cid=C_00000001&id=P_00000001 下載
(1)下載的壓縮檔裡面有2個zip檔案,只要解開32bit版本EZUSB_Linux_x86_v1.5.3.zip裡面的EZUSB_Linux_x86_v1.5.3整個資料夾解出來。 
(2)用Nautilus檔案總管切換到解出來的資料夾,再進到driver_ezusb_v1.5.3這個資料夾,裡面的creadme.txt就是中文的安裝說明,繼績進行以下步驟。 
(3)一定要在這3個檔名(check_env,install,driver_install)點右鍵,屬性,權限,要勾選「允許檔案作為程式執行」,關閉。或是在終端機用「chmod 777 檔名」先改為可執行,在安裝的時候才不會出現某個檔案 Permission denied 的錯誤訊息。 
(4)在終端機的視窗切換到driver_ezusb_v1.5.3這個資料夾,執行環境檢測,指令如下: 
./check_env
(或是 sudo ./check_env) 必須沒有任何error才可以繼續 
(5)執行安裝程式
sudo ./install
必須看到Reader Installation Successfully的訊息,而且沒有任何error才表示安裝成功 
(6)讓Ubuntu每次開機能自動偵測,執行指令: 
sudo ldconfig
(7)重新開機 
步驟3.測試讀卡機是否已連線 :
(1)確認讀卡機的USB線已接電腦 
(2)在終端機下指令查看是否已正常連線: 
sudo pcsc_scan
●如果有出現你的讀卡機型號 (例如 Reader 0: CASTLES EZ100PU 00 00) 就表示已偵測到讀卡機且連線了。 
項目四. 安裝中華電信自然人憑證登入plugin
●如果你的登入方式不是自然人憑證IC卡,就不需操作此項目的步驟! 
執行Firefox連到財政部電子申報繳稅服務首頁-->綜所稅結算申報-->電子申報程式-->線上申報 -->把自然人憑證IC卡插入讀卡機-->使用自然人憑證IC卡登入-->輸入身分證號碼及PIN碼-->下一步 -->出現需先安裝中華電信自然人憑證登入plugin,按確定-->才會出現安裝憑證的下載畫面-->點選Install plugin for Linux OS -->把npHiPKIClient-linux.xpi儲存檔案,放在你指定的資料夾裡。 
步驟4.安裝修改後的npHiPKIClient-linux.xpi 
啟動Firefox-->把剛才修改後的npHiPKIClient-linux.xpi用滑鼠按住拖放進Firefox的視窗裡-->立刻安裝 
由http://www.tax.nat.gov.tw/info_IRX_download.html?id=1 線上申報
個人己先由xp完成,再以此測試,明年將先用此申報。

※052416更新
月初告知國稅局ubuntu 14.04/16.04皆不能用,並寄出說明,昨天接到電話已可,再試結果如下:ubuntu 16.04(32/64)皆不行ubuntu 14.04(32)要重裝(為Firefox安裝支援Flash、JAVA的外掛程式→sudo apt-get install flashplugin-installer icedtea-plugin)且不更新才可以。原因Firefox v46會封鎖npHiPKIClient-linux.xpi,重裝後的Firefox版本為28。
現使用中的ubuntu 14.04(32) 且都有更新,Firefox降版28後不行,降版法google找
找http://askubuntu.com/questions/500644/how-to-downgrade-firefox-from-30-to-28
找firefox-mozilla-build_28.0-0ubuntu1_i386.deb下載
摘要如下:
sudo apt-cache show firefox | grep Version
to get a list of available Firefox versions. On my 14.04 it results:

Version: 32.0+build1-0ubuntu0.14.04.1 (46)
Version: 28.0+build2-0ubuntu
Next tell APT exactly which version to install:
sudo apt-get purge firefox
下載的firefox 28用軟体中心安裝,移除hunspell-en-us, Firefox Extension
啟用firefox 28

另法不再更新firefox,適用於以下不更新46版以後,明年應仍可用。
Next you have to tell APT not to upgrade to the newer version again. According tohttp://askubuntu.com/a/18656/22865 there are many ways to do it, I chose:
sudo apt-mark hold firefox
Once you want to let go of your Firefox 28 and follow the usual releases again, just do:
sudo apt-mark unhold firefox
sudo apt-get upgrade
Alternatively, you can list the available versions with:
apt-cache policy firefox
最後顯示"無法載入IC卡函式庫檔案-函式失敗6"
以上各測16(32/64)及14(32)重裝/降版 2台。未測用戶口名簿戶號

使用16(32/64)及14(32/64)Firefox不降版→參考用Ubuntu任何一版來申報綜合所得稅網路報稅45樓,摘要如下:
解決方式是:
在Firefox網址列輸入about :config page  然後確定自己會小心。
接著搜尋xpinstall.signatures.required這個項目,把數值改為false,重開火狐之後,應該就可以安裝中華電信沒有去跟火狐認證註冊的外掛npHiPKIClient-linux.xpi  不過,這個臨時方案,在47版之後將無法使用。
詳情於下方連結:
https://support.mozilla.org/en-US/kb/add-on-signing-in-firefox
Override add-on signing (advanced users)
You can temporarily override the setting to enforce the add-on signing requirement by changing the preference xpinstall.signatures.required to false in the Firefox Configuration Editor (about :config page). Support is not available for any changes made with the Configuration Editor so please do this at your own risk. Signing will be mandatory with no override, in Firefox 47 beta and release versions. For details, see this Mozilla blog.


051415
參考留用,取自
12樓
>二、網路交易系統:
>讓客戶可以透過網路下訂單。
最省錢又省心的方案: 去 pchome 商店街吧
金流、物流它都幫你想好了,又不用自己架站,一次性費用,終身可用。
16樓

052115
MuseScore 2.0安裝
參考取自

'MuseScore' 2.0 in Ubuntu 14.04 - UbuntuHandbook

摘要如下:
sudo add-apt-repository -y ppa:mscore-ubuntu/mscore-stable
sudo apt-get update
sudo apt-get install musescore

080215
Line在linux取自 http://www.ubuntu-tw.org/modules/newbb/viewtopic.php?topic_id=100566&forum=7&post_id=344176#forumpost344176
摘要如下:現在終於有機會可在linux底下用Line了

參考頁面:
https://briian.com/30135/line_for_chrome.html

簡單說:使用chrome,去它的線上商店找Line來安裝吧。
※測試可,要有換機密碼即可用(080215)

112115
BT請安裝qBittorent
找有此功能的網站,如Mxx→找下載→找torrent→顯示外部通訊...→※完成後不要做種
※或改按右鍵→copy網址→qBt(檔案→増加連結) (112715)

042516
如仍愛用my-weather indicator安裝
sudo add-apt-repository ppa:atareao/atareao sudo apt-get update sudo apt-get install my-weather-indicator
個人認為其地圖最適用