Thursday, December 29, 2016

How to convert lingvo dictionary to mobi dictionary for kindle paperwhite

How to convert lingvo dictionary to mobi dictionary for kindle paperwhite

We are going to use both ubuntu and windows!!!!

1. Convert lingvo dictionary (.lsd) to the old version (.dsl)

+ In ubuntu, install lsdreader program: https://github.com/sv99/lsdreader
   * Download lsdreader here
   * Extract it to somewhere, for example Downloads.
   * Open terminal: sudo pip install lingvoreader  (Or pip install lingvoreader)
   * On terminal, go to the folder of lsdreader, then: python setup.py sdist

+ Convert .lsd to .dsl:
   * Create a new folder DICT somewhere, for example Desktop, then copy dictionary (file .lsd) to that folder.
   * Open terminal: lsdreader -i path_to_dictionary  then enter
   * After that we get a .dsl file (DICT.dsl)

2. Convert .dsl to .opf

+ In ubuntu, install ruby : http://www.ruby-lang.org/en/downloads/
+ Download program dsl2mobi here and extract it to a folder.
+ Open terminal: ruby path_to_folder/dsl2mobi.rb -i path_to_folder/DICT.dsl
+ After that we will get 4 files: .html, .opf, .css, .jpg
+ Copy all those files to windows

3. Convert .opf to .mobi

+ In windows, download mobigen here (We can do this by kindlegen in ubuntu but it is more slowly). Copy that file mobigen to folder of 4 files above.
+ Open cmd: go to that folder of 4 files: mobigen DICT.opf  then enter
+ You will get the mobi file. Copy it to kindle and use!!

Sources:
a. https://github.com/sv99/lsdreader
b. https://github.com/Tvangeste/dsl2mobi


Wednesday, December 28, 2016

Thêm từ điển cho kindle paperwhite


 (Nguồn: http://sachthanky.com/add-tu-dien-ho-tro-doc-sach-cho-may-doc-sach-kindle.html )


Cách convert từ điển stardict sang mobi cho kindle

Cách convert từ điển stardict sang mobi cho kindle

Bài viết được thực hiện trên ubuntu, các bạn tham khảo link bên dưới để làm trên win nếu muốn (mình chưa thử)

1. Tham khảo các bước làm tại: Đây
+ Tải các công cụ sau để chuẩn bị convert:
   *  pyglossary   đây
   * kindlegen   đây
   * file tab2opf.py  đây
Lưu ý: pyglossary và kindlegen mình sẽ để trong 2 thư mục cùng tên trong folder Downloads. Còn file table thì để trong folder của dữ liệu stardict, và folder này cũng nằm trong Download.

+ Chuẩn bị dữ liệu từ điển stardict (file  .ifo)

2. Bắt tay làm:
+ Bật terminal, gõ:  python3 pyglossary.pyw    để khởi động phần mềm quy đổi dữ liệu từ điển.
+ Chọn file .ifo ở trên, chọn file txt ở dưới và đặt tên file (ví dụ: anhviet) để xuất ra (chỉ đường dẫn đến folder chứa dữ liệu, xuất ra trong folder đó luôn)

Input: tabfile, output: stardict

+ Sau khi hoàn tất ta sẽ có file từ điển anhviet.txt.
+ Bật terminal khác, gõ: truy cập đến Downloads folder và vào folder dữ liệu từ điển.
+ Gõ: sudo chmod 777 tab2opf.py  rồi enter
+ Gõ : sudo ./tab2opf.py anhviet.txt  rồi enter
+ Sau khi phần mềm chạy xong ta có trong folder dữ liệu nhiều file khác nhau, ta chỉ quan tâm file anhviet.opf
+ Trên terminal truy cập đến folder kindlegen rồi gõ: ./kindlegen ~/Downloads/duong_dan_den_thu_muc_du_lieu_tu_dien/anhviet.opf   rồi enter
+ Cuối cùng nhận được file từ điển anhviet.mobi
+Copy vào máy kindle rồi dùng thôi.


Source of tab2opf.py:  http://www.klokan.cz/projects/stardict-lingea/tab2opf.py


Giải pháp khác cho việc convert (Chưa làm được :(  ):   https://github.com/pettarin/penelope

Xóa DRM của ebook PRC

Xóa DRM của ebook PRC

(Nguồn: http://vhungcc.blogspot.com/2013/12/xoa-drm-cua-ebook-prc-thanh-cong-100.html )

DRM là một dịnh dạng mã hóa sách PRC nhằm tránh sao chép sách dưới mọi hình thức. Nó được hiểu gần như là tạo bản quyền cho sách. Và để chúng ta có thể chuyển sách sang các định dạng khác thì bắt buộc chúng ta phải mở khóa DRM đó.

Để có thể sử dụng phần mềm bạn phải biết PID của ebook prc bằng phần mềm Mobipocket reader 

Tải phần mềm Nodrm về giải nén ra sẽ có 2 file dedrm và nodrm hình 1


Hình 1
Tiếp theo các bạn mở bất kì một ebook prc nào đó bằng phần mềm mobipocketreader sau đó vào help -> about một tab mới sẽ hiện ra hình 2 

Hình 2
Copy lấy mã PID. Mã PID này sẽ là dành cho win hiện hành. Nếu bạn cài lại win hay gost lại máy thì phải lấy lại mã PID nhé.

Tiếp theo bạn mở Notepad bằng quyền Admin sau đó chọn file -> open (hoặc bấm ctrl + O) sau đó tìm đến file nodrm ở trên và mở ra hình 3 (Nếu bạn không thấy file nodrm thì phải chọn mục file-type thành All file nhé)

Hình 3
Thay đoạn mã PID và mình bôi đen thành mã PID bạn vừa copy ở trên. Sau đó chọn file -> Save (ctlr + s) để lưu file lại.

Tiếp theo bạn copy 2 file dedrm và nodrm vào thư mục chứa các ebook cần bẻ khóa DRM sau đó chạy file nodrm phần mềm sẽ tự bẻ khóa tất cả các ebook có trong thư mục hiện hành và các thư mục con trong thư mục hiện hành đó. Giao diện khi chạy của chương trình như hình 4


Hình 4
Đợi cửa sổ làm việc tắt đi là tất cả các ebook đã được bẻ khóa DRM rồi. Bây giờ bạn có thể chuyển đổi hay làm gì với những ebook đó đều được cả

Sunday, December 18, 2016

HOW TO INSTALL TRACEGRAPH FOR NS-2 ON UBUNTU WITHOUT ERRORS ---- HƯỚNG DẪN CÀI ĐẶT TRACEGRAPH CHO NS-2 KHÔNG BỊ L

Follow the instruction at this link

But at this command:
 $ sudo export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/micman/tracegraph202/bin/glnx86

please change it by next command:
export LD_LIBRARY_PATH=./bin/glnx86 && ./trgraph

Note: Run above command with root permission

Adding Dictionaries to StarDict

sudo mv dictDirectory/ /usr/share/stardict/dic/

Monday, December 12, 2016

HOW TO INSTALL NS-2.35 ON UBUNTU 14.04

1. Download ns-2.35 from here
2. Do the next steps in the following video:
https://www.youtube.com/watch?v=t4WGQcLZQOU

Notice: What the whole video before doing.