View Single Post
Old 02-20-2014, 03:37 AM   #29
Gregg Bell
Gregg Bell
Gregg Bell ought to be getting tired of karma fortunes by now.Gregg Bell ought to be getting tired of karma fortunes by now.Gregg Bell ought to be getting tired of karma fortunes by now.Gregg Bell ought to be getting tired of karma fortunes by now.Gregg Bell ought to be getting tired of karma fortunes by now.Gregg Bell ought to be getting tired of karma fortunes by now.Gregg Bell ought to be getting tired of karma fortunes by now.Gregg Bell ought to be getting tired of karma fortunes by now.Gregg Bell ought to be getting tired of karma fortunes by now.Gregg Bell ought to be getting tired of karma fortunes by now.Gregg Bell ought to be getting tired of karma fortunes by now.
 
Gregg Bell's Avatar
 
Posts: 2,266
Karma: 3917598
Join Date: Jan 2013
Location: Itasca, Illinois
Device: Kindle Touch 7, Sony PRS300, Fire HD8 Tablet
thanks

Quote:
Originally Posted by Jellby View Post
It's not a proper interface. It just prints the list and takes you back to the state you were before. Typical situations:

- You didn't find what you were looking for. You may try now a different keyword: type "apropos ebook", for example.

- You found something that looks promising, but you want to learn more about it. Try reading the man page: type "man ebook-convert". (Note that you could have typed this before, if only you knew there was something called "ebook-convert".)

- You found exactly what you wanted. Just run the command: type "calibre". (As above, you could have typed this before, "apropos" is simply doing some search and displaying the results.)
Wow, that really simplifies it for me. Thanks Jellby. I appreciate it.

Quote:
Originally Posted by eschwartz View Post
apropos is just a way of informing you about commands, so if you want to use one, say "apropos calibre" told you that "ebook-convert" is "part of calibre" you then go ahead and type "ebook-convert".

And then you get
Code:
Usage: ebook-convert input_file output_file [options]

Convert an ebook from one format to another.

input_file is the input and output_file is the output. Both must be specified as the first two arguments to the command.

The output ebook format is guessed from the file extension of output_file. output_file can also be of the special format .EXT where EXT is the output file extension. In this case, the name of the output file is derived from the name of the input file. Note that the filenames must not start with a hyphen. Finally, if output_file has no extension, then it is treated as a directory and an "open ebook" (OEB) consisting of HTML files is written to that directory. These files are the files that would normally have been passed to the output plugin.

After specifying the input and output file you can customize the conversion by specifying various options. The available options depend on the input and output file types. To get help on them specify the input and output file and then use the -h option.

For full documentation of the conversion system see
http://manual.calibre-ebook.com/conversion.html

Whenever you pass arguments to ebook-convert that have spaces in them, enclose the arguments in quotation marks.

Options:
  --version       show program's version number and exit

  -h, --help      show this help message and exit

  --list-recipes  List builtin recipe names. You can create an ebook from a
                  builtin recipe like this: ebook-convert "Recipe Name.recipe"
                  output.epub


Created by Kovid Goyal <kovid@kovidgoyal.net>
Which tells you how to use it. Many commands, if they need to be used on something, will show you the help message when the file that must be acted upon wasn't specified.



Most linux software gets updated through the Software Center -- or rather, the Update Manager which is connected to the Software Center. (But both of them come as one in the command line. "apt-get" followed by "install program-name" to either install something new or update it, or followed by "upgrade" to update everything.)

calibre is different -- since it gets weekly updates, you can't rely on the version in the software center, which doesn't get updated after the Ubuntu version gets released. Ubuntu updates programs only if they're really important ones, like the browser, or if they have security fixes, or a volunteer does it.

So Kovid Goyal bundles everything needed to run calibre in one zipped folder, and the command
Code:
sudo python -c "import sys; py3 = sys.version_info[0] > 2; u = __import__('urllib.request' if py3 else 'urllib', fromlist=1); exec(u.urlopen('http://status.calibre-ebook.com/linux_installer').read()); main(install_dir='/opt')"
unzips it to the default (or specified) location, then makes shortcuts in the application menu. Re-running this will overwrite the previous folder, in effect this leaves calibre upgraded without having to *actually* uninstall.




Okay, updating automatically. Go to the software center and install the program "gnome-schedule". This is the GUI interface for linux's equivalent to the Task Scheduler. Your computer will already have the command-line version, "crontab", installed. You can use that too, just run "crontab -e", but you will have to edit a text file within the terminal. So use gnome-schedule for now.

Run the following command in the terminal (It must be run as the root user, or you cannot create a task as the root user):
Code:
gksu gnome-schedule
Then create a task (one guide is here: http://www.maketecheasier.com/easy-w...sks-in-ubuntu/) that will run
Code:
sudo python -c "import sys; py3 = sys.version_info[0] > 2; u = __import__('urllib.request' if py3 else 'urllib', fromlist=1); exec(u.urlopen('http://status.calibre-ebook.com/linux_installer').read()); main(install_dir='/opt')"
every week on Friday, at say, 6 in the morning, so you will presumably be asleep when it updates. (we don't want to upgrade while we try to run it. )


For bonus points, you can use the commands listed at this thread HERE (again) which will first check to see if calibre was updated, then shutdown calibre if it's currently running.

Store this as calibre-upgrade.sh;
Code:
#!/bin/bash

calibre-debug -c "import urllib as u; from calibre.constants import numeric_version; raise SystemExit(int(numeric_version  < (tuple(map(int, u.urlopen('http://calibre-ebook.com/downloads/latest_version').read().split('.'))))))"

UP_TO_DATE=$?

if [ $UP_TO_DATE = 0 ]; then
        echo "Calibre is up-to-date"
else
        killall calibre calibre-server
        sudo python -c "import sys; py3 = sys.version_info[0] > 2; u = __import__('urllib.request' if py3 else 'urllib', fromlist=1); exec(u.urlopen('http://status.calibre-ebook.com/linux_installer').read()); main(install_dir='/opt')"
fi
and then run that file in the task scheduler.
Thanks eschwartz. That was a lot of good info. in your post.

So the appropos is kind of like a stepping stone thing (one thing--hopefully--leads to another).

Tried your Calibre automatizing. Unfortunately ran into a couple of roadblocks. First I couldn't find a program called Gnome-schedule in the Ubuntu Software Center. I found something similar and installed that (called Scheduled Tasks) (see screenshot 035). It looked really similar so I went with it. And then when I put that command "gksu gnome-schedule" in the terminal, it said I hadn't installed it, so I hit enter and it was installing it, but then it aksed me what's in the screenshot (034), and I was definitely in over my head at that point so I bailed. I may try again or there must be some way they notify you to get updates. (I get update notices all the time when I open Calibre in Windows.) Reallly appreciate the help. (Sorry I didn't make better use of it.)

Quote:
Originally Posted by mrmikel View Post
There are similar but not identical features. There is beautify all files and Fix HTML under Edit.

They are capable screwing things up. But unlike Sigil, you can set a checkpoint to restore back to and nearly any action is undoable even after a global replace.
Thanks mrmikel. Would you say 'Beautify' is similar to Print Tidy and 'Fix HTML' is like Tidy Print? I got to trust Pretty Print, but never Tidy Print. And I saw the restore feature. That is awesome. I'd hate to see Sigil go, but if it has to, it's nice that something (and someone) is filling the void. Thanks a lot.
Attached Thumbnails
Click image for larger version

Name:	Selection_035.png
Views:	272
Size:	33.9 KB
ID:	119298   Click image for larger version

Name:	1_034.png
Views:	257
Size:	99.4 KB
ID:	119299  
Gregg Bell is offline