Tuesday, February 16, 2016

[Kindle]轉換PDF to 電子書(mobi)-Convert PDF to kindle eBook

使用Kindle看PDF檔案,字的大小無法改變,常會覺得字太小不好看,可以依下列方式將PDF檔案轉換為mobi檔,就可以很舒服在Kindle內看了。

1. 確認PDF內文的文字是可搜尋、選擇的,轉換的效果會比較好
2. 使用Solid Converter軟體(付費軟體)轉換成Word檔(.docx)
3. 使用Calibre 電子書管理軟體轉換為mobi格式

1. Confirm the text could be searched and selected in PDF file.
2. Using Solid Converter to convert PDF file to Word file (.docx)
3. Using Calibre E-Book management to convert docx to mobi format.


Sunday, January 3, 2016

[Solved]grub fail to boot Windows 10 with Ubuntu 15.10/16.04

Grub2雙重開機要進入Windows 10時,出現
error: 無法找到 'grub_efi_find_last_device_path' 符號
or
error: symbol 'grub_efi_find_last_device_path' not found

grub-efi-amd64的版本為2.02~beta2-29ubuntu0.3(Ubuntu15.10) 2.02~beta2-36(Ubuntu16.04)


解決方式
重裝前一版本2.02~beta2-29ubuntu0.2即可正常進入Windows 10
下載2.02~beta2-29ubuntu0.2版本deb檔
https://launchpad.net/ubuntu/wily/amd64/grub-efi-amd64/2.02~beta2-29ubuntu0.2
安裝
dpkg -i grub-common_2.02~beta2-29ubuntu0.2_amd64.deb
dpkg -i grub2-common_2.02~beta2-29ubuntu0.2_amd64.deb                      
dpkg -i grub-efi-amd64-bin_2.02~beta2-29ubuntu0.2_amd64.deb
dpkg -i grub-efi-amd64_2.02~beta2-29ubuntu0.2_amd64.deb
如果不要自動被升級grub,可以執行下列命令

sudo apt-mark hold grub-common grub-efi-amd64-bin grub2-common grub-efi-amd64
解除不升級
sudo apt-mark install grub-common grub-efi-amd64-bin grub2-common grub-efi-amd64

Solution:
Downgrade version of grub-efi-amd64 to 2.02~beta2-29ubuntu0.2
https://launchpad.net/ubuntu/wily/amd64/grub-efi-amd64/2.02~beta2-29ubuntu0.2
Installation:
dpkg -i grub-common_2.02~beta2-29ubuntu0.2_amd64.deb
dpkg -i grub2-common_2.02~beta2-29ubuntu0.2_amd64.deb                      
dpkg -i grub-efi-amd64-bin_2.02~beta2-29ubuntu0.2_amd64.deb
dpkg -i grub-efi-amd64_2.02~beta2-29ubuntu0.2_amd64.deb

disable upgrade grub
sudo apt-mark hold grub-common grub-efi-amd64-bin grub2-common grub-efi-amd64
enable upgrade grub
sudo apt-mark install grub-common grub-efi-amd64-bin grub2-common grub-efi-amd64



package depends on
grub-common_2.02~beta2-29ubuntu0.2_amd64.deb
grub-efi-amd64-bin_2.02~beta2-29ubuntu0.2_amd64.deb
grub2-common_2.02~beta2-29ubuntu0.2_amd64.deb                  
grub-efi-amd64_2.02~beta2-29ubuntu0.2_amd64.deb




reference:
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=808366;msg=2
http://askubuntu.com/questions/737105/windows-8-stopped-booting

Saturday, August 8, 2015

升級Windows 10 grub開機選單修復

GRUB雙系統開機Windows 8.1和Ubuntu 14.10, 在進行Windows 10升級時,會破壞GRUB的開機設定,導致出現error而進入grub rescue的模式。
 
如果要手動進入找回原來的開機選單,先以 "ls"找出所有的磁區,再找出/boot/grub所在的磁區  

以下設以(hd0,gpt2)為/boot/grub所在的磁區的例子 
grub rescure> ls
(hd0) (hd0,gpt1) (hd0,gpt2)
grub rescure> ls (hd0,gpt2)/boot/grub
./ ../ x86_64-efi/ grubenv grub.cfg
grub rescure>root = (hd0,gpt2)
grub rescure>prefix=/boot/grub
grub rescure>insmod normal
grub rescure>normal

進入grub選單後,如果直接要開始進入作業系統,仍然會出現錯誤,需要再設定參數
先按"C"鍵進行命令模式
grub> root=(hd0,gpt8)
grub> insmod chain
按"ESC"鍵回到原來GRUB選單,即可正常進入作業系統 
如果要修復GRUB選單,則是在UBUNTU下安裝boot repaire套件進行修復,使用"recommend"的方式即可。

