Martin's misc tips before the stackexchange era

by Martin Monperrus

(This is an old page, my questions and/or answers are now on StackExchange / Stackoverflow)

  Why does my screen blink when I'm using Wine?
  Why screen captures don't work with Wink?
  How to fix "Unable to save my document" when using Samba/CIFS (e.g. using OpenOffice)?
  Why the fonts that are indexed by fontconfig and available with fc-list are not proposed by Openoffice?
  How to disable the default font path with X/Xorg?
  How to use bluesky computer modern fonts with fontconfig?
  How to use URW Times / Nimbus Roman No9 L with latex?
  How to open psafe3 files on Linux?
  How to configure xdg-open to open URLs?
  I cannot open URLs in Skype on Linux
  Pourquoi latex ajoute automatiquement un espace avant les deux points?
  How to convert OpenOffice's odt files to pdf files via the command line?
  No more German sharp s (ß) with Xorg
  KDE4: where is kicker?
  KDE4: where is kcontrol?
  What is the source code repository of freepascal?
  How to get the source code of Web2c's version of TeX?
  How to compile Pascal code to Java Bytecode?
  Can I browse the code of newlib, sim, etc.?
  How to modify the dependencies of a Debian/Ubuntu DEB package before installing it?
  How to generate PDF version 1.3 with pdftex/pdflatex?
  How to install Ubuntu Jaunty using debootstrap?
  When giving a presentation with OpenOffice, how to have your personal notes on your laptop screen?
  How to use bzr-cvsps-import?
  How to annotate PDF files on Linux?
  How to change the password of the Gnome Keyring?
  How to open/explore/browse Firefox XPI files?
  Is Apache Lucene a NoSQL/document-oriented database?
  How to convert PDF 1.2 to PDF 1.4?
  How to force pdflatex/pdftex to produce PDF version 1.x
  In Qemu/KVM, what is the ip address of the host machine?
  How to use subversion with NFS?
  REST-ful ISBN with Google Books and Amazon
  How to set up a LDAP (openldap/slapd) on Linux/Debian
  Vertical text layout with Firefox
  Evince and Xpdf don't display non-embedded fonts
  Is there a version control system running in CGI mode?
  How to report a bug or ask a general question about Google Scholar?
  How to extract the first page of a PDF file?
  How to stop Firefox asking "Do this automatically for files like this from now on" on Linux?
  How to do code syntax highlighting in web pages (for instance for Javascript)?
  How to search for whole phrases with Gnome Tracker?
  How to crop PDFs on Linux?
  How to export Eclipse ecorediag diagrams as vector graphics PDF?
  How to remove comments from Latex sources ?
  How to set up automated backups of mysql?
  What is /sys/block/sda/device/queue_depth?
  How to find a Latex symbol?
  How to fix "totem: Could not create element 'gconfaudiosink'"?
  How to fix "jackd/jackd2: Cannot lock down memory area (Cannot allocate memory)"?
  How to share user-defined custom styles accross documents in libreoffice/openoffice?
  Scp and rsync hangs/stalls while ssh works
  How to match the last line with sed?
  How to copy highlighted code from Eclipse in OpenOffice/LibreOffice impress?
  How to save documents from a Google result page with right-click >> Save link as... ?
  How to obtain copyable ASCII single quote (#39) in code listings with package listings in LaTeX?
  How to change the label of a vfat partition?
  In ANTLR3, what does the BANG/exclamation mark (!) mean right after a rule name?
  How to measure Java software (LOC/SLOC)?
  USB drives are mounted by Nautilus but don't show up in the UI?
  What's the unit of the stripe-width parameter of mkfs.ext4?
  How to install a printer Brother DCP770CW on a 64 bits system?
  How to remove the page break before the bibliography?
  I can not delete notes in Tomboy, the right-click option "delete" is greyed out
  How to disable gnome-shell in Gnome 3?
  How to set the default browser in Gnome 3?
  How to disable password check/screen lock after suspend on Gnome 3?
  How to obtain centered columns with Latex package tabularx?
  Evince/Xpdf don't receive keyboard input with mozplugger on Firefox
  Why do I get "lp: Error - unable to access"?
  How to fix "Paragraph ended before \BR@c@bibitem was complete"?
  How to disable mounting /tmp as tmpfs in Debian?
  How to force using pdflatex on Hal/Arxiv?
  How to change the port for Subversion over SSH (svn+ssh)?
  How to automatically remember SSH passwords for Subversion over SSH (svn+ssh)?
  How to set up Linux's X/Xorg on a laptop Samsung np305/np-305/np305ua1?
  How to get the list of packages installed by debootstrap?
  How to handle utf8 playing cards characters with latex/pdftex?
  How to put the caption below the listings in Latex?
  What is the http user-agent of the crawler of duckduckgo?
  How to create PDF boxplots with R?
  How to disable beep/bell/speaker in bash?
  How to install grub for a file system not mounted as root?
  How to create an optimal ext4 file system on an SSD disk?
  How to convert a Bibtex file to a RIS file?
  How to disable PDF compression in Latex/PDFLatex?
  How to remove the "References" header/label of the bibliography in LaTeX?
  How to set the guid of RSS items in Yahoo Pipes?
  How to use the utf8/utf-8 euro sign (€) in Latex/pdflatex?
  How to force Thunderbird to re-index all folders in Gloda?
  How to decrease the indentation of email threads in Thunderbird?
  How to use Arial-like sans-serif fonts in Latex?
  How to use BibLatex?
  How to add todos in Latex documents?
  How to create tables with datatool?
  How to extract pages in a PDF document?
  How to have nice hyperlinks in PDFs produced from Latex?
  How to get line breaks in LaTeX tables?
  How to have nice boxes in LaTeX

Why does my screen blink when I'm using Wine?

Cause: the xrandr/randr extension of the X server
Solution: Add a key UseXRandR=N in the registry using Wine's regedit
See also: http://wiki.winehq.org/UsefulRegistryKeys

Why screen captures don't work with Wink?

Solution: unset Numlock
See also: http://www.debugmode.com/wink/download.php

How to fix "Unable to save my document" when using Samba/CIFS (e.g. using OpenOffice)?

Error for touch: setting times of `': Not a directory
Error for kate: The document could not be saved, as it was not possible to write to file:///mnt/jsb/toto. Check that you have write access to this file or that enough disk space is available.
Error for OpenOffice: General input/output error while accessing ...
Solution: add the option "nounix" for mounting the shared directory (e.g. mount.cifs //server.de/foo /mnt/foo -o nounix)

Why the fonts that are indexed by fontconfig and available with fc-list are not proposed by Openoffice?

In order to use a font in Openoffice, you have to provide 2 files per font, the AFM and PFB font.
For instance, for the URW Times (a.k.a "Nimbus Roman No9 L"), you have to provide both "utmr8a.afm utmr8a.pfb"

How to disable the default font path with X/Xorg?

Use the option UseDefaultFontPath in ServerFlags:
Section "ServerFlags"
Option "AllowMouseOpenFail" "true"
Option "UseDefaultFontPath" "false" # disable the default fontpath
EndSection

How to use bluesky computer modern fonts with fontconfig?

According to this page, it's not possible because bluesky fonts do not contain all latin1 characters. What is sure is that the pfb files of bluesky (e.g. /usr/share/texmf-texlive/fonts/type1/bluesky/cm/cmtex9.pfb) are not compatible/readable with fontconfig.
$ fc-cache -v -f
/usr/share/texmf-texlive/fonts/type1/bluesky/cm/: caching, new cache contents: 0 fonts, 0 dirs
See also Using computer modern type1 fonts with openoffice on Linux

How to use URW Times / Nimbus Roman No9 L with latex?

URW Times is the same font as "Nimbus Roman No9 L". It 'is used when you load the package times:
\usepackage[T1]{fontenc}
\usepackage{times}
Then pdflatex outputs:
(/usr/share/texmf-texlive/tex/latex/psnfss/times.sty) (./fonts.aux)
(/usr/share/texmf-texlive/tex/latex/psnfss/t1ptm.fd) [1{/var/lib/texmf/fonts/ma
p/pdftex/updmap/pdftex.map}] [2] (./fonts.aux) ){/usr/share/texmf-texlive/fonts
/enc/dvips/base/8r.enc} /usr/share/texmf-texlive/fonts/type1/urw/times/utmr8a.p
fb> $ pdffonts fonts.pdf
name type emb sub uni object ID
------------------------------------ ----------------- --- --- --- ---------
DPRGTM+NimbusRomNo9L-Regu Type 1 yes yes no 4 0

How to open psafe3 files on Linux?

Use password-gorilla. It is able to read and write psafe3 files from Windows' passwordsafe.

How to configure xdg-open to open URLs?

For instance xdg-open http://www.google.fr. On KDE, xdg-open uses kfmclient, which itself uses the default browser set using the Control Center (kcontrol).
KDE Components >> Component Chooser >> Web Browser

I cannot open URLs in Skype on Linux

Skype uses xdg-open to open URLS. It has to be correctly configured (see above).

Pourquoi latex ajoute automatiquement un espace avant les deux points?

See Pourquoi latex ajoute automatiquement un espace avant les deux points.

How to convert OpenOffice's odt files to pdf files via the command line?

With https://github.com/mirkonasato/pyodconverter

No more German sharp s (ß) with Xorg

After an upgrade of my X window system, I lost the ability to type german sharp s (ß) with <Alt Gr> + s.
To get it back, you have to change one of the configuration files of your german keyboard, so that the third modifier (<AltGr> + s) with s produces an ß.

On my system:
file: /usr/share/X11/xkb/symbols/de
line (the change is in bold): key <AC02> { [ s, S, ssharp, U1E9E ] };
and relaunch X.

I don't think it's a bug of the configuration file, it's rather an incorrect interaction between Unicode characters, X fonts and my locale (ISO8859-1).

KDE4: where is kicker?

in KDE4, kicker has been replaced by plasma-desktop :-(

KDE4: where is kcontrol?

in KDE4, kcontrol has been replaced systemsettings :-(

What is the source code repository of freepascal?

freepascal uses a svn repository accessible at http://svn.freepascal.org/svn/fpc/ (and no more CVS at cvs.freepascal.org)

How to get the source code of Web2c's version of TeX?

$ svn co svn://tug.org/texlive/trunk/Build/source/texk/web2c/

How to compile Pascal code to Java Bytecode?

You can use nestedVM for that if your Pascal code is compatible with the GNU Pascal Compiler. For instance, in running tex on a java virtual machine, I show how to run the Pascal version of TeX in a Java Virtual Machine.

Can I browse the code of newlib, sim, etc.?

See this CVS browser!.

How to modify the dependencies of a Debian/Ubuntu DEB package before installing it?

Very nice solution: http://ubuntuforums.org/showthread.php?t=636724

How to generate PDF version 1.3 with pdftex/pdflatex?

Simply add \pdfoptionpdfminorversion=3 in the header of your tex file. See http://www.tug.org/pipermail/pdftex/2002-November/003317.html.

How to install Ubuntu Jaunty using debootstrap?

$ curl -O http://archive.ubuntu.com/ubuntu/pool/main/d/debootstrap/debootstrap_1.0.20~jaunty1_all.deb
$ dpkg -i debootstrap_1.0.20~jaunty1_all.deb
 # this puts ubuntu jaunty in the directory ubuntu-jaunty
$ debootstrap jaunty ubuntu-jaunty http://de.archive.ubuntu.com/ubuntu/
The default installation of Ubuntu Jaunty contains 160 packages and takes 238MB.

When giving a presentation with OpenOffice, how to have your personal notes on your laptop screen?

Openoffice can project the presentation to VGA, and let both the slides and the notes on the screen of your laptop. This is like Apple's keynote and it is called Presenter Console extension.
The downloadable extension from http://extensions.services.openoffice.org/project/presenter-screen does not work on my Linux (Debian), but there is a package called openoffice.org-presenter-console.

$ apt-get install openoffice.org-presenter-console (should work on Ubuntu as well)


How to use bzr-cvsps-import?

To convert a CVS repository to a bazaar one (replace /home/cvsroot/ and modulename with your values):
$ bzr cvsps-import /home/cvsroot/ modulename bzr-import
$ bzr co bzr-import/bzr/modulename/branches/HEAD

How to annotate PDF files on Linux?

A very good solution is to run "PDF-Exchange Viewer" or "Foxit Reader" using wine.

How to change the password of the Gnome Keyring?

1. install seahorse ($ sudo apt-get install seahorse)
2. run seahorse (CLI or System >> Preferences >> Passwords and Encryption Keys)
3. right-click on "Passwords:login" >> "Change password"

How to open/explore/browse Firefox XPI files?

XPI files are actually ZIP files. Just rename file.xpi in file.zip and open it with unzip/ark/file-roller or whatever zip browser.

Is Apache Lucene a NoSQL/document-oriented database?

Yes. For instance, the APIs of Google's datastore and Apache Lucene are very similar (e.g. Entity versus Document).
See also: answer @ stackoverflow
answer @ Lucene's mailing list

How to convert PDF 1.2 to PDF 1.4?

How to downgrade the version of PDF documents? How to change the PDF version of PDF files?
This can be done with Ghostscript (CompatibilityLevel is the desired target level 1.2/1.3/1.4/1.5/1.6):
$ gs -dBATCH -sDEVICE=pdfwrite -sOutputFile=output.pdf -dCompatibilityLevel=1.4 input.pdf

How to force pdflatex/pdftex to produce PDF version 1.x

For PDF 1.4, add \pdfminorversion 4 (or 5 for 1.5, 3 for 1.3, etc) in the preamble of the document.

In Qemu/KVM, what is the ip address of the host machine?

10.0.2.2

How to use subversion with NFS?

Use both subversion database format fsfs (svnadmin create --fs-type fsfs $DIR), and NFS mounting option nolock.
See http://gibbonsr.net/2009/02/nfs-and-subversion-it-can-work/.

REST-ful ISBN with Google Books and Amazon

How to ask for information with the ISBN?
http://www.amazon.com/gp/search/ref=sr_adv_b/?search-alias=stripbooks&field-isbn=978-1-60566-006-6
http://www.google.com/search?tbs=bks%3A1&q=isbn%3A978-1-60566-006-6


How to set up a LDAP (openldap/slapd) on Linux/Debian

An excellent tutorial: http://www.debuntu.org/ldap-server-and-linux-ldap-clients

Vertical text layout with Firefox

<span style="-moz-transform:rotate(90deg);">Demonstration</span> Demonstration See https://developer.mozilla.org/en/CSS/-moz-transform

Evince and Xpdf don't display non-embedded fonts

In my case, the problem was in the fontconfig configuration files. I replaced /etc/fonts/* by the latest version from the fontconfig-config package and regenerated the cache ($ fc-cache -f). It solved the issue.


Is there a version control system running in CGI mode?

Yes: Mercurial. It can run in pure python (no C extension) with CGI (hgweb.cgi). The transport is completely done using HTTP and the access control with .htaccess/.htpasswd files. Beautiful! (see this post)

How to report a bug or ask a general question about Google Scholar?

http://www.google.com/support/scholar/bin/request.py?contact_type=general (note the ?contact_type=general).

How to extract the first page of a PDF file?

With a command line: pdftk A=input.pdf cat A1-1 output firstpage.pdf

How to stop Firefox asking "Do this automatically for files like this from now on" on Linux?

Solution: install the extension InlineDisposition.
See also: https://bugzilla.mozilla.org/show_bug.cgi?id=331259 and https://bugzilla.mozilla.org/show_bug.cgi?id=236541

How to do code syntax highlighting in web pages (for instance for Javascript)?

I recommend shjs (http://shjs.sourceforge.net/). It is much better than SyntaxHighlighter which has many bugs (for instance, I encountered this one and this one)

How to search for whole phrases with Gnome Tracker?

For whole text search with tracker, you have to prepend a letter to the query (found here)
'On Searching Relevant Studies in Software Engineering' (no double quote)
"On Searching Relevant Studies in Software Engineering" (no single quote)
x"On Searching Relevant Studies in Software Engineering" OK
x "On Searching Relevant Studies in Software Engineering" (space does not matter)
a "On Searching Relevant Studies in Software Engineering" (letter does not matter)
Don't ask me why this is so strange!

How to crop PDFs on Linux?

$ apt-get install texlive-extra-utils
$ pdfcrop figure.pdf
It removes the blank margins around the content. Very useful to obtain compact figures to include with pdflatex.

How to export Eclipse ecorediag diagrams as vector graphics PDF?

The Ecore Tools Diagram plugins should be able to export PDFs but it's buggy. A solution is to:
1) install a PDF distiller printer (e.g. CUPS-PDF on Linux or PDFcreator on Windows)
2) right-click on the diagram, "File>>Print"
3) Select the PDF printer
4) Click on the option "Fit to" options"
5) Click on "OK"
6) Crop the resulting PDF (e.g. on Linux: $ pdfcrop diagram.pdf)

How to remove comments from Latex sources ?

and submit clean sources to arxiv :-):
$ sed -i -r -e '/^[[:space:]]*%/ d' -e 's/([^\\])%.*$/\1/' *tex

How to set up automated backups of mysql?

I recommend the package automysqlbackup.

What is /sys/block/sda/device/queue_depth?

The queue depth is the number of I/O operations that are sent in parallel on a device. (http://publib.boulder.ibm.com/infocenter/storwize/ic/index.jsp?topic=/com.ibm.storwize.v7000.doc/svc_iscsiqueuedepthlimits.html)

How to find a Latex symbol?

http://detexify.kirelabs.org/classify.html

How to fix "totem: Could not create element 'gconfaudiosink'"?

Solution: $ apt-get install gstreamer0.10-gconf (or gstreamer-gconf depending on your distro)

How to fix "jackd/jackd2: Cannot lock down memory area (Cannot allocate memory)"?

Solution: increase the memory allocated to /dev/shm or /run/shm in /etc/fstab (for instance from 10M to 100M). Then $ mount -o remount /run/shm

How to share user-defined custom styles accross documents in libreoffice/openoffice?

Set up a default template, e.g. .libreoffice/3/user/template/default.ott (http://wiki.services.openoffice.org/wiki/Documentation/OOoAuthors_User_Manual/Writer_Guide/Setting_a_default_template), add the style in this file.

Scp and rsync hangs/stalls while ssh works

Cause: ICMP packets are firewalled and one of the machines have high MTU set (jumbo frames).
Consequence: Path MTU discovery (pmtud) fails and the machines use high MTUs that are not supported by routers along the path
Solution: Set the MTU to the standard value (1500) on both machines.

How to match the last line with sed?

To match the end of file, the end of document, sed uses a dollar $
For instance, sed "$d" deletes the last line of a file.

How to copy highlighted code from Eclipse in OpenOffice/LibreOffice impress?

Ctrl-C in Eclipse, then Ctrl-V in OpenOffice Text, then Ctrl-C in in OpenOffice Text, then Ctrl-Shitf-V in Impress, selection Formatted Text [RTF]

How to save documents from a Google result page with right-click >> Save link as... ?

Because of the tracking mechanism of Google with special URLS, one can not right click on a search result to save it (handy for PDF files for instance). This Greasemonkey script fixes this issue.

How to obtain copyable ASCII single quote (#39) in code listings with package listings in LaTeX?

Add the option \lstset{upquote=true} and \usepackage{textcomp}. You can then copy code!
See also http://www.monperrus.net/martin/copy-pastable-listings-in-pdf-from-latex.

How to change the label of a vfat partition?

dosfslabel /dev/sdb1 the-new-name

In ANTLR3, what does the BANG/exclamation mark (!) mean right after a rule name?

It means that an AST node won't be created for this rule (even if it contains a tree construction part with "->")

How to measure Java software (LOC/SLOC)?

See Java Metrics - Free and Commercial Measurement Software

USB drives are mounted by Nautilus but don't show up in the UI?

To be visible in Nautilus, USB drives and memory sticks must be mounted under /media. /media must be a real directory and not a symlink. References: http://ubuntuforums.org/showthread.php?t=1657791, http://askubuntu.com/questions/2280/selective-mounted-volumes-for-the-gnome-desktop-and-nautilus-sidebar

What's the unit of the stripe-width parameter of mkfs.ext4?

From the man page: Configure the filesystem for a RAID array with stripe-width filesystem blocks per stripe, which means that the unit is 4096B, equivalent 4 512B-sectors. Hence, a stripe width of 128KiB (e.g. for SSD) corresponds to stripe-width=32.

How to install a printer Brother DCP770CW on a 64 bits system?

Simply force the installation of the 32 bits packages found on http://welcome.solutions.brother.com/bsc/public_s/id/linux/en/download_prn.html:
$ dpkg -i --force-all dcp770cwcupswrapper-1.0.1-1.i386.deb dcp770cwlpr-1.0.1-1.i386.deb
This works with ia32-libs installed.

How to remove the page break before the bibliography?

This may be caused by the natbib package. Just remove the package import (this worked for me using the LNCS style llncs). See also Bibliography Starts on a New Page.

I can not delete notes in Tomboy, the right-click option "delete" is greyed out

Well, I don't know the cause, but selecting the note and using "Del" on the keyboard works.

How to disable gnome-shell in Gnome 3?

Select "Gnome Classic" as session type in the login manager. Also, to set up your panel again, you now have to Alt+right-click.

How to set the default browser in Gnome 3?

System Tools >> Preferences >> System Settings launches gnome-control-center
Then go in System Info->Default Applications->Web

If your browser doesn't show up in the dropdown bow, add the following line in ~/.local/share/applications/mimeapps.list:
x-scheme-handler/http=firefox.desktop;

Note that 1) you may replace firefox.desktop by your-favorite-browser-launcher.desktop (e.g. opera.desktop) 2) you may use gnome-desktop-item-edit to create a .desktop file (that should be located in ~/.local/share/applications).

Big thanks to http://raphaelhertzog.com/2011/04/18/status-update-of-gnome-3-in-debian-experimental/.

How to disable password check/screen lock after suspend on Gnome 3?

System Tools >> Preferences (gnome-control-center), then Screen >> Lock (from http://ubuntuforums.org/showthread.php?t=1856761)

How to obtain centered columns with Latex package tabularx?

\usepackage{tabularx}
\newcolumntype{Y}{>{\centering\arraybackslash}X}
...
\begin{tabularx}{\textwidth}{|p{2cm}| Y | Y | Y | Y |}

Evince/Xpdf don't receive keyboard input with mozplugger on Firefox

Solution: remove option needs_xembed from the corresponding lines in 'mozpluggerrc'.

Why do I get "lp: Error - unable to access"?

Calling cups from KDE (e.g. okular) or acroread, you may get the error "lp: Error - unable to access. It means the lp (or lpr) is incorrect. Check which lp and lpr are available on your machine. It my case, the faulty lp was actually a lpr in the user-specific bin directory (~/bin)

How to fix "Paragraph ended before \BR@c@bibitem was complete"?

In Latex the bibliography style IEEEtran (\bibliographystyle{IEEEtran}) and the package bibentry are incompatible. A fix consists of using another style (e.g. \bibliographystyle{plain}).

How to disable mounting /tmp as tmpfs in Debian?

Set RAMTMP=no in /etc/default/rcS

How to force using pdflatex on Hal/Arxiv?

Add \pdfoutput=1 in the preamble of the Latex document.

How to change the port for Subversion over SSH (svn+ssh)?

Add a "new" protocol in ~/.subversion/config:
[tunnels]
ssh22345 = ssh  -p 22345
Then use repository URLs of the form svn+ssh22345://user@server.com/svn/path/to/repo
From http://www.techper.net/2009/01/11/changing-port-number-of-svnssh-subversion-protocol/.

How to automatically remember SSH passwords for Subversion over SSH (svn+ssh)?

Add a "new" protocol in ~/.subversion/config:
[tunnels]
#1234 is the password
ssh-with-pass = sshpass -p 1234 ssh
Then use repository URLs of the form svn+ssh-with-pass://user@server.com/svn/path/to/repo
This works without SSH keys.

See also http://fetchsoftworks.com/blog/subversion-and-ssh-authentication-shenanigans for another excellent yet somewhat heavier solution.

How to set up Linux's X/Xorg on a laptop Samsung np305/np-305/np305ua1?

Solution: load kernel module radeon and use Xorg driver fbdev.
On my laptop (kernel 3.2.0), this allows a display of 1368x768 supporting suspend-on-RAM.
Debug info from lspci: 00:01.0 VGA compatible controller: Advanced Micro Devices [AMD] nee ATI Wrestler [Radeon HD 6320]

How to get the list of packages installed by debootstrap?


$ debootstrap --print-debs --arch=amd64 stable /tmp/tmp
(thx http://blog.ericwhite.ca/articles/2010/10/kvm-ubuntu-vm-using-debootstrap/)

How to handle utf8 playing cards characters with latex/pdftex?

To handle ♣, ♦, ♥ et ♠ in Latex (directly in utf8 in source code):
1. install package cm-super
2. add in source:
\DeclareUnicodeCharacter{2660}{$\spadesuit$}%% Spade
\DeclareUnicodeCharacter{2663}{$\clubsuit$}%% Club
\DeclareUnicodeCharacter{2665}{$\heartsuit$}%% Heart
\DeclareUnicodeCharacter{2666}{$\diamondsuit$}%% Diamond

How to put the caption below the listings in Latex?

Using package listings and one the following usages:
\usepackage[captionpos=b]{listings}
\lstset{captionpos=b}
\begin{lstlisting}[caption={Extract article text and date},label=xxxx,float,captionpos=b]

What is the http user-agent of the crawler of duckduckgo?

DuckDuckBot/1.0; (+http://duckduckgo.com/duckduckbot.html)
See; http://help.duckduckgo.com/customer/portal/articles/216399-sources and http://duckduckgo.com/duckduckbot.html

How to create PDF boxplots with R?

pdf(file = "q3d.pdf")
boxplot(mpg~cyl,data=mtcars, main="Car Milage Data", xlab="Number of Cylinders", ylab="Miles Per Gallon") 
dev.off()
http://www.statmethods.net/graphs/boxplot.html,
http://www.talkstats.com/showthread.php/5488-How-to-get-R-to-export-a-pdf

How to disable beep/bell/speaker in bash?


set bell-style none in ~/.inputrc
(should be done both for regular user and root)

How to install grub for a file system not mounted as root?

grub-setup --directory /mnt/fs/boot/grub /dev/sda2

How to create an optimal ext4 file system on an SSD disk?

mke2fs -t ext4 -E stripe-width=32,resize=500G /dev/ssd/root

"The resize=500G limits the number of blocks reserved for resizing this file system so that the guaranteed number size that the file system can be grown via online resize is 500G. The default is 1000 times the initial file system size, which is often far too big to be reasonable. Realistically, the file system I am creating is going to be used for a desktop device, and I don’t foresee needing to resize it beyond 500G, so this saves about a 50 megabytes or so. Not a huge deal, but “waste not, want not”, as the saying goes." (http://ldn.linuxfoundation.org/blog-entry/aligning-filesystems-ssd%E2%80%99s-erase-block-size).

How to convert a Bibtex file to a RIS file?

Using the bibutils software package (available in Debian/Ubuntu), the following command line transforms a Bibtex file to a RIS file (for instance to import a publication list in researcherid):
bib2xml ~/monperrus.bib | xml2ris -o utf8 > monperrus-utf8.ris

How to disable PDF compression in Latex/PDFLatex?

Add \pdfcompresslevel 0 in the preamble.

How to remove the "References" header/label of the bibliography in LaTeX?

\renewcommand{\refname}{}

How to set the guid of RSS items in Yahoo Pipes?

Set y:id.value using a rename operator. This is especially useful when guid is empty. See http://www.daybarr.com/blog/yahoo-pipes-tutorial-an-example-using-the-fetch-page-module-to-make-a-web-scraper and http://developer.yahoo.com/forum/Pipes/GUID-empty-after-setting-it-in/1376332538233-a8cb732b-9145-4c6a-a62d-da4561829d01.

How to use the utf8/utf-8 euro sign (€) in Latex/pdflatex?


\usepackage[utf8]{inputenc}
\usepackage{textcomp}
or
\usepackage[utf8x]{inputenc}
\usepackage{eurosym}
\DeclareUnicodeCharacter{8364}{\euro}

How to force Thunderbird to re-index all folders in Gloda?

The Icedove/Thunderbird, the Global Database can be rebuilt by removing global-messages-db.sqlite and restarting Thunderbird/Icedove:
rm /~/.thunderbird/7wUY7Erh.default/global-messages-db.sqlite
Reference: https://support.mozillamessaging.com/en-US/kb/rebuilding-global-database

How to decrease the indentation of email threads in Thunderbird?

For very long threads, the threaded view of Icedove/Thunderbird is not usable because the indentation is too big and the thread width too large. A solution is to change the indentation width in chrome/userChrome.css of the profile folder.

#threadTree treechildren::-moz-tree-indentation{
width: .1em !important;
}

How to use Arial-like sans-serif fonts in Latex?

\renewcommand{\rmdefault}{phv} % Arial
\renewcommand{\sfdefault}{phv} % Arial

How to use BibLatex?

%% in preamble
\usepackage[giveninits=true,doi=false,url=false,isbn=false,maxnames=99]{biblatex}
\bibliography{references.bib}
\setlength\bibitemsep{0cm}

...

\printbibliography
Possible options
[sorting=none]
[backend=biber]

How to add todos in Latex documents?


% simple todos
\usepackage[]{xcolor}
\newcommand{\TODO}[1]{\textcolor{red}{#1}}\newcommand\todo\TODO

% simple todos with latex warnings
\usepackage[]{xcolor}
\newcommand{\TODO}[1]{\textcolor{red}{#1}\GenericWarning{}{LaTeX Warning: TODO: #1}}\newcommand\todo\TODO


% advanced todos using PDF annotations
\usepackage[]{xcolor}
\usepackage[]{pdfcomment}
\newcommand{\TODO}[1]{\textcolor{red}{#1}\pdfcomment[color=yellow,open=false]{#1}}\newcommand\todo\TODO

How to create tables with datatool?

\usepackage{datatool}
\DTLloadrawdb{redundancy}{redundancy.csv}
\DTLdisplaydb{redundancy} 
If you want special column headers:
\usepackage{datatool}
\DTLloadrawdb[omitlines=1,noheader]{results}{temporal-redundancy-line.csv}
\begin{tabularx}{\textwidth}{p{3cm}XXXXXXXXXXp{0cm}}
\DTLforeach{results}{}{\DTLforeachkeyinrow{\thisValue}{\thisValue&}\\}
\end{tabularx}

How to extract pages in a PDF document?


pdftk A=source.pdf cat A96-103 output extraction.pdf

How to have nice hyperlinks in PDFs produced from Latex?

\usepackage[colorlinks,linkcolor=blue,citecolor=blue,urlcolor=blue]{hyperref}

How to get line breaks in LaTeX tables?

To obtain line breaks (new line, line feed) in Latex tables, one can not use \\, but \newline works:

\begin{tabular}{| c | c | c |  c |}
\hline
\# & Duration\newline (month) & Title & Task Leader \\
\hline
\end{tabular}

How to have nice boxes in LaTeX


\usepakage{mdframed}
\mdfsetup{
  nobreak=true,
  frametitlebackgroundcolor   =black!15,
  frametitlerule              =true,
  roundcorner                 =1pt,
  middlelinewidth             =1pt,
  innermargin                 =0.1cm,
  outermargin                 =0.1cm,
  innerleftmargin             =0.1cm,
  innerrightmargin            =0.1cm,
  innertopmargin              =0.1cm,
  innerbottommargin           =0.1cm
}

\begin{mdframed}[frametitle=Insights from the experiment]
\end{mdframed}
Tagged as: