Miscellaneous Applications

This page aggregates short notes for applications that do not need separate pages.

Anacron

Anacron is configured by Fedora to run cron jobs. The corresponding packages for anacron and cron support are cronie-anacron, crontabs, and cronie.

In file /etc/anacrontab, set MAILTO for recipient of email messages and LOGNAME for "From" field of those messages.

Schedule Anacron jobs as an ordinary user via the GNOME Session Manager. First, create a personal Anacron table such as ~/bin/anacrontab by copying and then modifying /etc/anacrontab like so:

MAILTO=...
LOGNAME=...

# period  delay(min) job-identifier command
@daily 1 reminders.anacron  /home/.../reminders/remind.plx
@daily 1 vocabulary.anacron /home/.../vocabulary/quotidian.plx ray@localhost
@daily 3 usage.anacron      /home/.../ceeu.plx ray@localhost

Verify the configuration:

-> anacron -T -t ~/bin/anacrontab

Also, create a spool directory for anacron's bookkeeping:

  -> mkdir ~/scratch/spool

Next, open gnome-session-properties (System/Preferences/Startup Applications) and add a new program:

Finally, test this setup from a shell:

-> anacron -dfn -t ~/bin/anacrontab -S ~/scratch/spool
Anacron 2.3 started on 2007-12-30
Will run job `test'
⋮
Jobs will be executed sequentially
Job `test' started
Job `test' terminated (mailing output)
⋮
Normal exit (### jobs run)
You have mail in /var/spool/mail/...

Aspell

The personal dictionary is ~/.aspell.en.pws, and the personal replacement dictionary is ~/.aspell.en.prepl, for English (c.f. manual §5.7).

cPanel

To set directory indexing for a web site: Open Advanced/Indexes, select the root directory, and press the Go button.

Emacs

File Variables

A file can specify Emacs local variables by embedding formatted instructions in certain comments.

In particular, a shell-script file without an extension (otherwise indicating its type) can trigger Emacs to load shell-script mode by having the following comment on the second line:

# -*- mode: shell-script -*-

Or for a Perl program:

# -*- mode: perl -*-

If the script does not start with a shebang, this comment goes on the first line instead.

For character encoding in, say, a CSS file:

/* -*- coding: utf-8 -*- */

Language Environment

An Emacs language environment encompasses default choices for character sets, coding systems, and input methods. Display information about the current or another language environment with function describe-language-environment (C-h L), which will prompt for the language environment you wish to examine. For a list of available language environments, press TAB at this prompt (or see variable language-info-alist). Use function set-language-environment to choose the language environment. For example, to go all-out UTF-8 by default, add the following to your init.el file:

(set-language-environment "UTF-8")

In particular, new files will be opened (i.e., created) with UTF-8 encoding. This is a global variable, by the way.

Coding Systems

To see information about a coding system, use M-x describe-coding-system (C-h C). You can specify a coding system explicitly at the resulting prompt or just enter RET for the current system. The report appears in your Help buffer. Here "system" reflects multiple I/O channels: file I/O, keyboard input, terminal I/O, inter-client cut and paste, and I/O with sub-processes. And "coding" thus embraces both encoding and decoding. For a list for coding systems in Emacs:

To see all of the coding systems Emacs has to offer, use M-x list-coding-systems. For US English locales, in particular, see UTF-8 (abbreviated "U", aka mule-utf-8), iso-latin-1 (abbreviate "1", aka iso-8590-1, latin-1), and us-ascii (abbreviated "-", aka iso-safe). Note that describe-coding-system will append string "-unix" (or "-dos" or "-mac") to the names reported by list-coding-systems in order to indicate how newlines are handled; e.g., utf-8-unix and iso-latin-1-unix.

When opening an existing file, Emacs infers the file's encoding and decodes the file based on that inference. It quietly reports its conclusion by displaying the coding system's mnemonic character in the leftmost position of the buffer's mode line; for example, "U" for UTF-8 or "1" for Latin-1. You can also take a look at variable buffer-file-coding-system. If you dislike what you see, you can use revert-buffer-with-coding-system (C-x RET r) to re-input the file with a different decoding, which you then specify interactively at the prompt. By default, Emacs will use this inferred or corrected coding system also when writing the buffer, but you can use set-buffer-file-coding-system to say otherwise. Emacs als provides local file variables for explicitly stating the coding system to use for the file.

To open a file without any character conversion, use M-x find-file-literally.

Emacs consults prioritized lists for determining coding systems when it reads a file. You get to have your say, though: Look into variable coding-system-alist and function prefer-coding-system; variable file-coding-system-alist and Lisp function modify-coding-system-alist; variables auto-coding-alist and auto-coding-regexp-alist; variable auto-coding-functions.

Character Sets

To display a list of all character sets:

M-x list-character-sets

The list appears in buffer Character Set List in another window. To see a description of a particular character set:

M-x describe-character-set

You'll be prompted for the character set you are interested in. To display a table of characters in a set, you can click on the set's name in buffer Character Set List. Or use this function and give the character set at the prompt:

M-x list-charset-chars

The table appears in buffer Character List in another window. It shows the characters' glyphs (in the current font) and their code points.

When you want to put a funky character into your buffer, you can copy it from its table in buffer Character List and paste it into your buffer. Or, once you know your character's Unicode name or code point, you can instead use function insert-char (C-x 8 RET) to insert the character into your buffer.

On the other hand, if you want to find the name, code, and set of a character already present in your buffer, put point before that character and run function describe-char, which displays the information in your Help buffer. You can also use what-cursor-position with a prefix argument (C-u C-x =).

ePub

You can use EpubCheck to validate your ePub files from the comfort of you own computer. It's a Java application bundled as a JAR file, called epubcheck.jar. Validate your ePub file like this:

-> java -jar epubcheck.jar opus.epub 
Validating using EPUB version 3.0.1 rules.
No errors or warnings detected.
epubcheck completed

You can also check constituent files as you work. You'll need to help out the validator by telling it the file's format through the --mode option. For example, here's how to check a project's content file, which provides metadata in the Open Packaging Format:

-> java -jar epubcheck.jar --mode opf ~/opus/OEBPS/content.opf
⋮

The section EPUB 3 Validation gives more guidance. For a quick summary of options, call the validator with the --help option.

In general, you'll need to tell Java the full path to epubcheck.jar. On my system:

-> java -jar /opt/share/epubcheck/epubcheck.jar opus.epub
⋮

But that's a nuisance. So script it:

-> cat ~/bin/epubcheck
#!/usr/bin/bash
/usr/bin/java -jar /opt/share/epubcheck/epubcheck.jar $@
-> chmod u+x epubcheck

And now:

-> epubcheck --quiet opus.epub

Fedora does not provide a package for EpubCheck. Instead, install it by downloading and unpacking a Zip archive. First, get the Zip file:

-> cd /tmp
-> wget https://github.com/IDPF/epubcheck/releases/download/v4.0.1/epubcheck-4.0.1.zip
⋮
2016-11-17 12:44:49 (1.82 MB/s) - ‘epubcheck-4.0.1.zip.1’ saved [7917357/7917357]

Next, unpack the Zip file to the directory of your choosing; something like this, for example:

=> cd /opt
=> mkdir -p share
=> cd share
=> unzip -q /tmp/epubcheck-4.0.1.zip 
=> ln -s epubcheck-4.0.1/ epubcheck
=> ls epubcheck/*.jar
epubcheck/epubcheck.jar

Exiftool & Exiv2

Java

To enable Java applets from a browser:

-> yum install icedtea-web

To test a Java installation: browser plugin, system installation.

Fedora's Java installation comprises several packages:

-> rpm -aq | grep -P "java|gcj|icedtea"
icedtea-web-1.6.2-1.fc23.x86_64
java-1.8.0-openjdk-1.8.0.111-1.b16.fc23.x86_64
java-1.8.0-openjdk-headless-1.8.0.111-1.b16.fc23.x86_64
python3-javapackages-4.6.0-8.fc23.noarch
javapackages-tools-4.6.0-8.fc23.noarch
tzdata-java-2016f-1.fc23.noarch

Also:

-> java -version
openjdk version "1.8.0_111"
OpenJDK Runtime Environment (build 1.8.0_111-b16)
OpenJDK 64-Bit Server VM (build 25.111-b16, mixed mode)

The alternatives system manages the default program for running Java:

-> alternatives --display java | grep current
 link currently points to /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.111-1.b16.fc23.x86_64/jre/bin/java

In more detail:

-> file `which java`
/usr/bin/java: symbolic link to /etc/alternatives/java
-> file /etc/alternatives/java
/etc/alternatives/java: symbolic link to /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.111-1.b16.fc23.x86_64/jre/bin/java
-> file /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.111-1.b16.fc23.x86_64/jre/bin/java
/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.111-1.b16.fc23.x86_64/jre/bin/java: ELF 64-bit LSB shared object, …

LaTeX & friends

Configure dvips to use letter-size paper by default:

-> texconfig dvips paper letter

This creates or modifies ~/.texlive2007/texmf-config/dvips/config/config.ps.

mkisofs

Under Fedora, mkisofs resolves to genisoimage:

-> file `which mkisofs`
/usr/bin/mkisofs: symbolic link to /etc/alternatives/mkisofs
-> file /etc/alternatives/mkisofs
/etc/alternatives/mkisofs: symbolic link to /usr/bin/genisoimage
-> file /usr/bin/genisoimage
/usr/bin/genisoimage: ELF 64-bit LSB executable, …

Nautilus

Nautilus is now GNOME Files.

When configured to show image thumbnails, Nautilus uses directory ~/.thumbnails to store the corresponding PNG files it generates.

Assorted extensions to Nautilus add an action to a file's context menu or a tab to a file's Properties dialog. The context menu for a selected file or directory pops-up with a right-click. The Properties item from this menu opens the corresponding dialog.

Menu Actions: To add an action to either compress or extract a directory or file, install file-roller-nautilus. To have an image file's menu include actions to resize and rotate the image, install nautilus-image-converter. To have an ISO file's menu include an action to write to disk, install brasero-nautilus. To have a sound file's context menu include an action for converting formats, install nautilus-sound-converter.

Properties Tabs: For a tab displaying a file's digests (Digests), install gtkhash-nautilus. For a tab displaying a document's metadata (Document), install evince-nautilus. For a tab displaying a media file's metadata (Image, Audio, Video), install totem-nautilus.

Use dconf-editor to configure the Nautilus desktop manager and file manager under schema org.gnome.nautilus, especially Preferences. The editor provides descriptions of the these keys. Preferences may also be set via the Nautilus menu Preferences accessed through the file-cabinet icon in the menu bar.

PDF

Package poppler-utils provides several command-line tools to examine PDF files, to extract images and attachments from PDF files, to split and merge PDF files by page, and to convert PDF files into other formats: pdfinfo, pdffonts, pdfimages, pdfdetach, pdfseparate, pdfunite, pdftocairo, pdftohtml, pdftoppm, pdftops, pdftotext. The opaquely-named pdftocairo converts to PNG, JPEG, TIFF, PDF, PS, EPS, and SVG.

This example shows how to convert a PDF check into separate JPG files for the front and back sides of the check—suitable for uploading to an online bank. It also crops the original images to remove extraneous white space from the left edge.

-> pdftocairo -jpeg -x 290 check.pdf check-side
-> ls check*
check.pdf check-side-1.jpg check-side-2.jpg

You can also use GUIs pdfshuffler or pdfmod (eponymous packages) to interactively manipulate pages of existing PDF documents. You can add, delete, rearrange, rotate, and export pages. pdfshuffler also lets you crop pages, while pdfmod also lets you adjust the final title, subject, author, and keywords.

Programs pdfcrack, pdfgrep, pdfmerge, pdfposter, and pdfresurrect (eponymous packages) offer some special-purpose functionality. Package pdf-tools adds pdfbklt, pdfrevert, and pdfstamp.

GhostScript (package ghostscript) provides utilities for converting between PDF and PostScript. You can convert a PDF file to a PS file with pdf2ps. You can convert from PostScript to PDF with ps2pdfspdf-tools (or related ps2pdfwr, ps2pdf12, ps2pdf13, ps2pdf14).

Use tiff2pdf (package libtiff-tools) to render a TIFF file into PDF.

Alas, pdftk and pdfchain failed to make the grade for Fedora 21. Consider the tools above for alternatives.

But for posterity:

Use command-line pdftk, the PDF Toolkit, to manipulate existing PDF files: merge, split, encrypt, decrypt, rotate, fill forms, and more. It's the most comprehensive tool for transforming one or multiple input PDF files into a single output PDF file. It does not convert PDF to other formats, however.

Fedora provides pdftk in an eponymous package; this corresponds to what the PDF Labs website calls PDFtk Server. PDF Labs also offers two GUI flavors of this toolkit under Windows, PDFtk Free and PDFtk Pro ($), but these flavors are not offered for Linux platforms.

Companion utility pdfchain (eponymous package) offers a GUI for some of pdftk capabilities.

Perl

To manually install a Perl module from CPAN:

-> cd /tmp
-> tar -vxzf <module-file>.tar.gz 
-> cd  <module-file>
-> perl Makefile.PL 
-> make
-> make test
-> su -c "make install"

To verify a successful installation, say Net::Dict for example:

-> perl -e exit -MNet::Dict 

To manually install a CPAN module as non-root to a user directory, say /scratch/lib:

-> tar -vxzf <module-file>.tar.gz 
-> cd  <module-file>
-> perl Makefile.PL PREFIX=/scratch/lib
-> make
-> make test
-> make install

To use the module, add /scratch/lib/perl5 to the PERL5LIB environment variable or to a lib pragma in scripts.

Pidgin

To determine what port to open for an account, start the accounts manager, select the account, and click the Modify button, then open the Advanced tab. For Zerconf, open TCP port 5298 (presence).

PNG

Neither of NetPBM's pnmtopng nor pngtopam provides a man page; use the --help option instead.

Sane & XSane

System Commands

This is a catch-all section for system commands and similar that I tend to forget about.

The ls command consults the environment variable LS_COLORS to set the colors for its output. Use command dircolors to adjust those colors. First:

-> dircolors --bourne-shell --print-database > ~/.dircolors

Next, edit ~/.dircolors to adjust colors; the file documents its format.

Here are assorted handy commands:

useradd, gpasswd, usermod
Create or modify user accounts.
lshw-gui, lshw, lscpu, lspcmcia, lshal, lspci, lsusb
Examine system hardware.
lsmod
List kernel's modules.
pgrep, pkill
Look up or signal processes based on name and other attributes.
od
Dump files in octal and other formats.
dmidecode, biosdecode
Reading BIOS information (package dmidecode).
flashrom
For flash chips. (See also: Updating the flash ROM)

To swap console and GUI sessions, ress Ctrl-Alt-F2, Ctrl-Alt-F3, ..., or Ctrl-Alt-F6) to switch into a console session from a GUI session. Press Ctrl-Alt-F1 to switch into a GUI session from a console session.

Unicode & UTF-8

v.Nu: The Nu Html Checker

You can use The Nu Html Checker (v.Nu) to validate your HTML5 files from the comfort of your own computer. It's a Java application bundled as a JAR file, called vnu.jar. Validate your file like this:

-> java -jar vnu.jar home.html 

You can also list multiple files to check in a single invocation. It's quiet if it finds no errors to report, but its --verbose option does list the files examined:

-> java -jar /opt/shar/vnu/vnu.jar home.html 
home.html

In general, you'll need to tell Java the full path to vnu.jar. On my system:

-> java -jar /opt/share/vnu/vnu.jar home.html
⋮

But that's a nuisance. So script it:

-> cat ~/bin/vnu
#!/usr/bin/bash
/usr/bin/java -jar /opt/share/vnu/vnu.jar $@
-> chmod u+x ~/bin/vnu

And now:

-> vnu home.html

Fedora does not provide a package for Vnu. Instead, install it by downloading and unpacking a Zip archive. First, get the Zip file:

-> cd /tmp
-> wget https://github.com/validator/validator/releases/download/16.6.29/vnu.jar_16.6.29.zip
⋮
2016-12-06 16:05:58 (1.94 MB/s) - ‘vnu.jar_16.6.29.zip’ saved [23533773/23533773

Next, unpack the Zip file to the directory of your choosing; something like this, for example:

=> cd /opt
=> mkdir -p share
=> cd share
=> unzip -q -j -d vnu.jar_16.6.29 /tmp/vnu.jar_16.6.29.zip
=> ln -s vnu.jar_16.6.29 vnu
=> ls vnu/*.jar
vnu/vnu.jar

Wodim

Writing optical media via wodim as an ordinary user (but not as root) may trigger the following warning as wodim attempts to lock its virtual address space:

wodim: Operation not permitted. Warning: Cannot raise RLIMIT_MEMLOCK limits.

To prevent this warning, adjust /etc/security/limits.conf as follows:

username   soft   memlock   64
username   hard   memlock   unlimited

Xfce Notification

xfce4-notifyd notify-send xfce4-notifyd-config /usr/share/themes/*/xfce-notify-4.0

YAML