Saturday, June 27, 2015

批次檔-ffmpeg轉檔及合併

 %1 -> command後的第一個參數
Ex: convert.bat test-bat
%1 -> test-bat
-----------------------
@ECHO OFF

echo ffmpeg -i %1-1 -target ntsc-dvd %1-1.avi
ffmpeg -i %1"-1" -target ntsc-dvd %1"-1.avi"

echo ffmpeg -i %1-2 -target ntsc-dvd %1-2.avi
ffmpeg -i %1"-2" -target ntsc-dvd %1"-2.avi"

echo ffmpeg -i %1-3 -target ntsc-dvd %1-3.avi
ffmpeg -i %1"-3" -target ntsc-dvd %1"-3.avi"

echo ffmpeg -i %1-4 -target ntsc-dvd %1-4.avi
ffmpeg -i %1"-4" -target ntsc-dvd %1"-4.avi"

'concat=>合併video
ffmpeg -i "concat:%1-1.avi|%1-2.avi|%1-3.avi|%1-4.avi" -c copy %1.avi

----------------------------------------------------------------------------------
批次將所有檔案轉為xvid格式,並把副檔名改為.avi ex: abc.wmv -> abc.avi

for %%x in (*.*) do ffmpeg -i %%x -c:v libxvid -b:v 2000k %%~nx.avi
--------------------------------------------------------------------------------

Wednesday, November 12, 2014

[Linux]CentOS定期備份上傳ftp

Linux OS: CentOS 5
開放samba分享目錄存放含中文檔名的資料,如果要定期壓縮備份,使用tar或rar都遇到中文檔名變成亂碼的問題。最後找到用7za可以解決這個中文亂碼的問題。

以下是以7za壓縮要備份的目錄並上傳至ftp

建立shell script "backup.sh"

#!/bin/bash

#START
TIME=`date +"%b-%d-%y"`
FILENAME="backup-$TIME.7z"
SRCDIR="/opt/accnt"
DESDIR="/tmp"

echo "Processing backup folder"

7za a -mx=9 $DESDIR/$FILENAME $SRCDIR

cd /tmp

echo "connect to ftp site"

USERNAME="username"
PASSWORD="password"
SERVER="ftp_ip"

# local directory to pickup *.7z file
#FILE="/tmp"

# remote server directory to upload backup
BACKUPDIR="home"

# login to remote server
ftp -n -i $SERVER <
user $USERNAME $PASSWORD
cd $BACKUPDIR
bin
mput $FILENAME
quit
EOF

rm --force $FILENAME

將backup.sh加入執行權限

chmod +x backup.sh

建立排程工作
ex:每週一、六 pm1:00執行/path/to/backup.sh

crontab -e

#   Minutes    Hours      Day of Month       Month    Day of Week    Command
01 13 * * 1,6 /path/to/backup.sh

Reference:
http://www.cyberciti.biz/faq/linux-unix-autologin-cron-ftp-script/
http://www.broexperts.com/2012/06/how-to-backup-files-and-directories-in-linux-using-tar-cron-jobs/
http://cybercentos.blogspot.tw/2013/11/install-7zip-on-centos-64-i686.html
crontab -e
#   Minutes    Hours      Day of Month       Month    Day of Week    Command

      01        13               *             *        1,6          /bin/bash /backup.sh
- See more at: http://www.broexperts.com/2012/06/how-to-backup-files-and-directories-in-linux-using-tar-cron-jobs/#sthash.xZv1V1BL.dpuf
crontab -e
#   Minutes    Hours      Day of Month       Month    Day of Week    Command

      01        13               *             *        1,6          /bin/bash /backup.sh
- See more at: http://www.broexperts.com/2012/06/how-to-backup-files-and-directories-in-linux-using-tar-cron-jobs/#sthash.xZv1V1BL.dpuf

Saturday, October 4, 2014

Adobe Illustrator CS5/CS6/CC 免費電子書



Adobe公司提供Illustrator使用說明(pdf電子書)可以免費下載

http://helpx.adobe.com/tw/illustrator/archive.html

線上直接觀看html

(Illustrator最新版)
https://helpx.adobe.com/tw/illustrator/topics.html

Illustrator CS6
http://helpx.adobe.com/tw/illustrator/topics-cs6.html

Monday, March 18, 2013

[Untuntu]Mount smbfs with read and write

 在Ubuntu 10.10 要掛載網路磁碟機並且可以讀寫權限

1. 建立目錄(Create folder)
cd /media
sudo mkdir temp

2.掛載網路磁碟機 (Mount samba share folder)
sudo smbmount //ip_address/foldername /media/temp -o user=username,pass=password,iocharset=utf8,dir_mode=0777,file_mode=0777,uid=current login user name